0

I ran

ip route flush all

Now I have no routes at all. For my network interface to reset itself all I had to do was click on the network in network manager and it reconnects and sets all my local network routes back correctly.

Docker previously had the following routes.

$ docker network ls
NETWORK ID          NAME                         DRIVER              SCOPE
63020b1cb1d1        bridge                       bridge              local
a762e757a6f2        dtestnet                     bridge              local
42ebdc968b28        dtestnet2                    bridge              local
5a70e302ed35        host                         host                local
50bd71cfe87f        none                         null                local
e79fd5be2161        ssh-systemd-ubuntu_default   bridge              local


$ ip r l
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
172.18.0.0/16 dev br-a762e757a6f2 proto kernel scope link src 172.18.0.1 linkdown 
172.20.0.0/16 dev br-42ebdc968b28 proto kernel scope link src 172.20.0.1 linkdown 
172.22.0.0/16 dev br-c1a38add5116 proto kernel scope link src 172.22.0.1 
172.23.0.0/16 dev br-411e2604e9b1 proto kernel scope link src 172.23.0.1 

I didn't include these details prior to a restart and a docker network prune. So this only shows the one docker0 interface

ip l l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 04:92:26:02:4b:a2 brd ff:ff:ff:ff:ff:ff
3: wlo1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 2e:26:42:d5:dc:e0 brd ff:ff:ff:ff:ff:ff
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether f2:99:b9:9a:2c:91 brd ff:ff:ff:ff:ff:ff

It now has nothing but my local routes. docker network ls still shows the same list of docker networks above.

Non of my docker images are working as there are no routes to the actual containers. I have also restarted the docker.service, NetworkManager.service services with no success in restoring the network routes and interfaces.

systemctl status docker 
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2019-03-07 16:21:59 SAST; 1min 39s ago
    Docs: https://docs.docker.com
Main PID: 24556 (dockerd)
    Tasks: 47 (limit: 4915)
Memory: 65.1M
CGroup: /system.slice/docker.service
        ├─24556 /usr/bin/dockerd -H fd://
        └─24574 containerd --config /var/run/docker/containerd/containerd.toml --log-level inf

Additionally

If I use ip link [dev] [up/down] it re-adds the routes but the link still shows down.

ip l set docker0 down
ip r l
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 

I see that there are devices listed in systemd related to docker service. These are device files, I am not sure how they relate

systemctl list-units | grep docker
sys-devices-virtual-net-docker0.device                                                    loaded active plugged   /sys/devices/virtual/net/docker0                                             
sys-subsystem-net-devices-docker0.device                                                  loaded active plugged   /sys/subsystem/net/devices/docker0                                           
docker.service                                                                            loaded active running   Docker Application Container Engine                                          
docker.socket                                                                             loaded active running   Docker Socket for the API

Docker setups network links through the a bridged devices. Some thing is notworking correctly with the bridged device https://medium.com/@xiaopeng163/docker-bridge-networking-deep-dive-3e2e0549e8a0 https://developer.ibm.com/recipes/tutorials/networking-your-docker-containers-using-docker0-bridge/

brctl show
bridge name bridge id       STP enabled interfaces
br-0fce78dfb0da     8000.024289a30906   no      
br-95173e3c7322     8000.02426a728db1   no      
docker0     8000.f299b99a2c91   no

when starting docker containers they should automatically connect to the bridge and work. I need to find out more information about fixing the bridge setup in linux.

ip r l t local
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1 
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1 
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1 
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1 
broadcast 172.17.0.0 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
local 172.17.0.1 dev docker0 proto kernel scope host src 172.17.0.1 
broadcast 172.17.255.255 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
broadcast 172.18.0.0 dev br-95173e3c7322 proto kernel scope link src 172.18.0.1 linkdown 
local 172.18.0.1 dev br-95173e3c7322 proto kernel scope host src 172.18.0.1 
broadcast 172.18.255.255 dev br-95173e3c7322 proto kernel scope link src 172.18.0.1 linkdown 
broadcast 172.19.0.0 dev br-0fce78dfb0da proto kernel scope link src 172.19.0.1 linkdown 
local 172.19.0.1 dev br-0fce78dfb0da proto kernel scope host src 172.19.0.1 
broadcast 172.19.255.255 dev br-0fce78dfb0da proto kernel scope link src 172.19.0.1 linkdown
0

I can resolve this by restarting the host.

This will bring up all the services correctly and everything works as long as I don't do a route flush all again.

I still want to understand how this bits and pices work to fix this by restarting or re-configuring the correct services or routes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.