Conversation
In release 27.0, ip6tables was enabled by default. That caused a problem on some hosts where iptables was explicitly disabled and loading the br_netfilter module (which loads with its nf-call-iptables settings enabled) caused user-defined iptables rules to block traffic on bridges, breaking inter-container communication. In 27.3.0, commit 5c499fc delayed loading of the br_netfilter module until it was needed. The load now happens in the function that sets bridge-nf-call-ip[6]tables when needed. It was only called for icc=false networks. However, br_netfilter is also needed when userland-proxy=false. Without it, packets addressed to a host-mapped port for a container on the same network are not DNAT'd properly (responses have the server container's address instead of the host's). That means, in all releases including 26.x, if br_netfilter was loaded before the daemon started - and the OS/user/other-application had disabled bridge-nf-call-ip[6]tables, it would not be enabled by the daemon. So, ICC would fail for host-mapped ports with the userland-proxy disabled. The change in 27.3.0 made this worse - previously, loading br_netfilter whenever iptables/ip6tables was enabled meant that bridge-netfiltering got enabled, even though the daemon didn't check it was enabled. So... check that br_netfilter is loaded, with bridge-nf-call-ip[6]tables enabled, if userland-proxy=false. Signed-off-by: Rob Murray <[email protected]> (cherry picked from commit 0548fe2) Signed-off-by: Rob Murray <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
In release 27.0, ip6tables was enabled by default. That caused a problem on some hosts where iptables was explicitly disabled and loading the
br_netfiltermodule (which loads with itsnf-call-iptablessettings enabled) caused user-defined iptables rules to block traffic on bridges, breaking inter-container communication.In 27.3.0, #48511 delayed loading of the
br_netfiltermodule until it was needed. The load now happens in the function that setsbridge-nf-call-ip[6]tableswhen needed. It was only called foricc=falsenetworks.However,
br_netfilteris also needed whenuserland-proxy=false. Without it, packets addressed to a host-mapped port for a container on the same network are not DNAT'd properly (responses have the server container's address instead of the host's).That means, in all releases including 26.x, if
br_netfilterwas loaded before the daemon started - and the OS/user/other-application had disabledbridge-nf-call-ip[6]tables(which apparently some OSs try to do), it would not be enabled by the daemon. So, ICC would fail for host-mapped ports with the userland-proxy disabled.The change in 27.3.0 made this worse - previously, loading
br_netfilterwheneveriptables/ip6tableswas enabled meant that bridge-netfiltering got enabled, even though the daemon didn't check it was enabled.- How I did it
Check that
br_netfilteris loaded, withbridge-nf-call-ip[6]tablesenabled, ifuserland-proxy=false.- How to verify it
New test that disables
bridge-nf-call-iptablesand the userland proxy, then tries to access another container's mapped port ... not quite the same as unloadingbr_netfilter- but this test fails with a daemon built from the 26.1 branch (as well as 27.x).Manually tested on an Ubuntu VM, including with
br_netfilterunloaded before starting the daemon.- Description for the changelog