大家下午好。在 SuperMicro X7DBN 主板上运行 16.04LTS。我有两个可能相关的问题,我将分别描述。
首先,我似乎在启动后 5-10 分钟内丢失了 IPv6 连接。以下是我的 /etc/network/interfaces 文件的内容
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 172.16.1.100
gateway 172.16.1.1
netmask 255.255.255.0
dns-search home.example.com
dns-nameservers 127.0.0.1
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves enp4s0f0 enp4s0f1
iface bond0 inet6 static
address 2605:aaaa:bbbb:cccc::a
netmask 64
gateway fe80::1
dns-search home.example.com
dns-nameservers ::1
我可以 ping6 网关:
user@monstro:/etc/network/interfaces.d$ ping6 fe80::1 -I bond0
PING fe80::1(fe80::1) from fe80::230:48ff:fec6:fa2 bond0: 56 data bytes
64 bytes from fe80::1: icmp_seq=1 ttl=64 time=0.507 ms
64 bytes from fe80::1: icmp_seq=2 ttl=64 time=0.459 ms
我可以 ping 网关的实际地址:
user@monstro:/etc/network/interfaces.d$ ping6 2605:aaaa:bbbb:cccc::1
PING 2605:aaaa:bbbb:cccc::1(2605:aaaa:bbbb:cccc::1) 56 data bytes
64 bytes from 2605:aaaa:bbbb:cccc::1: icmp_seq=1 ttl=64 time=105 ms
64 bytes from 2605:aaaa:bbbb:cccc::1: icmp_seq=2 ttl=64 time=0.531 ms
我无法 ping 通网关外的任何设备。路由信息:
user@monstro:/etc/network/interfaces.d$ route -6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2605:aaaa:bbbb:cccc::/64 :: UA 256 2 38 bond0
fe80::/64 :: U 256 2 3 bond0
::/0 :: !n -1 1 833 lo
::1/128 :: Un 0 8 48 lo
2605:aaaa:bbbb:cccc::a/128 :: Un 0 2 398 lo
fe80::230:48ff:fec6:fa2/128 :: Un 0 2 88 lo
ff00::/8 :: U 256 7 62 bond0
::/0 :: !n -1 1 833 lo
我提到了两个问题。第二个问题是,每次更改接口文件时,我都必须重新启动。我无法重新启动网络以重新启动网络。接口 bond0 将不会响应。它如下所示:
user@monstro:/etc/network/interfaces.d$ sudo systemctl restart networking
Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
user@monstro:/etc/network/interfaces.d$ journalctl -xe
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit networking.service has begun starting up.
Jun 21 13:37:23 monstro ifup[4164]: sh: echo: I/O error
Jun 21 13:37:23 monstro kernel: bond0: Setting MII monitoring interval to 100
Jun 21 13:37:23 monstro kernel: bond0: option mode: unable to set because the bo
Jun 21 13:37:23 monstro ifup[4164]: sh: echo: I/O error
Jun 21 13:37:23 monstro ifup[4164]: Waiting for a slave to join bond0 (will time
Jun 21 13:37:23 monstro kernel: bond0: option lacp_rate: unable to set because t
Jun 21 13:37:23 monstro ifup[4164]: RTNETLINK answers: File exists
Jun 21 13:37:23 monstro ifup[4164]: Failed to bring up bond0.
Jun 21 13:37:23 monstro systemd[1]: networking.service: Main process exited, cod
Jun 21 13:37:23 monstro systemd[1]: Failed to start Raise network interfaces.
-- Subject: Unit networking.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit networking.service has failed.
--
-- The result is failed.
Jun 21 13:37:23 monstro sudo[4156]: pam_unix(sudo:session): session closed for u
Jun 21 13:37:23 monstro systemd[1]: networking.service: Unit entered failed stat
Jun 21 13:37:23 monstro systemd[1]: networking.service: Failed with result 'exit
lines 2550-2572/2572 (END)
我不知道这两个问题是否相关,或者我是否需要分别处理它们。有人知道吗?谢谢!
答案1
好吧,事实证明这很简单。我必须将以下内容添加到 /etc/sysctl.conf:
net.ipv6.conf.all.accept_ra = 1
在我运行过的以前版本中,这不是必需的,但现在是必需的。至少,对于我的特定设置而言是必需的...