Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • Do local packets only go through INPUT? Or do they traverse OUTPUT first and then INPUT? Commented Feb 26, 2022 at 11:35
  • The remote side (the container) isn't from the same network stack: consider it a remote system. So it goes through the container's network stack OUTPUT (in case the container has iptables rules itself) and arrives at the host's network stack INPUT. Host's network stack never sees it in OUTPUT. Commented Feb 26, 2022 at 11:41
  • schematic to help: en.wikipedia.org/wiki/Netfilter#/media/… Commented Feb 26, 2022 at 11:44
  • Oh! I may have been thinking about this all wrong. I thought all docker networking happened within the host, and from the nftables perspective it just looked like the host just had lots of IPs. Does this mean that direct container-to-container connections never go through any of the host's nfttables rules? And in theory you could add nftables inside a container that would be completely separate to the host? Commented Feb 26, 2022 at 12:30
  • Normally that would mean what you said. But actually, as I wrote in a comment to your other question, as the host holds a lot of bridges, container-to-container traffic goes through these bridges AND the kernel module br_netfilter is loaded by Docker, container-to-container traffic DOES pass through host's iptables (and nftables) becauses frames of type IPv4 (0x800) are temporarily converted to packets for the specific goal of being filtered by iptables (and nftables as a collateral) then converted back to frames. Commented Feb 26, 2022 at 12:34