在通过路由器的 radvd 通告隧道连接到 ipv6 互联网的 Linux 机器上,ip -6 route
会累积最近的地址。为什么会发生这种情况?这是预期行为,还是机器配置错误?在直接连接到 ipv6 隧道的另一台机器上,ip -6 route
会保留一个较短的列表。
在客户端(正在积累最近的地址作为路由):
ip -6 route # after pinging ipv6.google.com and www.kame.net
2001:200:dff:fff1:216:3eff:feb1:44d7 via fe80::216:1ff:fe14:444 dev eth0 proto static metric 1024
2001:470:8:e7c::/64 dev eth0 proto kernel metric 256 expires 86407sec
2607:f8b0:4002:801::1011 via fe80::216:1ff:fe14:444 dev eth0 proto static metric 1024
fe80::/64 dev eth0 proto kernel metric 256
default via fe80::216:1ff:fe14:444 dev eth0 proto kernel metric 1024
在路由器上:
ip -6 route
::/96 via :: dev tun6to4 metric 256 mtu 1280 advmss 1220
2001:470:7:e7c::/64 via :: dev he-ipv6 metric 256 mtu 1480 advmss 1420
2001:470:8:e7c::/64 dev br0 metric 256 mtu 1500 advmss 1440
2002:62b4:2270:1::/64 dev br0 metric 256 mtu 1500 advmss 1440
2002::/16 dev tun6to4 metric 256 mtu 1280 advmss 1220
2000::/3 dev he-ipv6 metric 1024 mtu 1480 advmss 1420
fe80::/64 dev eth0 metric 256 mtu 1500 advmss 1440
fe80::/64 dev vlan0 metric 256 mtu 1500 advmss 1440
fe80::/64 dev eth1 metric 256 mtu 1500 advmss 1440
fe80::/64 dev br0 metric 256 mtu 1500 advmss 1440
fe80::/64 dev vlan1 metric 256 mtu 1500 advmss 1440
fe80::/64 via :: dev he-ipv6 metric 256 mtu 1480 advmss 1420
fe80::/64 dev tun6to4 metric 256 mtu 1280 advmss 1220
ff00::/8 dev eth0 metric 256 mtu 1500 advmss 1440
ff00::/8 dev vlan0 metric 256 mtu 1500 advmss 1440
ff00::/8 dev eth1 metric 256 mtu 1500 advmss 1440
ff00::/8 dev br0 metric 256 mtu 1500 advmss 1440
ff00::/8 dev vlan1 metric 256 mtu 1500 advmss 1440
ff00::/8 dev he-ipv6 metric 256 mtu 1480 advmss 1420
ff00::/8 dev tun6to4 metric 256 mtu 1280 advmss 1220
default dev he-ipv6 metric 1024 mtu 1480 advmss 1420
ip -6 a
1: lo: <LOOPBACK,MULTICAST,UP>
inet6 ::1/128 scope host
3: eth0: <BROADCAST,MULTICAST,PROMISC,UP>
inet6 fe80::216:1ff:fe14:444/64 scope link
4: eth1: <BROADCAST,MULTICAST,PROMISC,UP>
inet6 fe80::216:1ff:fe14:446/64 scope link
5: vlan0: <BROADCAST,MULTICAST,PROMISC,UP>
inet6 fe80::216:1ff:fe14:444/64 scope link
6: vlan1: <BROADCAST,MULTICAST,UP>
inet6 fe80::216:1ff:fe14:445/64 scope link
8: br0: <BROADCAST,MULTICAST,PROMISC,UP>
inet6 fe80::216:1ff:fe14:444/64 scope link
inet6 2002:62b4:2270:1::1/64 scope global
inet6 2001:470:8:e7c::1/64 scope global
12: he-ipv6: <POINTOPOINT,NOARP,UP>
inet6 2001:470:7:e7c::2/64 scope global
inet6 fe80::62b4:2270/128 scope link
13: tun6to4: <NOARP,UP>
inet6 2002:62b4:2270::1/16 scope global
inet6 ::98.180.34.112/128 scope global
radvd.conf:
interface br0 {
AdvSendAdvert on;
prefix 2001:470:8:e7c::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};
答案1
我怀疑这里发生的情况是路由器没有该2001:888:0:18::
范围内的地址,因此路由器使用其链路本地地址()广播其路由通告fe80::444
。
由于fe80::
范围与特定接口无关,客户端机器需要跟踪在发送数据包时使用哪个接口fe80::444
,因此它在其路由表中添加一个条目。
如果您的路由器在同一个网络上选择一个地址,比如说2001:888:0:18::1
,我怀疑这种行为可能会改变。