New answers tagged source
You might have to look more on the iptables setup also. Docker masquerades all traffic originating from the container subnet, say 172.17.0.0/16, to 0.0.0.0. If you run iptables -L -n -t nat, you can see the POSTROUTING chain under nat table which does this - Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE ...
The masquerade isn't from 172.17.42.1 but rather -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE Which means this rule won't work right. ip rule add from 172.17.42.1 table docker Try instead ip rule add from 172.17.0.0/16 table docker
Top 50 recent answers are included