有线连接在启动后 10 分钟内停止工作。我使用的是 MikroTik 路由器,DHCP 租约时间设置为 10 分钟。当我在菜单中关闭/打开网络时,它再次工作(日志中为 18:10:35),下次重启之前不会再出现问题。
日志(路由器):
18:00:00 interface,info ether4 link up (speed 1G, full duplex)
18:00:05 dhcp,info defconf deassigned 192.168.1.171 from 4C:CC:6A:69:5E:71
18:00:05 dhcp,info defconf assigned 192.168.1.171 to 4C:CC:6A:69:5E:71
18:10:05 dhcp,info defconf deassigned 192.168.1.171 from 4C:CC:6A:69:5E:71
18:10:35 dhcp,info defconf assigned 192.168.1.171 to 4C:CC:6A:69:5E:71
日志(cat /var/log/syslog | grep -Ei'dhcp'):
Jun 30 18:10:25 desconocido-pc NetworkManager[1309]: <info> [1530371425.8435] dhcp4 (eno1): canceled DHCP transaction, DHCP client pid 1918
Jun 30 18:10:25 desconocido-pc NetworkManager[1309]: <info> [1530371425.8436] dhcp4 (eno1): state changed bound -> done
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.1597] dhcp4 (eno1): activation: beginning transaction (timeout in 45 seconds)
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.1623] dhcp4 (eno1): dhclient started with pid 4729
Jun 30 18:10:30 desconocido-pc dhclient[4729]: DHCPREQUEST of 192.168.1.171 on eno1 to 255.255.255.255 port 67 (xid=0x7de82b3f)
Jun 30 18:10:30 desconocido-pc dhclient[4729]: DHCPACK of 192.168.1.171 from 192.168.1.1
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2035] dhcp4 (eno1): address 192.168.1.171
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2035] dhcp4 (eno1): plen 24 (255.255.255.0)
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2035] dhcp4 (eno1): gateway 192.168.1.1
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2035] dhcp4 (eno1): lease time 600
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2036] dhcp4 (eno1): nameserver '192.168.1.1'
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2036] dhcp4 (eno1): nameserver '194.50.85.5'
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2036] dhcp4 (eno1): nameserver '194.50.85.7'
Jun 30 18:10:30 desconocido-pc NetworkManager[1309]: <info> [1530371430.2036] dhcp4 (eno1): state changed unknown -> bound
Jun 30 18:15:03 desconocido-pc dhclient[4729]: DHCPREQUEST of 192.168.1.171 on eno1 to 192.168.1.1 port 67 (xid=0x7de82b3f)
Jun 30 18:15:03 desconocido-pc dhclient[4729]: DHCPACK of 192.168.1.171 from 192.168.1.1
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5592] dhcp4 (eno1): address 192.168.1.171
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5593] dhcp4 (eno1): plen 24 (255.255.255.0)
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5593] dhcp4 (eno1): gateway 192.168.1.1
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5593] dhcp4 (eno1): lease time 600
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5594] dhcp4 (eno1): nameserver '192.168.1.1'
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5594] dhcp4 (eno1): nameserver '194.50.85.5'
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5594] dhcp4 (eno1): nameserver '194.50.85.7'
Jun 30 18:15:03 desconocido-pc NetworkManager[1309]: <info> [1530371703.5594] dhcp4 (eno1): state changed bound -> bound
Jun 30 18:15:03 desconocido-pc nm-dispatcher: req:1 'dhcp4-change' [eno1]: new request (1 scripts)
Jun 30 18:15:03 desconocido-pc nm-dispatcher: req:1 'dhcp4-change' [eno1]: start running ordered scripts...
全新安装(可能除了编译 libusb)在 Windows 上工作正常。如何在不增加 DHCP 租约时间也不分配静态 IP 的情况下修复它?谢谢。
答案1
问题的原因是多启动系统时间冲突。我猜它的工作原理类似于(我不知道它实际上是如何实现的):
- 系统时钟/时区已被 Windows 更改。
- Ubuntu 启动。
- 它通过 DHCP 获取网络设置。
- 它使用系统时钟在某个时间点安排下一次更新。
- 您现在已连接到互联网,操作系统同步系统时钟。之前提到的时间点不再有效。
- 设置已过期,但续订现已延迟。
因此如果你有:
- 双启动配置
- 如果在 Ubuntu 之后启动 Windows,则系统时钟时间不正确
- Ubuntu 在初始租约到期后无法更新网络设置,但如果你打开和关闭网络,它就可以正常工作
最终的解决办法是: timedatectl 设置本地 rtc 1