-
Notifications
You must be signed in to change notification settings - Fork 797
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
RFE: Support managed iptables #424
Comments
This might be another alternative that provides flexibility - #461 |
This isn't a CNI specific problem. Anything doing an iptables-restore must be careful to only change/add/remove chains that tool itself controls, otherwise it will blow away any other rules on the system. For example, kube-proxy takes great pains to make sure it only restores its own chains, and leaves other chains alone. This really sounds like a bug in the external tool doing iptables-restore, where that tool needs to be a better citizen and not assume it has complete control over the firewall (which it doesn't). |
I solved my problem by saving/restoring the But CNI (and kube-proxy) add themselves to standard chains at top most positions. I can hack around this by creating jumps at more suitable positions by adding rules with exactly the same parameters . But these parameters (which include comments like "* CNI portfwd requiring masquerade */") are not documented and are determined by trial and errors. I have a bad feeling that they change with the time (fixing typos in comments or so) and create silently leaks in my packet filters. There should be a switch which disables touching |
Here,
iptables
rules are managed by external tools which do effectively aiptables-restore
to set the policy. Because CNI writes directly into the iptables its rules are lost and networking of containers is broken when policy is reloaded.I see two ways (beside switching to slirp4netns or so) to solve this:
add an option to call a script to set CNI networking rules (instead of the
iptables
executable and/or writing on netlink sockets)support a less intrusive and more predictable setup:
PREROUTING
,POSTROUTING
,FORWARD
, ...)With this, I can call the chains manually and save/restore their content.
The text was updated successfully, but these errors were encountered: