3 ms·
If you are going that far why not just: iptables -t filter -I FORWARD -j DROP and while you are at it: sysctl -w net.ipv4.conf.all.forwarding=0 s
by jandrese 4y ago
If you are going that far why not just:
iptables -t filter -I FORWARD -j DROP
and while you are at it:
sysctl -w net.ipv4.conf.all.forwarding=0
sysctl -w net.ipv6.conf.all.forwarding=0
- 0xbadcafebee 4y ago....because then containers can't network at all to non-local networks, e.g. no internet access. for bridge networks at least (which is the default). by specifying the drop for new connections incoming from the external interface, you stop connections to listening services from external networks, but established and related connections can continue implicitly, so forwarding still works for outbound connections. if you really want to block all internet access for containers, and stop anything else on your system that might need to use forwarding, then your suggestion is correct.