IPv6路由问题

6 routing ipv6

我正在我的家庭网络上设置ipv6,并且遇到了一个奇怪的问题。

我的“路由器”(一个 Debian Linux 机器)连接到 HE.net 6in4,可以 ping 和访问 ipv6 站点(ipv6.google.com)。

我已经在路由器上安装了 radvd(配置如下),其他计算机(我的 Mac Book Pro 和另一个 Debian 机器)接收具有正确前缀的地址,并将默认路由报告到我的路由器的链接地址。

问题是,其他计算机无法通过 ipv6 访问互联网,除非它们专门 ping 路由器的非链接地址。我在使用 traceroute6 进行故障排除时偶然发现了这一点。

配置文件


andrew@route:~$ cat /etc/radvd.conf
interface eth0
{
    AdvSendAdvert on;
    MinRtrAdvInterval 30;
    MaxRtrAdvInterval 100;
    AdvHomeAgentFlag off;
    AdvSourceLLAddress on;
    AdvCurHopLimit 255;
    prefix 2001:470:XXXX:XXXX::/64 
    {
        AdvOnLink on;
        AdvAutonomous on;
    };

};
Run Code Online (Sandbox Code Playgroud)

路由器上的ifconfig


andrew@route:~$ /sbin/ifconfig
6in4      Link encap:IPv6-in-IPv4  
          inet6 addr: 2001:470:XXXX:XXXX::2/64 Scope:Global
          inet6 addr: fe80::411f:489c/128 Scope:Link
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:19128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19421 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1871880 (1.7 MiB)  TX bytes:1919865 (1.8 MiB)

eth0      Link encap:Ethernet  HWaddr 00:1d:60:3a:1e:45  
          inet addr:192.168.1.12  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2001:470:XXXX:XXXX::2/64 Scope:Global
          inet6 addr: fe80::21d:60ff:fe3a:1e45/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:495833790 errors:0 dropped:0 overruns:0 frame:0
          TX packets:515479141 errors:0 dropped:0 overruns:0 carrier:2
          collisions:0 txqueuelen:1000 
          RX bytes:279615773745 (260.4 GiB)  TX bytes:324665798547 (302.3 GiB)

eth1      Link encap:Ethernet  HWaddr 00:02:b3:d7:98:71  
          inet addr:65.31.XXX.XXX  Bcast:255.255.255.255  Mask:255.255.255.192
          inet6 addr: fe80::202:b3ff:fed7:9871/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:545171946 errors:0 dropped:0 overruns:0 frame:0
          TX packets:335869422 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:676743254883 (630.2 GiB)  TX bytes:75919367259 (70.7 GiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10087609 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10087609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:60879852161 (56.6 GiB)  TX bytes:60879852161 (56.6 GiB)
Run Code Online (Sandbox Code Playgroud)

路由器上的 ip -6 路由


andrew@route:~$ ip -6 route
2001:470:XXXX:XXXX::1 dev 6in4  metric 1024  mtu 1480 advmss 1420 hoplimit 0
2001:470:XXXX:XXXX::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
2001:470:XXXX:XXXX::/64 via :: dev 6in4  proto kernel  metric 256  mtu 1480 advmss 1420 hoplimit 0
fe80::/64 dev tap0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth1  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 via :: dev 6in4  proto kernel  metric 256  mtu 1480 advmss 1420 hoplimit 0
default via 2001:470:XXXX:XXXX::1 dev 6in4  metric 1024  mtu 1480 advmss 1420 hoplimit 0
Run Code Online (Sandbox Code Playgroud)

其他电脑上的ifconfig

andrew@other:~$ /sbin/ifconfig
eth0 链接封装:以太网 HWaddr 00:1d:60:85:eb:93  
          inet 地址:192.168.1.20 广播:192.168.1.255 掩码:255.255.255.0
          inet6 地址:2001:470:XXXX:XXXX:21d:60ff:fe85:eb93/64 范围:全球
          inet6 地址:fe80::21d:60ff:fe85:eb93/64 范围:链接
          上行广播运行多播 MTU:1500 公制:1
          RX 数据包:13959115 错误:0 丢弃:0 溢出:0 帧:0
          TX 数据包:6027537 错误:0 丢弃:0 溢出:0 载波:2
          碰撞:0 txqueuelen:1000 
          RX 字节:16009877909 (14.9 GiB) TX 字节:1306977604 (1.2 GiB)

lo 链路封装:本地环回  
          inet 地址:127.0.0.1 掩码:255.0.0.0
          inet6 地址:::1/128 范围:主机
          上环回运行 MTU:16436 公制:1
          RX 数据包:118933 错误:0 丢弃:0 溢出:0 帧:0
          TX 数据包:118933 错误:0 丢弃:0 溢出:0 载波:0
          碰撞:0 txqueuelen:0 
          RX 字节:62855037 (59.9 MiB) TX 字节:62855037 (59.9 MiB)

ip -6 其他电脑上的路由


andrew@other:~$ ip -6 route
2001:470:XXXX:XXXX::/64 dev eth0  proto kernel  metric 256  expires 86382sec mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 4294967295
default via fe80::21d:60ff:fe3a:1e45 dev eth0  proto kernel  metric 1024  expires 277sec mtu 1500 advmss 1440 hoplimit 255
Run Code Online (Sandbox Code Playgroud)

而问题


andrew@other:~$ ping6 ipv6.google.com
PING ipv6.google.com(iad04s01-in-x93.1e100.net) 56 data bytes
^C
--- ipv6.google.com ping statistics ---
24 packets transmitted, 0 received, 100% packet loss, time 23145ms

andrew@other:~$ ping6 2001:470:XXXX:XXXX::2
PING 2001:470:XXXX:XXXX::2(2001:470:XXXX:XXXX::2) 56 data bytes
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=1 ttl=255 time=3.03 ms
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=2 ttl=255 time=0.242 ms
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=3 ttl=255 time=0.243 ms
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=4 ttl=255 time=0.247 ms
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=5 ttl=255 time=0.241 ms
64 bytes from 2001:470:XXXX:XXXX::2: icmp_seq=6 ttl=255 time=0.235 ms
^C
--- 2001:470:XXXX:XXXX::2 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5000ms
rtt min/avg/max/mdev = 0.235/0.707/3.039/1.043 ms

andrew@other:~$ ping6 ipv6.google.com
PING ipv6.google.com(iad04s01-in-x93.1e100.net) 56 data bytes
64 bytes from iad04s01-in-x93.1e100.net: icmp_seq=1 ttl=56 time=78.6 ms
64 bytes from iad04s01-in-x93.1e100.net: icmp_seq=2 ttl=56 time=79.1 ms
64 bytes from iad04s01-in-x93.1e100.net: icmp_seq=3 ttl=56 time=77.7 ms
64 bytes from iad04s01-in-x93.1e100.net: icmp_seq=4 ttl=56 time=82.3 ms
^C
--- ipv6.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 77.726/79.452/82.324/1.732 ms
Run Code Online (Sandbox Code Playgroud)

在我专门 ping 路由器全局 ip 之前和之后的唯一区别是之后,在“其他”计算机上,在 ip -6 neigh show 中,列出了路由器的全局 ip。当然,几分钟后它变得陈旧,另一台计算机无法再次ping Internet。

很抱歉这篇长帖子,但这个问题让我发疯。

小智 1

老实说,我不知道为什么或如何解决它......

我的新路由表


andrew@route:~$ ip -6 route
2001:470:XXXX:XXXX::1 dev 6in4  metric 1024  mtu 1480 advmss 1420 hoplimit 0
2001:470:XXXX:XXXX::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev tap0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth1  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
fe80::/64 via :: dev 6in4  proto kernel  metric 256  mtu 1480 advmss 1420 hoplimit 0
default via 2001:470:XXXX:XXXX::1 dev 6in4  metric 1024  mtu 1480 advmss 1420 hoplimit 0
Run Code Online (Sandbox Code Playgroud)

我最终删除的规则:


2001:470:XXXX:XXXX::/64 via :: dev 6in4  proto kernel  metric 256  mtu 1480 advmss 1420 hoplimit 0
Run Code Online (Sandbox Code Playgroud)

删除该规则(当然是随机的)后,“其他计算机”可以毫无问题地进行 ping 操作。

我通过从 /etc/network/interfaces 中的 6in4 接口中删除地址来防止我的路由器将来生成该规则。

不管怎样,感谢那些花时间阅读我的文章的人。