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

Removal of ip6table Rules Upon Stopping Container #62

Closed
abhinava opened this issue Aug 8, 2020 · 5 comments
Closed

Removal of ip6table Rules Upon Stopping Container #62

abhinava opened this issue Aug 8, 2020 · 5 comments

Comments

@abhinava
Copy link

abhinava commented Aug 8, 2020

Hi there! Thanks for this really awesome utility! I've been using this for few days now and seems to work really well!

One feature enhancement if you can consider, is to remove all the ip6table rules when the container is stopped. I tried to manually delete the rules myself externally after stopping the container but this seems a bit complex.

Perhaps you know the different chains and rules that are being created when the container is started - Perhaps you can have a script that can be run which can clean-up/remove these rules?

@robbertkl
Copy link
Owner

Hi @abhinava, docker-ipv6nat has a --cleanup flag for removing all of the created IPv6 rules on shutdown of docker-ipv6nat itself. Individual container rules are automatically added (and removed!) when containers get started/stopped (or connected/disconnected from a Docker network).

@abhinava
Copy link
Author

abhinava commented Aug 8, 2020

Thanks! I'm using the container version (link) not the native binary as a Linux systemd service.

Is there a particular way to stop the container? If I try the "docker container stop..", the rules don't seem to be getting cleaned up. Perhaps Am I missing something?

@robbertkl
Copy link
Owner

You can add --retry --cleanup to the end of the command you use to start the ipv6nat container.

(--retry is the default, as can be seen in https://github.com/robbertkl/docker-ipv6nat/blob/master/Dockerfile)

@abhinava
Copy link
Author

abhinava commented Aug 8, 2020

Awesome! Thanks for this tip!

Perhaps you could add this note to the README?

@robbertkl
Copy link
Owner

Great suggestion, I've clarified it a bit in the README, see e60fa0f.

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

No branches or pull requests

2 participants