IPv6 网络无法访问。直到重新启动

IPv6 网络无法访问。直到重新启动

我已经在 Ubuntu 14.04 服务器上设置了 IPv6。
一切正常……直到突然(尚未找到触发原因)
a ping6 2001:4860:4860::8888(google nameserver 8.8.8.8) 返回网络无法访问。

当我重新启动服务器时,一切都重新开始工作。并且 ping 问题也解决了。

我的/etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback
iface lo inet6 loopback

# The primary network interface
auto eth0

iface eth0 inet static
address 95.xxx.44.xxx
netmask 255.255.255.0
network 95.xxx.44.0
broadcast 95.xxx.44.255
gateway 95.xxx.44.254
dns-nameservers 8.8.8.8 8.8.4.4
dns-search localdomain

iface eth0 inet6 static
pre-up modprobe ipv6
address 2001:xxxx:4300:xxxx:0008::c01a
netmask 64
gateway 2001:xxxx:4300:xxxx::1
dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
dns-search localdomain

我发现我的/run/network/ifstate有时会缺少它eth0=eth0 ,但无论有没有它,都会出现问题。

编辑:
当一切都不正常时。
输出ip -6 addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2001:xxxx:4300:xxxx:8::69/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::68/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::67/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::66/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::65/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::64/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::63/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::62/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::61/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::60/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::59/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::58/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::57/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::56/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::55/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::54/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::53/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::52/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::51/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::50/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::49/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::48/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::47/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::46/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::45/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::44/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::43/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::42/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::41/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::40/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::39/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::38/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::37/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::36/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::35/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::34/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::33/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::32/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::31/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::30/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::29/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::28/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::27/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::26/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::25/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::24/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::23/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::22/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::21/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::20/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::19/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::18/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::17/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::16/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::15/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::14/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::13/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::12/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::11/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::10/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::9/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::8/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::7/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::6/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::5/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::4/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::3/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::2/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::1/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::/64 scope global 
   valid_lft forever preferred_lft forever
inet6 2001:xxxx:4300:xxxx:8::c01a/64 scope global 
   valid_lft forever preferred_lft forever
inet6 fe80::250:xxxx:xxxx:9b1/64 scope link 
   valid_lft forever preferred_lft forever

并输出ip -6 route

 2001:xxxx:4300:xxxx::/64 dev eth0  proto kernel  metric 256 
 fe80::/64 dev eth0  proto kernel  metric 256 

EDIT2:网络工作时
的输出:ip -6 route

2001:xxxx:4300:xxxx::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 
default via fe80::2d0:ff:fefc:3000 dev eth0  proto ra  metric 1024  expires 1772sec
default via fe80::2d0:ff:fefb:9000 dev eth0  proto ra  metric 1024  expires 1772sec

答案1

似乎有两个设备在通告默认路由,而不是一个。(这可能是路由器上的两个接口。)这些路由通常由服务器发送radvd。您的路由器应该定期通告其路由。

default via fe80::2d0:ff:fefc:3000 dev eth0  proto ra  metric 1024  expires 1772sec
default via fe80::2d0:ff:fefb:9000 dev eth0  proto ra  metric 1024  expires 1772sec

尝试运行tcpdump以捕获路由器广告。识别正在通告错误路由的设备并阻止其将自己通告为路由器。如果您没有看到广告,请尝试配置路由器以发送广告。

您可以使用以下命令暂时恢复连接:

ip -6 route add default via 2001:xxxx:4300:xxxx::1 dev eth0 metric 1024 

如果您对 ICMP6 流量设置防火墙,则可能会阻止 IPv6 正常运行所需的流量。需要的 ICMP 类型有很多:至少有 1-4、130-137、141-143、148-148 和 151-153。有关更多信息,请参阅 RFC4890。

/etc/sysctl.conf检查和的内容,/etc/sysctl看看ipv6.autoconf您的界面是否已禁用。

相关内容