User Tools

Site Tools


software:docker

This is an old revision of the document!


Docker

Fixes

Broken bridge with KVM (or anything else)

Docker sets a lot of automatic rules in your iptables. If you use a network bridge on your Linux box, you may want to change add an additional rule to avoid traffic generated on your bridge from being discarded by Docker.

$ EDITOR=vim sudo -E systemctl edit docker
[Service]
ExecStartPre=-/usr/sbin/iptables -I FORWARD -i br0 -j ACCEPT
ExecStopPost=/usr/sbin/iptables -D FORWARD -i br0 -j ACCEPT

(the “-” at the beginning tolerates failures. In this way, both if the rule doesn't exist or it's duplicate, a new one gets created and then delete during stopping)

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

Remember to adjust your iptables path according to the distro you are using.

More details and credit here and here

software/docker.1622751951.txt · Last modified: (external edit)