
Problema
Recientemente moví un servidor Ubuntu 20.04 a una nueva casa e intenté conectarlo a la red. Conectarlo mediante un cable Ethernet en mi casa anterior funcionó sin problemas, pero hacerlo con mi nuevo módem no funciona. Después de confirmar que el cable Ethernet funciona con mi computadora portátil, comencé a depurar y llegué a la conclusión de que había configurado algo incorrectamente con netplan.
Intento de solución
La ejecución $ ip a
inicialmente produjo el siguiente resultado:
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
Esto me indicó que eno1
es la interfaz que necesito arreglar; Es probable que todos los puentes y las cinco interfaces provengan de contenedores Docker que ejecuto.
Luego configuré mi 01-netcfg.yaml
archivo con la siguiente configuración recomendada para configurar una conexión con una IP dinámica asignada por DHCP:
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
y ejecutó lo siguiente:
$ sudo netplan --debug generate
$ sudo netplan apply
$ sudo reboot
El resultado de depuración del comando 'generar' arroja lo siguiente:
** (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)
Parece NetworkManager: definition eno1 is not for us
ser un problema y, después de reiniciar, todavía no puedo hacer ping a nada:
$ ping 8.8.8.8
ping: connect: Network is unreachable
Repetí los pasos anteriores usando esta 01-netcfg.yaml
configuración recomendada y confirmé que estoy usando espacios en lugar de tabulaciones y que mi espaciado es correcto:
network:
version: 2
renderer: networkd
Al ejecutar los mismos comandos de configuración con el indicador de depuración se obtiene este resultado:
** (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)
que ya no tiene el NetworkManager: definition eno1 is not for us
mensaje correspondiente (ya que eno1
no se especificó), pero después de aplicar estos cambios generados y reiniciar todavía no obtengo conexión.
He seguido varias publicaciones y guías que parecen recomendar variaciones de estas dos configuraciones, pero creo firmemente que tuvo el mismo problema que estoy experimentando esesta publicación.
Aquí el cartel señala que parte del problema se debió a un error en el kernel 5.4.0-42-generic, que se resolvió instalando el r8168-dkms
controlador. También estoy ejecutando el kernel 5.4.0-42-generic e instalé manualmente este controlador/actualicé initramfs, pero todavía no tuve suerte después de reiniciar y volver a intentar las dos configuraciones de netplan anteriores.
Además, aquí está mi resultado de la ejecución $ sudo lshw -class network
si eso ayuda:
*-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
Pedido
¿Alguien podría ayudarme a solucionar este problema con Netplan y hacer que Ethernet vuelva a funcionar en mi servidor? Realmente aprecio su ayuda, si necesita alguna información adicional de mí, no dude en preguntar :)
Respuesta1
El resultado que se mostró NetworkManager: definition eno1 is not for us
fue correcto; simplemente le dice que esta interfaz está siendo manejada por el networkd
backend y no por el NetworkManager
indicado. Cuando eliminó las referencias eno1
de su yaml, le dijo a netplan que no configurara ninguna interfaz, que no es lo que desea.
Y su ip a
resultado muestra que la eno1
interfaz aparece como NO-CARRIER
. Esto generalmente indica que su hardware es capaz de detectar enlaces y en este caso ha detectado que no hay ningún enlace. Por lo tanto, es posible que deba probar con un cable Ethernet diferente, verificar que su cable esté bien conectado e intentar conectarse a un dispositivo que no sea su módem para verificar que no sea un problema del módem.