编辑 :我尝试了一些不同的基础上search。 这是现在我的/etc/network/interfaces :
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # This line makes sure the interface will be brought up during boot auto eth0 allow-hotplug eth0 # The primary network interface iface eth0 inet static address 85.17.141.27 netmask 255.255.255.0 gateway 85.17.141.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 85.17.150.123 85.17.96.69 85.17.150.123 62.212.64.122 dns-search localdomain # up commands up ip addr add 85.17.141.33/24 dev eth0 up ip -6 addr add 2001:1af8:4100:a00e:4::1/64 dev eth0 up ip -6 ro add default via 2001:1af8:4100:a00e::1 dev eth0
然后ip addr show eth0输出:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether d4:ae:52:c5:d2:1b brd ff:ff:ff:ff:ff:ff inet 85.17.141.27/24 brd 85.17.141.255 scope global eth0 inet 85.17.141.33/24 scope global secondary eth0 inet6 2001:1af8:4100:a00e:d6ae:52ff:fec5:d21b/64 scope global dynamic valid_lft 2591870sec preferred_lft 604670sec inet6 2001:1af8:4100:a00e:4::1/64 scope global valid_lft forever preferred_lft forever inet6 fe80::d6ae:52ff:fec5:d21b/64 scope link valid_lft forever preferred_lft forever
进一步ip -6 ro输出:
2001:1af8:4100:a00e::/64 dev eth0 proto kernel metric 256 fe80::/64 dev eth0 proto kernel metric 256 default via 2001:1af8:4100:a00e::1 dev eth0 metric 1024 default via fe80::2d0:ff:fe9e:1800 dev eth0 proto kernel metric 1024 expires 1627sec default via fe80::2d0:2ff:fe33:3c00 dev eth0 proto kernel metric 1024 expires 1627sec
最终,两个默认的proto内核路由从输出中消失。 尽pipe如此,我的IPv6连接仍然在某个点上掉线。 再次,简单地运行sudo service networking stop && sudo service networking start得到一切工作再次。 这两条fe80线路也重新出现,这并不奇怪。 任何任何想法?
一边 :从来没有任何IPv4连接有问题。
范围全局dynamic来自接口自动configuration 。 前半部分是你的IPv6前缀,后半部分是EUI-64(从'FF:FE'和你的以太网MAC地址派生,除非你使用IPv6隐私扩展 )
如果你不需要它们,你可以通过执行sysctl net.ipv6.conf.eth.autoconf = 0来禁用它们。
在Debian的/etc/network/interfaces文件中configurationIPv6的正确方法是:
iface eth0 inet6 static address 2001:1af8:4100:a00e:4::1 netmask 64 gateway 2001:1af8:4100:a00e::1
你不应该有任何额外的陈述来configuration你的IPv6地址。