Ubuntu 20.04 서버에서 네트워크 시작이 간헐적으로 실패함

Ubuntu 20.04 서버에서 네트워크 시작이 간헐적으로 실패함

Ubuntu 20.04를 실행하는 새 VPS에서 간헐적인 네트워크 문제가 발생합니다. 10개 중 1개 정도는 재부팅 후 네트워크가 시작되지 않습니다.

이런 경우 서버는 정상적으로 시작되는 것 같은데 ssh나 http로는 접속이 되지 않습니다. 또한 메일 로그에 다음 오류가 표시됩니다. "호스트 또는 도메인을 찾을 수 없습니다. name=gmail.com type=MX에 대한 이름 서비스 오류: 호스트를 찾을 수 없습니다. 다시 시도하십시오." 그래서 문제는 네트워크가 제대로 시작되지 않는 것 같아요.

네트워크가 시작될 때마다 보고되는 시스템 로그에는 네트워크 관련 오류가 있습니다. 그런데 대부분 네트워크에 문제가 없어서 관련이 있는지는 잘 모르겠습니다.

서버는 netplan/networkd를 사용합니다. 이것은 /etc/netplan/01-eth0.yaml의 출력입니다:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 66.175.209.4/24                         # Your Linode's public IPv4 address.
        - "2600:3c03::f03c:92ff:fe7c:62b6/128"    # Primary IPv6 address.
        - "2600:3c03:e001:730::/64"               # Added by me for unique v6 IP
      gateway4: 66.175.209.1                      # Primary IPv4 gateway.
      gateway6: "fe80::1"                         # Primary IPv6 gateway.
      nameservers:
        search: [members.linode.com]              # Search domain.
        addresses: [66.228.42.5,"2600:3c03::7",96.126.106.5,50.116.53.5]    # DNS Server IP addresses.

출력은 다음과 같습니다 networkctl status. 마지막 두 줄의 오류에 유의하세요.

●          State: routable                                     
         Address: 66.175.209.4 on eth0                         
                  2600:3c03::f03c:92ff:fe7c:62b6 on eth0       
                  2600:3c03:e001:730:: on eth0                 
                  fe80::f03c:92ff:fe7c:62b6 on eth0            
         Gateway: 66.175.209.1 (ICANN, IANA Department) on eth0
                  fe80::1 (Cisco Systems, Inc) on eth0         
             DNS: 66.228.42.5                                  
                  96.126.106.5                                 
                  50.116.53.5                                  
                  2600:3c03::7                                 
  Search Domains: members.linode.com                           

Sep 11 03:59:01 eagle systemd-networkd[439]: Enumeration completed
Sep 11 03:59:01 eagle systemd-networkd[439]: eth0: IPv6 successfully enabled
Sep 11 03:59:01 eagle systemd-networkd[439]: eth0: Link UP
Sep 11 03:59:01 eagle systemd-networkd[439]: eth0: Gained carrier
Sep 11 03:59:01 eagle systemd[1]: Started Network Service.
Sep 11 03:59:01 eagle systemd[1]: Starting Wait for Network to be Configured...
Sep 11 03:59:03 eagle systemd-networkd[439]: eth0: Gained IPv6LL
Sep 11 03:59:03 eagle systemd[1]: Finished Wait for Network to be Configured.
Sep 11 03:59:04 eagle systemd-networkd[439]: eth0: Could not set NDisc route or address: Invalid argument
Sep 11 03:59:04 eagle systemd-networkd[439]: eth0: Failed

출력은 다음과 같습니다 networkctl.

  1 lo   loopback carrier     unmanaged
  2 eth0 ether    routable    failed   

2 links listed.

출력은 다음과 같습니다 ip addr.

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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether f2:3c:92:7c:62:b6 brd ff:ff:ff:ff:ff:ff
    inet 66.175.209.4/24 brd 66.175.209.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2600:3c03:e001:730::/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 2600:3c03::f03c:92ff:fe7c:62b6/128 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::f03c:92ff:fe7c:62b6/64 scope link 
       valid_lft forever preferred_lft forever

systemd-networkd에 디버깅을 추가했습니다. 관련 출력은 다음과 같습니다.

Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Link state is up-to-date
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: found matching network '/run/systemd/network/10-netplan-eth0.network'
Sep 18 05:12:07 eagle systemd-networkd[203638]: Setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0'
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: IPv6 successfully enabled
Sep 18 05:12:07 eagle systemd-networkd[203638]: Setting '/proc/sys/net/ipv6/conf/eth0/proxy_ndp' to '0'
Sep 18 05:12:07 eagle systemd-networkd[203638]: Setting '/proc/sys/net/ipv6/conf/eth0/use_tempaddr' to '0'
Sep 18 05:12:07 eagle systemd-networkd[203638]: Setting '/proc/sys/net/ipv6/conf/eth0/accept_ra' to '0'
Sep 18 05:12:07 eagle systemd-networkd[203638]: LLDP: Started LLDP client
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Started LLDP.
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Setting address genmode for link
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.188 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-messa
ge=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Bus bus-api-network: changing state HELLO → RUNNING
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=429496
7295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=signal sender=org.freedesktop.DBus destination=:1.188 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 s
ignature=s error-name=n/a error-message=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=signal sender=org.freedesktop.DBus destination=:1.188 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 s
ignature=s error-name=n/a error-message=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.188 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-messa
ge=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Successfully acquired requested service name.
Sep 18 05:12:07 eagle systemd-networkd[203638]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.188 path=n/a interface=n/a member=n/a cookie=5 reply_cookie=3 signature=n/a error-name=n/a error-mes
sage=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: Match type='signal',sender='org.freedesktop.login1',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager',member='PrepareForSleep' successfully installed.
Sep 18 05:12:07 eagle systemd-networkd[203638]: lo: Link state is up-to-date
Sep 18 05:12:07 eagle systemd-networkd[203638]: lo: State changed: pending -> unmanaged
Sep 18 05:12:07 eagle systemd-networkd[203638]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_31 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=9 reply_
cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Setting address genmode done.
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Removing route: dst: n/a, src: n/a, gw: fe80::1, prefsrc: n/a, scope: global, table: main, proto: static, type: unicast
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Discovering IPv6 routers
Sep 18 05:12:07 eagle systemd-networkd[203638]: NDISC: Started IPv6 Router Solicitation client
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: State changed: pending -> configuring
Sep 18 05:12:07 eagle systemd-networkd[203638]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=10 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Setting addresses
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Forgetting route: dst: n/a, src: n/a, gw: fe80::1, prefsrc: n/a, scope: global, table: main, proto: static, type: unicast
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Remembering updated address: 66.175.209.4/24 (valid forever)
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Remembering updated address: 2600:3c03::f03c:92ff:fe7c:62b6/128 (valid forever)
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Remembering updated address: 2600:3c03:e001:730::/64 (valid forever)
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Addresses set
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Configuring route: dst: n/a, src: n/a, gw: fe80::1, prefsrc: n/a, scope: global, table: main, proto: static, type: unicast
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Configuring route: dst: n/a, src: n/a, gw: 66.175.209.1, prefsrc: n/a, scope: global, table: main, proto: static, type: unicast
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Setting routes
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Remembering route: dst: n/a, src: n/a, gw: fe80::1, prefsrc: n/a, scope: global, table: main, proto: static, type: unicast
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: Routes set
Sep 18 05:12:07 eagle systemd-networkd[203638]: eth0: State changed: configuring -> configured
Sep 18 05:12:07 eagle systemd-networkd[203638]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=11 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Sep 18 05:12:08 eagle systemd-networkd[203638]: NDISC: Sent Router Solicitation, next solicitation in 4s
Sep 18 05:12:08 eagle systemd-networkd[203638]: NDISC: Received Router Advertisement: flags none preference medium lifetime 60 sec
Sep 18 05:12:08 eagle systemd-networkd[203638]: NDISC: Invoking callback for 'router' event.
Sep 18 05:12:08 eagle systemd-networkd[203638]: eth0: Configuring route: dst: n/a, src: n/a, gw: fe80::2c09:59ff:fe49:329f, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Sep 18 05:12:08 eagle systemd-networkd[203638]: rtnl: received route message without ifindex, ignoring
Sep 18 05:12:08 eagle systemd-networkd[203638]: eth0: Could not set NDisc route or address: Invalid argument
Sep 18 05:12:08 eagle systemd-networkd[203638]: eth0: Failed
Sep 18 05:12:08 eagle systemd-networkd[203638]: eth0: State changed: configured -> failed
Sep 18 05:12:08 eagle systemd-networkd[203638]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=12 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Sep 18 05:12:08 eagle systemd-networkd[203638]: NDISC: Stopping IPv6 Router Solicitation client
Sep 18 05:12:13 eagle systemd-networkd[203638]: rtnl: received non-static neighbor, ignoring.
Sep 18 05:12:14 eagle systemd-networkd[203638]: rtnl: received non-static neighbor, ignoring.
Sep 18 05:12:14 eagle systemd-networkd[203638]: rtnl: received non-static neighbor, ignoring.

실패 전의 줄은 다음과 같습니다.rtnl: received route message without ifindex, ignoring

이것이 무엇을 의미하는지/어떻게 해결하는지 아시나요? ipv6 주소 "fe80::2c09:59ff:fe49:329f"에 대한 참조를 찾을 수 없습니다. 이는 ipv6 게이트웨이 "fe80::1"과 관련이 있습니까?

.yaml 파일을 변경해 보았지만 지금까지 보고된 오류를 막을 수 있는 것은 없습니다. 어쨌든 일반적으로 네트워크가 나타나기 때문에 붉은 청어가 될 수 있습니다.

네트워크가 연결되지 않으면 내부 콘솔에서 서버에 연결할 수 있습니다. 연결할 수 없으면 위의 출력에는 아무런 차이가 없습니다.

네트워크 문제가 아닌 경우 이 간헐적인 문제를 다른 무엇으로 설명할 수 있습니까?

답변1

추가하여 오류를 수정했습니다.

accept-ra: no

netplan .yaml구성 파일에. 그러면 위의 오류가 발생하는 것으로 보이는 라우터 광고가 비활성화됩니다.

관련 정보