当 IPv6 被禁用时,Debian 10 Buster 无法作为客户端续订 DHCP

当 IPv6 被禁用时,Debian 10 Buster 无法作为客户端续订 DHCP

在我将 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

相关内容