大网数据广告活动
服务器运维问答

Default IPv6 route keeps disappearing

· 52CE 我爱测

I've got an dedicated server hosted by KimSufi that's running Ubuntu Server 18.04 . While I've goto both an IPv4 address and an IPv6 address, I keep getting random dropouts on IPv6. Doing a ping -6 google.com when it's dropped ou…

问题原文

原帖链接 · starbeamrainbowlabs · CC BY-SA 4.0

I've got an dedicated server hosted by KimSufi that's running Ubuntu Server 18.04. While I've goto both an IPv4 address and an IPv6 address, I keep getting random dropouts on IPv6. Doing a ping -6 google.com when it's dropped out yields this:

Network is unreachable

If I try sudo ifup eth0`, then I get this:

RTNETLINK answers: File exists Failed to bring up eth0.

...as the interface is already up - just IPv4 only. By executing ifup -n eth0 however, I can see a list of commands it executes when bringing the interface up. In particular, executing the following command appears to fix the issue temporarily:

/sbin/ip -family inet6 route add default via 2001:41d0:e:07ff:ff:ff:ff:ff

....then (after a bit of a delay), testing via ping -6 google.com works again.

However, it drops out again randomly soon after.

Does anyone know what's going on, and how I can stop the default IPv6 route from disappearing?

Edit: The IPv6 section of /etc/network/interfaces looks like this:

iface eth0 inet6 static
    address 2001:41d0:e:074b::1
    netmask 128
    dns-nameservers 2001:41d0:3:163::1
    post-up /sbin/ip -family inet6 route add 2001:41d0:e:07ff:ff:ff:ff:ff dev eth0
    post-up /sbin/ip -family inet6 route add default via 2001:41d0:e:07ff:ff:ff:ff:ff
    pre-down /sbin/ip -family inet6 route del default via 2001:41d0:e:07ff:ff:ff:ff:ff
    pre-down /sbin/ip -family inet6 route del 2001:41d0:e:07ff:ff:ff:ff:ff dev eth0

已采纳解答

原帖链接 · guzzijason · CC BY-SA 4.0

Based on comments provided so far, I would try replacing the routing on the interface config with the following:

post-up /sbin/ip -family inet6 route add default via fe80::1ee6:c7ff:fe52:740 dev eth0
pre-down /sbin/ip -family inet6 route del default via fe80::1ee6:c7ff:fe52:740 dev eth0

... and see if that has any affect on the reliabiltiy of the default route.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-09-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。