![当 IPv6 被禁用时,Debian 10 Buster 无法作为客户端续订 DHCP](https://linux22.com/image/740690/%E5%BD%93%20IPv6%20%E8%A2%AB%E7%A6%81%E7%94%A8%E6%97%B6%EF%BC%8CDebian%2010%20Buster%20%E6%97%A0%E6%B3%95%E4%BD%9C%E4%B8%BA%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%BB%AD%E8%AE%A2%20DHCP.png)
在我将 Debian 9 升级到 10 之后,Buster 服务器在重启 24 小时后丢失了网络连接,我认为问题是它无法从 DHCP 服务器更新 IP 地址。
我/var/lib/dhcp
看到里面有过期日期的文件dhclient.eth0.leases
。
该服务在 Debian 9 上没有问题,但在 Debian 10 上出现此错误:
root@debian:~# systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled;
vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-07-25 15:18:02
CEST; 2h 39min ago
Docs: man:interfaces(5)
Process: 380 ExecStart=/sbin/ifup -a --read-environment
(code=exited, status=1/FAILURE)
Main PID: 380 (code=exited, status=1/FAILURE)
Jul 25 15:18:01 debian-2gb-nbg1-2 dhclient[402]: DHCPREQUEST for
116.203.xx.xx on eth0 to 255.255.255.255 port 67
Jul 25 15:18:01 debian-2gb-nbg1-2 dhclient[402]: DHCPACK of
116.203.xx.xx from 172.31.1.1
Jul 25 15:18:01 debian-2gb-nbg1-2 ifup[380]: DHCPACK of 116.203.xx.xx
from 172.31.1.1
Jul 25 15:18:01 debian-2gb-nbg1-2 dhclient[402]: bound to
116.203.xx.xx -- renewal in 34516 seconds.
Jul 25 15:18:01 debian-2gb-nbg1-2 ifup[380]: bound to 116.203.xx.xx
-- renewal in 34516 seconds.
Jul 25 15:18:02 debian-2gb-nbg1-2 ifup[380]: RTNETLINK answers:
Permission denied
Jul 25 15:18:02 debian-2gb-nbg1-2 ifup[380]: ifup: failed to bring up eth0:0
Jul 25 15:18:02 debian-2gb-nbg1-2 systemd[1]: networking.service: Main
process exited, code=exited, status=1/FAILURE
Jul 25 15:18:02 debian-2gb-nbg1-2 systemd[1]: networking.service:
Failed with result 'exit-code'.
Jul 25 15:18:02 debian-2gb-nbg1-2 systemd[1]: Failed to start Raise
network interfaces.
谢谢你的帮助。
编辑:问题解决了,看起来 Debian 10 不喜欢像 v9 那样禁用 IPv6。
如果有人知道如何在 Buster 中禁用 IPv6,请告诉我们。
# disabling of IPv6 in Debian 9, not working in Debian 10
/etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1