I recently installed a new NIC on my server running ubuntu 18.04.
When I rebooted the server, my networking stopped working (systemwide, not just on docker). Prior to this, I hadn’t done any networking configuration, all my NICs worked without configuration.
So I added a simple systemd networking file to enable the NIC that I was originally using (not the newly installed one):
$ cat /etc/systemd/network/20-wired.network
[Match]
name=enp10s0
[Network]
DHCP=yes
This fixed the connectivity situation on the server, but my docker containers are no longer able to access the internet through the bridge network that they establish via docker-compose.
Here’s the inspector view:
[
{
"Name": "docker-config_default",
"Id": "e4e10240ea559565da0e2769972c942b5b310d57775076ac8d9bf3053bcc1d91",
"Created": "2022-01-30T01:43:25.225740922-08:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"0f60c41014fbce74d12895dcd3a3388123f43df90ed7626c21002ff826c0b687": {
"Name": "1",
"EndpointID": "9ac20a68c41e4691657e1194b8f98b1686e845cae2ce659703f2bd9dfe0f38b8",
"MacAddress": "02:42:ac:12:00:04",
"IPv4Address": "172.18.0.4/16",
"IPv6Address": ""
},
"3d131fab79110bf90393b9a50da3975d31847fc8008e72db4124bb70ab76d798": {
"Name": "2",
"EndpointID": "0365217316c1c6f3b67a66173b64686e60837af86c6e465a37c9335c0706efb3",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
},
"59db15c3175d02ed75ce29f7766f54929cca47424ce6ed3b003b1ba5b79e86ed": {
"Name": "3",
"EndpointID": "fc28fe5c6960ff40d93c651d20da9e694763783d186166ea3e6497ab139fd769",
"MacAddress": "02:42:ac:12:00:06",
"IPv4Address": "172.18.0.6/16",
"IPv6Address": ""
},
"85d036d56881cb4b235756f00566a7c547322c669fb2d746581610d01c094856": {
"Name": "4",
"EndpointID": "ac787196190d37053ed911c67daef9940d80df6cf544f148fe7e1a1c49fb7697",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"9a302987652d682da63a73f88564505eb374b5e8c482c8a119ffc46845898bbc": {
"Name": "5",
"EndpointID": "8ec365210e2e1150218abf5892792724b335a2f4db0bdd2105f4d627434ac21b",
"MacAddress": "02:42:ac:12:00:07",
"IPv4Address": "172.18.0.7/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "docker-config",
"com.docker.compose.version": "1.29.2"
}
}
]
I can’t see any apparent problems here, though brctl show doesn’t seem to include the wired interface in the list of bridged networks:
$ brctl show
bridge name bridge id STP enabled interfaces
br-e4e10240ea55 8000.0242f36469a8 no veth1db27b0
veth2b1bd20
veth6a6c3c1
veth8ff3e0f
vethf15df53
Should I expect to see my NIC (enp1s0) in this list, or not?