Problem
I've recently moved an Ubuntu 20.04 server to a new house and attempted to connect it to the network. Connecting it via an ethernet cable at my previous house worked without issue, but doing so with my new modem isn't working. After confirming the ethernet cable works with my laptop, I started debugging and came to the conclusion that I've configured something incorrectly with netplan.
Attempt at a Solution
Running $ ip a
initially produced the following output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether f8:b1:56:dc:47:25 brd ff:ff:ff:ff:ff:ff
3: br-cd5031a2a690: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:88:f5:00:c2 brd ff:ff:ff:ff:ff:ff
inet 172.29.0.1/16 brd 172.29.255.255 scope global br-cd5031a2a690
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:63:c5:ed:bf brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
5: br-6e210ada6a5d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:cc:35:23:8d brd ff:ff:ff:ff:ff:ff
inet 172.30.0.1/16 brd 172.30.255.255 scope global br-6e210ada6a5d
valid_lft forever preferred_lft forever
inet6 fe80::42:ccff:fe35:238d/64 scope link
valid_lft forever preferred_lft forever
6: br-75e07944c75a: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:cb:38:ca:3c brd ff:ff:ff:ff:ff:ff
inet 172.27.0.1/16 brd 172.27.255.255 scope global br-75e07944c75a
valid_lft forever preferred_lft forever
inet6 fe80::42:cbff:fe38:ca3c/64 scope link
valid_lft forever preferred_lft forever
8: veth5501abf@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6e210ada6a5d state UP group default
link/ether 3e:9d:7d:bc:07:5f brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::3c9d:7dff:febc:75f/64 scope link
valid_lft forever preferred_lft forever
10: veth5f8842d@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-75e07944c75a state UP group default
link/ether f2:f4:e9:50:51:ac brd ff:ff:ff:ff:ff:ff link-netnsid 3
inet6 fe80::f0f4:e9ff:fe50:51ac/64 scope link
valid_lft forever preferred_lft forever
12: veth6164405@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6e210ada6a5d state UP group default
link/ether 5e:f2:e1:fd:1f:4d brd ff:ff:ff:ff:ff:ff link-netnsid 2
inet6 fe80::5cf2:e1ff:fefd:1f4d/64 scope link
valid_lft forever preferred_lft forever
14: veth8f9aa5b@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6e210ada6a5d state UP group default
link/ether 46:c8:0b:f7:c5:ac brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::44c8:bff:fef7:c5ac/64 scope link
valid_lft forever preferred_lft forever
16: vethc256b04@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-75e07944c75a state UP group default
link/ether b6:7c:3e:1e:ec:7e brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::b47c:3eff:fe1e:ec7e/64 scope link
valid_lft forever preferred_lft forever
This indicated to me that eno1
is the interface I need to fix; all the bridges and veth interfaces are likely from Docker containers I run.
I then set my 01-netcfg.yaml
file to the following recommended configuration to setup a connection with a dynamic DHCP-assigned IP:
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
and ran the following:
$ sudo netplan --debug generate
$ sudo netplan apply
$ sudo reboot
The debug output from the 'generate' command spit out the following:
** (generate:4699): DEBUG: 04:02:19.020: Processing input file /etc/netplan/01-netcfg.yaml..
** (generate:4699): DEBUG: 04:02:19.021: starting new processing pass
** (generate:4699): DEBUG: 04:02:19.021: We have some netdefs, pass them through a final round of validation
** (generate:4699): DEBUG: 04:02:19.021: eno1: setting default backend to 1
** (generate:4699): DEBUG: 04:02:19.021: Configuration is valid
** (generate:4699): DEBUG: 04:02:19.021: Generating output files..
** (generate:4699): DEBUG: 04:02:19.021: NetworkManager: definition eno1 is not for us (backend 1)
(generate:4699): GLib-DEBUG: 04:02:19.021: posix_spawn avoided (fd close requested)
The NetworkManager: definition eno1 is not for us
seems to be an issue, and after rebooting I still can't ping anything:
$ ping 8.8.8.8
ping: connect: Network is unreachable
I repeated the above steps using this recommended 01-netcfg.yaml
config instead, and confirmed that I'm using spaces instead of tabs and that my spacing is correct:
network:
version: 2
renderer: networkd
Running the same setup commands with the debug flag yields this output:
** (generate:5041): DEBUG: 04:09:33.721: Processing input file /etc/netplan/01-netcfg.yaml..
** (generate:5041): DEBUG: 04:09:33.721: starting new processing pass
** (generate:5041): DEBUG: 04:09:33.721: We have some netdefs, pass them through a final round of validation
** (generate:5041): DEBUG: 04:09:33.721: Generating output files..
(generate:5041): GLib-DEBUG: 04:09:33.721: posix_spawn avoided (fd close requested)
which no longer has the concerning NetworkManager: definition eno1 is not for us
message (since eno1
wasn't specified), but after applying these generated changes and rebooting I still get no connection.
I've followed a number of posts and guides that seem to recommend variations of these two configs, but one that I strongly believe had the same issue I'm experiencing is this post.
Here the poster notes that part of the problem was from a bug in kernel 5.4.0-42-generic, which was resolved by installing the r8168-dkms
driver. I am also running kernel 5.4.0-42-generic, and manually installed this driver / updated initramfs but still had no luck after rebooting and retrying both of the above netplan configurations.
Additionally, here is my output from running $ sudo lshw -class network
if that helps:
*-network
description: Ethernet interface
product: 82579LM Gigabit Network Connection (Lewisville)
vendor: Intel Corporation
physical id: 19
bus info: pci@0000:00:19.0
logical name: eno1
version: 04
serial: f8:b1:56:dc:47:25
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-4 latency=0 link=no multicast=yes port=twisted pair
resources: irq:25 memory:f7c00000-f7c1ffff memory:f7c39000-f7c39fff ioport:f080(size=32)
*-network:0
description: Ethernet interface
physical id: 1
logical name: br-75e07944c75a
serial: 02:42:cb:38:ca:3c
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.27.0.1 link=yes multicast=yes
*-network:1
description: Ethernet interface
physical id: 2
logical name: veth5f8842d
serial: f2:f4:e9:50:51:ac
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:2
description: Ethernet interface
physical id: 3
logical name: vethc256b04
serial: b6:7c:3e:1e:ec:7e
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:3
description: Ethernet interface
physical id: 4
logical name: br-6e210ada6a5d
serial: 02:42:cc:35:23:8d
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.30.0.1 link=yes multicast=yes
*-network:4
description: Ethernet interface
physical id: 5
logical name: veth5501abf
serial: 3e:9d:7d:bc:07:5f
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:5
description: Ethernet interface
physical id: 6
logical name: br-cd5031a2a690
serial: 02:42:88:f5:00:c2
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.29.0.1 link=no multicast=yes
*-network:6
description: Ethernet interface
physical id: 7
logical name: docker0
serial: 02:42:63:c5:ed:bf
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.17.0.1 link=no multicast=yes
*-network:7
description: Ethernet interface
physical id: 8
logical name: veth6164405
serial: 5e:f2:e1:fd:1f:4d
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:8
description: Ethernet interface
physical id: 9
logical name: veth8f9aa5b
serial: 46:c8:0b:f7:c5:ac
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
Request
Would anyone be able to help me fix this issue with Netplan and get ethernet working on my server again? I really appreciate your help, if there is any additional information you need from me please feel free to ask :)