Netplan이 Ubuntu 20.04 서버에서 이더넷 연결을 인식하지 못합니다.

Netplan이 Ubuntu 20.04 서버에서 이더넷 연결을 인식하지 못합니다.

문제

최근 Ubuntu 20.04 서버를 새 집으로 옮겨서 네트워크에 연결하려고 했습니다. 이전 집에서 이더넷 케이블을 통해 연결하면 문제 없이 작동했지만 새 모뎀에서는 작동하지 않습니다. 이더넷 케이블이 내 노트북에서 작동하는지 확인한 후 디버깅을 시작했고 Netplan에서 뭔가 잘못 구성했다는 결론에 도달했습니다.

해결책을 시도하다

처음에 실행하면 $ ip a다음과 같은 출력이 생성되었습니다.

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

eno1이것은 내가 수정해야 할 인터페이스가 무엇인지 나에게 알려주었습니다 . 모든 브리지와 veth 인터페이스는 내가 실행하는 Docker 컨테이너에서 나온 것일 수 있습니다.

01-netcfg.yaml그런 다음 동적 DHCP 할당 IP와의 연결을 설정하기 위해 내 파일을 다음 권장 구성으로 설정했습니다 .

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: true

그리고 다음을 실행했습니다.

$ sudo netplan --debug generate

$ sudo netplan apply

$ sudo reboot

'generate' 명령의 디버그 출력은 다음을 뱉어냅니다.

** (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) 

문제 NetworkManager: definition eno1 is not for us가 있는 것 같습니다. 재부팅한 후에도 여전히 아무 것도 핑할 수 없습니다.

$ ping 8.8.8.8
ping: connect: Network is unreachable

대신 이 권장 구성을 사용하여 위 단계를 반복하고 01-netcfg.yaml탭 대신 공백을 사용하고 있으며 간격이 올바른지 확인했습니다.

network:
  version: 2
  renderer: networkd

디버그 플래그와 함께 동일한 설정 명령을 실행하면 다음과 같은 출력이 생성됩니다.

** (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) 

더 이상 관련 메시지가 없지만 NetworkManager: definition eno1 is not for us( eno1지정되지 않았기 때문에) 생성된 변경 사항을 적용하고 재부팅한 후에도 여전히 연결이 되지 않습니다.

저는 이 두 구성의 변형을 권장하는 것으로 보이는 여러 게시물과 가이드를 따랐지만, 제가 겪고 있는 것과 동일한 문제가 있다고 강력하게 믿는 게시물은 다음과 같습니다.이 게시물.

여기 포스터에는 문제의 일부가 커널 5.4.0-42-generic의 버그로 인해 발생했으며 드라이버를 설치하여 해결되었다고 나와 있습니다 r8168-dkms. 나는 또한 커널 5.4.0-42-generic을 실행하고 있으며 이 드라이버를 수동으로 설치하고 initramfs를 업데이트했지만 위의 netplan 구성을 모두 재부팅하고 다시 시도한 후에도 여전히 운이 없었습니다.

$ sudo lshw -class network또한 도움이 된다면 실행 결과는 다음과 같습니다 .

  *-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

요구

Netplan에서 이 문제를 해결하고 내 서버에서 이더넷이 다시 작동하도록 도와줄 수 있는 사람이 있습니까? 도움을 주셔서 정말 감사합니다. 추가로 필요한 정보가 있으면 언제든지 문의해 주세요. :)

답변1

표시된 출력이 NetworkManager: definition eno1 is not for us정확했습니다. 이는 단순히 이 인터페이스가 networkd백엔드가 아닌 백엔드 에 의해 처리되고 있음을 알려줍니다 NetworkManager. yaml에서 참조를 제거했을 때 eno1netplan에 원하는 인터페이스가 아닌 인터페이스를 구성하지 말라고 지시했습니다.

출력 결과에 인터페이스가 로 나열되어 있는 ip a것으로 표시됩니다 . 이는 일반적으로 하드웨어가 링크 감지 기능을 갖추고 있으며 이 경우 링크가 없음을 감지했음을 나타냅니다. 따라서 다른 이더넷 케이블을 사용해 보고, 케이블이 제대로 장착되었는지 확인하고, 모뎀이 아닌 다른 장치에 연결해 모뎀 문제가 아닌지 확인해야 할 수도 있습니다.eno1NO-CARRIER

관련 정보