Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create iptables forwarding rule targeting containerlab nodes #788

Merged
merged 9 commits into from
Feb 21, 2022

Conversation

hellt
Copy link
Member

@hellt hellt commented Feb 20, 2022

fix #781

iptables rules management have been added to docker runtime only so far.

Note, apart from the changes done in iptables.go file where the funcs to add/remove iptables rules are, the following changes have been made:

  1. deploy and destroy cmd functions have been scoped out to deployFn and destroyFn accordingly.
  2. Mgmt() method has been added to Runtime interface to allow pulling the management struct
  3. Runtime's struct Mgmt field was changed to mgmt

@hellt
Copy link
Member Author

hellt commented Feb 21, 2022

@LimeHat when you create a management network in podman you don't save the bridge interface under c.mgmt.Bridge like we do for docker - https://github.com/srl-labs/containerlab/blob/iptables-fwd/runtime/docker/docker.go#L204?

Is it feasible to add this step so that this PR can have podman support? The idea here is to automatically add iptables rule allowing external traffic to reach the containerlab nodes. This is achieved by installing an allow rule in the FORWARD chain.

@hellt
Copy link
Member Author

hellt commented Feb 21, 2022

Let me merge this one, and podman we can address in a separate PR. At this moment the iptables management will only happen if the global runtime is set to docker

@hellt hellt merged commit bda571f into main Feb 21, 2022
@hellt hellt deleted the iptables-fwd branch February 21, 2022 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add iptables allow rule for containerlab nodes in the forwarding chain
1 participant