7

A noob here starting with docker in a Orange Pi 3 (Rasberry Pi clone).

I'm trying to configure and start a docker containter (bitwarden_rs), but when I do, I lost connection to the external network. Docker mess with my route table.

Network configuration: I have a bridge br0 that bridges eth0 and wlan0. (Eth0 connects to the router, wlan0 is configured in AP mode)

Table when container is stopped:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    425    0        0 br0  <---OK
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 br0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     425    0        0 br0
192.168.2.0     0.0.0.0         255.255.255.0   U     425    0        0 br0

Table when container is running (No internet access to the exterior)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     205    0        0 docker0 <---NOT OK
default         _gateway        0.0.0.0         UG    425    0        0 br0
link-local      0.0.0.0         255.255.0.0     U     205    0        0 docker0
link-local      0.0.0.0         255.255.0.0     U     230    0        0 vethed140ce
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 br0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     425    0        0 br0
192.168.2.0     0.0.0.0         255.255.255.0   U     425    0        0 br0

What can I do to fix it? It's docker config problem or maybe my system problem (armbian). Thanks

3 Answers 3

13

On ubuntu 20.04, I tried many methods, like prevent dhcpd to update route or change NetworkManager configure to let network-manager to igonre veth* device Neither of the above works.

I spent a lot of time and found that connman service changes default route. Change its config file /etc/connman/main.conf by uncommenting following line:

#NetworkInterfaceBlacklist = vmnet,vboxnet,virbr,ifb,veth-,vb-

and

systemctl restart connman

to restart connman service. The issue resolved eventually.

Sign up to request clarification or add additional context in comments.

3 Comments

I had exactly the same issue, and this fixed it. Before starting a container, if I ran ip route get 1.1.1.1 I would get 1.1.1.1 via 192.168.0.1 dev wlan0 src 192.168.0.10 uid 1000 and then after starting the container, in less than a minute it became 1.1.1.1 dev vethe44ad92 src 169.254.157.82 uid 1000 right as all other hosts became unreachable. The arch wiki specifically mentions the connman network interface blacklist, which is by default commented out in the configuration.
In my case, with a Debian 12 distro, with an LXDE desktop environment, "connman service" effectively interfered with the docker daemon. The docker daemon configuration used was the default one. (/etc/docker/daemon.json file does not exist in my host) In my case only this line was necessary: NetworkInterfaceBlacklist = veth.
What is the equivalent for nmcli? I don't have connman service in my machine and usually use only nmcli
0

This is because, as you can see docker creates a linux bridge named 'docker0'. You can change the default settings for the docker bridge to resolve the issue. Configure the default bridge network by providing the bip option along with the desired subnet in the daemon.json

# vi /etc/docker/daemon.json
{
  "bip": "172.200.0.1/16"
}

and restart the service.

 systemctl restart docker

More details HERE and HERE

Comments

-1

Answer with "bip": "172.200.0.1/16" is wrong, subnet 172.200.0.1/16 is not local, it is wild internet. See any whois service, e.g. https://browserleaks.com/ip/172.200.0.1

1 Comment

This can better be submitted as a "Comment" to the "Answer" you're referring to.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.