我的 Ubuntu 20.04 突然停止更新 dhcp 租约。我的以太网卡已分配了固定 IP,但它需要每 12 小时更新一次租约。事实并非如此。我需要拔下并重新插入以太网电缆才能重新上线。
我在这里发现了很多未解答的问题,所以我认为这是一个相当困难的问题,并且发现了关于一个旧错误的讨论:https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1551351
但是,我不是系统管理员,所以基本上我不知道要检查和寻找什么。
除了通过命令行偶尔更新租约之外,还有人可以给我一些建议吗?
在日志中:
sudo journalctl -b 0 -u NetworkManager
正如评论中所建议的,我看到了这一点3 月 8 日 23:44:58 pc-linux NetworkManager[1047]: [1646779498.8261] dhcp4 (enp6s0): 错误 -113 调度事件每次需要续订 DHCP 租约时:
Mar 08 22:53:37 pc-linux NetworkManager[1047]: <info> [1646776417.5168] dhcp6 (enp6s0): state changed bound -> bound
Mar 08 23:44:58 pc-linux NetworkManager[1047]: <error> [1646779498.8261] dhcp4 (enp6s0): error -113 dispatching events
Mar 08 23:44:58 pc-linux NetworkManager[1047]: <info> [1646779498.8262] dhcp4 (enp6s0): state changed bound -> fail
Mar 08 23:44:58 pc-linux NetworkManager[1047]: <info> [1646779498.8263] device (enp6s0): DHCPv4: trying to acquire a new lease within 90 seconds
Mar 08 23:46:28 pc-linux NetworkManager[1047]: <info> [1646779588.9964] device (enp6s0): DHCPv4: grace period expired
3月9日我没有使用电脑。
3月10日早上9点,我拔/插网线时:
Mar 10 08:58:29 pc-linux NetworkManager[1047]: <info> [1646899109.1535] agent-manager: agent[5214bc57140bb9cb,:1.84/org.gnome.Shell.NetworkAgent/1000]: agent registered
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0908] device (enp6s0): carrier: link connected
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0911] device (enp6s0): DHCPv4 lease renewal requested
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0912] dhcp4 (enp6s0): canceled DHCP transaction
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0912] dhcp4 (enp6s0): canceled DHCP transaction
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0912] dhcp4 (enp6s0): state changed fail -> done
Mar 10 09:00:31 pc-linux NetworkManager[1047]: <info> [1646899231.0935] dhcp4 (enp6s0): activation: beginning transaction (timeout in 45 seconds)
昨天 21:00,租约应该续签的时间:
ar 10 21:00:33 pc-linux NetworkManager[1047]: <error> [1646942433.1181] dhcp4 (enp6s0): error -113 dispatching events
Mar 10 21:00:33 pc-linux NetworkManager[1047]: <info> [1646942433.1182] dhcp4 (enp6s0): state changed bound -> fail
Mar 10 21:00:33 pc-linux NetworkManager[1047]: <info> [1646942433.1182] device (enp6s0): DHCPv4: trying to acquire a new lease within 90 seconds
Mar 10 21:02:02 pc-linux NetworkManager[1047]: <info> [1646942522.9984] device (enp6s0): DHCPv4: grace period expired
过了一会儿:
Mar 10 22:23:16 pc-linux NetworkManager[1047]: <info> [1646947396.9413] manager: NetworkManager state is now CONNECTED_SITE
Mar 10 22:23:17 pc-linux NetworkManager[1047]: <info> [1646947397.1908] manager: NetworkManager state is now CONNECTED_GLOBAL
Mar 10 22:53:36 pc-linux NetworkManager[1047]: <info> [1646949216.9407] manager: NetworkManager state is now CONNECTED_SITE
Mar 10 22:53:37 pc-linux NetworkManager[1047]: <info> [1646949217.2368] manager: NetworkManager state is now CONNECTED_GLOBAL
我看到的唯一警告信息是:
Mar 08 11:44:52 pc-linux NetworkManager[1047]: <warn> [1646736292.8205] ifupdown: interfaces file /etc/network/interfaces doesn't exist
Mar 08 11:44:53 pc-linux NetworkManager[1047]: <warn> [1646736293.1600] Error: failed to open /run/network/ifstate
今天早上 9:00 编辑此消息时,DHCP 未续订:现在我已断开连接,日志仅显示:
Mar 11 08:56:57 pc-linux NetworkManager[1047]: <info> [1646985417.5167] dhcp6 (enp6s0): option dhcp6_domain_search => '#DOMAIN#'
Mar 11 08:56:57 pc-linux NetworkManager[1047]: <info> [1646985417.5168] dhcp6 (enp6s0): option dhcp6_name_servers => '#MAC1# #MAC2#'
Mar 11 08:56:57 pc-linux NetworkManager[1047]: <info> [1646985417.5168] dhcp6 (enp6s0): option ip6_address => '#MAC#'
Mar 11 08:56:57 pc-linux NetworkManager[1047]: <info> [1646985417.5169] dhcp6 (enp6s0): state changed bound -> bound
Mar 11 09:02:26 pc-linux NetworkManager[1047]: <info> [1646985746.9424] manager: NetworkManager state is now CONNECTED_SITE
lines 516-570/570 (END)
奇怪:我无法访问任何网站。错误信息是
https://www.amazon.it/ is unreachable.
ERR_ADDRESS_UNREACHABLE
对于其他所有网站和域名来说也是如此:
https://www.bbc.co.uk/ is unreachable.
ERR_ADDRESS_UNREACHABLE
奇怪的是,我可以在 Google 上进行网页搜索(我的 DNS 服务器由我的雇主提供,我不使用 Google 服务器)。我无法解释这种行为。
拔/插网线后:
Mar 11 09:11:34 pc-linux NetworkManager[1047]: <info> [1646986294.6023] device (enp6s0): carrier: link connected
Mar 11 09:11:34 pc-linux NetworkManager[1047]: <info> [1646986294.6026] device (enp6s0): DHCPv4 lease renewal requested
Mar 11 09:11:34 pc-linux NetworkManager[1047]: <info> [1646986294.6028] dhcp4 (enp6s0): canceled DHCP transaction
所以现在我可以发布此消息了。