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

iptables chain DOCKER-USER for nat/POSTROUTING #40544

Open
powerman opened this issue Feb 20, 2020 · 2 comments
Open

iptables chain DOCKER-USER for nat/POSTROUTING #40544

powerman opened this issue Feb 20, 2020 · 2 comments
Labels
area/networking kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@powerman
Copy link

Currently we've DOCKER-USER iptables chain, but this helps managing only filter/FORWARD chain, while there are other chains modified by docker

E.g. I'm running docker on a router, and I've several own records in nat/POSTROUTING chain with -j MASQUERADE and -j SNAT. Docker currently adds own rules both before and after my own rules, which makes updating own rules inconvenient and often result in needs to restart docker daemon after updating firewall rules.

I propose to add custom chains like DOCKER-USER also to nat/POSTROUTING, and probably to all other chains modified by docker (just in case, to solve this once and for all).

@IvMisticos
Copy link

The issue should be bumped as it can be used quite a lot by some and would be great to have.

@matthijskooijman
Copy link

matthijskooijman commented Jan 13, 2023

It seems that #41163 is a duplicate of this issue (that issue also mentions PREROUTING in the title, but this issue mentions applying this for all chains modified by docker, making this issue the broader one.

and probably to all other chains modified by docker (just in case, to solve this once and for all).

Maybe it would even be good to add these chains to all default chains (even when they are not currently modified by docker), to prevent additional upgrade friction when docker is modified to add rules to other chains in the future.

Also note issue #42477, requesting a DOCKER-USER chain for ipv6 too.

I've just posted #44816 about docker adding rules directly to the main chains (e.g. FORWARD), not just its own chains (e.g. DOCKER), which is related to this issue (they should probably be solved together to make docker iptables behavior more predictable and interoperable).

Wrt to the subject of this issue, I wrote the following in that issue:

Similarly, the DOCKER-USER chain should be duplicate for each main rule, e.g. DOCKER-USER-INPUT, DOCKER-USER-FORWARD, etc. Or maybe it could be renamed to something more explicit like BEFORE-DOCKER-FORWARD to make the ordering more explicit (maybe also add AFTER-DOCKER-FORWARD for more control over ordering)?

@sam-thibault sam-thibault added area/networking kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny labels Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

No branches or pull requests

4 participants