NETWORK / Overlay/ Bridge

Visualization via Portainer:

The docker0 bridge is virtual interface created by docker, it randomly chooses an address and subnet from the private range defined by RFC 1918 that are not in use on the host machine, and assigns it to docker0. All the docker containers will be connected to the docker0 bridge by default, the docker containers connnected to the docker0 bridge could use the iptables NAT rules created by docker to communicate with the outside world.

$ ifconfig
br-31710a035769: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.21.0.1  netmask 255.255.0.0  broadcast 172.21.255.255
        inet6 fe80::42:1ff:fea1:967b  prefixlen 64  scopeid 0x20<link>
        ether 02:42:01:a1:96:7b  txqueuelen 0  (Ethernet)
        RX packets 14  bytes 2023 (1.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7  bytes 826 (826.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br-7722e6280c94: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.19.0.1  netmask 255.255.0.0  broadcast 172.19.255.255
        ether 02:42:a5:75:db:16  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br-d65fd7576eda: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.20.0.1  netmask 255.255.0.0  broadcast 172.20.255.255
        ether 02:42:ef:44:d1:8b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:57ff:fe98:606  prefixlen 64  scopeid 0x20<link>
        ether 02:42:57:98:06:06  txqueuelen 0  (Ethernet)
        RX packets 1991  bytes 718667 (701.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1926  bytes 519919 (507.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker_gwbridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        inet6 fe80::42:50ff:feba:99d3  prefixlen 64  scopeid 0x20<link>
        ether 02:42:50:ba:99:d3  txqueuelen 0  (Ethernet)
        RX packets 512  bytes 356446 (348.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 653  bytes 147926 (144.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.23  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::ece8:d1a0:af88:499  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:0a:ed:2a  txqueuelen 1000  (Ethernet)
        RX packets 1304281  bytes 1518840155 (1.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 754363  bytes 249836692 (238.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 46941  bytes 4301574 (4.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46941  bytes 4301574 (4.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethd192713: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.76.63  netmask 255.255.0.0  broadcast 169.254.255.255
        inet6 fe80::f46c:895:f5c2:b93b  prefixlen 64  scopeid 0x20<link>
        ether 62:96:0c:27:a2:09  txqueuelen 0  (Ethernet)
        RX packets 74  bytes 6988 (6.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 445  bytes 149066 (145.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethd56ba56: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.26.89  netmask 255.255.0.0  broadcast 169.254.255.255
        inet6 fe80::69e0:1379:686f:ff87  prefixlen 64  scopeid 0x20<link>
        ether 7e:0b:9f:1d:90:d8  txqueuelen 0  (Ethernet)
        RX packets 1987  bytes 746125 (728.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2414  bytes 695808 (679.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethfc7c41f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.186.128  netmask 255.255.0.0  broadcast 169.254.255.255
        inet6 fe80::8d9a:c2ca:d220:f7a7  prefixlen 64  scopeid 0x20<link>
        ether 0e:c2:07:44:10:50  txqueuelen 0  (Ethernet)
        RX packets 337  bytes 346443 (338.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 999  bytes 297424 (290.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether dc:a6:32:0a:ed:2b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Explaining overlays can best be told via visualization:

https://github.com/marcelbrouwers/swarmoverlayvisualizer

https://docs.docker.com/storage/storagedriver/overlayfs-driver/

Leave a Reply

Your email address will not be published. Required fields are marked *