我开始在 Ubuntu 20.04.4 ( 5.4.0-121-generic
) 上看到一个非常奇怪的行为,网络断网 5 分钟,然后又通网 3 分钟。奇怪的是,当网络故障我懂了:
username@ws01u:~$ ifconfig eno1
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether I DELETED MAC txqueuelen 1000 (Ethernet)
RX packets 17761 bytes 1796102 (1.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10256 bytes 1288807 (1.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf7e00000-f7e20000
我无法从外部 ping 这台机器,但可以从这台机器 ping 通!RX 数据包正在移动,但 TX 没有移动。
之后回到两种方式都可以 ping 通,并且网络可以进行任何访问:
username@ws01u:~$ ifconfig eno1
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.2 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::36e6:d7ff:fe24:9f6d prefixlen 64 scopeid 0x20<link>
ether I DELETED MAC txqueuelen 1000 (Ethernet)
RX packets 18280 bytes 1848698 (1.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10522 bytes 1320094 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf7e00000-f7e20000**
此时,ifconfig 开始显示我之前设置的静态 IP,并且 TX 数据包也正在激活。
显示cat /var/log/syslog
以下信息:
Jul 4 15:43:10 ws01u NetworkManager[2301]: <warn> [1656949390.2327] dhcp4 (eno1): request timed out
Jul 4 15:43:10 ws01u NetworkManager[2301]: <info> [1656949390.2328] dhcp4 (eno1): state changed unknown -> timeout
Jul 4 15:43:10 ws01u NetworkManager[2301]: <info> [1656949390.2330] device (eno1): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Jul 4 10:43:10 ws01u NetworkManager[2301]: <warn> [1656949390.2367] device (eno1): Activation: failed for connection 'netplan-eno1'
Jul 4 10:43:10 ws01u NetworkManager[2301]: <info> [1656949390.2376] device (eno1): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jul 4 10:43:10 ws01u NetworkManager[2301]: <info> [1656949390.2546] dhcp4 (eno1): canceled DHCP transaction
Jul 4 10:43:10 ws01u NetworkManager[2301]: <info> [1656949390.2546] dhcp4 (eno1): state changed timeout -> done
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2327] policy: auto-activating connection 'netplan-eno1' (10838d80-caeb-349e-ba73-08ed16d4d666)
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2343] device (eno1): Activation: starting connection 'netplan-eno1' (10838d80-caeb-349e-ba73-08ed16d4d666)
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2348] device (eno1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2364] device (eno1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2383] device (eno1): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jul 4 10:48:10 ws01u NetworkManager[2301]: <info> [1656949690.2395] dhcp4 (eno1): activation: beginning transaction (timeout in 45 seconds)
Jul 4 10:48:12 ws01u systemd-networkd[892]: eno1: Gained IPv6LL
前七条日志是网络断线时的日志(Jul 4 10:43:10
),第二条日志是网络恢复正常时的日志(Jul 4 10:48:10
),最后一条日志是网络断线时的日志。
netplan 配置为接收192.168.3.2
有什么建议吗?提前致谢。