linux – IPv6仅在ping到路由盒后才能工作

前端之家收集整理的这篇文章主要介绍了linux – IPv6仅在ping到路由盒后才能工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
情况:

我们的网络中只有一个ipv4路由器,每台计算机都连接到它(wifi或有线电视).
具有ipv4和ipv6的服务器也连接到此路由器.服务器已配置隧道经纪人,用于6to4隧道和radvd.网络中的客户端具有正确的前缀,可以通过ipv6互相ping通.但是在他们第一次ping服务器(带有隧道的服务器)之前,他们无法ping到互联网.
我找到了某个地方,这是一个icmp问题,但我找不到解决方案.

问题是路由器只是ipv4吗?

>服务器和客户端运行linux
>路由器运行dd-wrt没有ipv6支持:(

Ping尝试:

standa@standa-laptop:~$ping6 ipv6.google.com
PING ipv6.google.com(2a00:1450:8007::69) 56 data bytes
^C
--- ipv6.google.com ping statistics ---
29 packets transmitted,0 received,100% packet loss,time 28223ms

standa@standa-laptop:~$ping6 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478
PING 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478(2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478) 56 data bytes
64 bytes from 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478: icmp_seq=1 ttl=64 time=3.55 ms
64 bytes from 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478: icmp_seq=2 ttl=64 time=0.311 ms
64 bytes from 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478: icmp_seq=3 ttl=64 time=0.269 ms
64 bytes from 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478: icmp_seq=4 ttl=64 time=0.292 ms
^C
--- 2001:470:XXXX:XXXX:21c:c0ff:fe2b:6478 ping statistics ---
4 packets transmitted,4 received,0% packet loss,time 3000ms
rtt min/avg/max/mdev = 0.269/1.107/3.559/1.415 ms
standa@standa-laptop:~$ping6 ipv6.google.com
PING ipv6.google.com(2a00:1450:8007::69) 56 data bytes
64 bytes from 2a00:1450:8007::69: icmp_seq=1 ttl=57 time=20.7 ms
64 bytes from 2a00:1450:8007::69: icmp_seq=2 ttl=57 time=20.2 ms
64 bytes from 2a00:1450:8007::69: icmp_seq=3 ttl=57 time=23.4 ms
^C
--- ipv6.google.com ping statistics ---
3 packets transmitted,3 received,time 2001ms
rtt min/avg/max/mdev = 20.267/21.479/23.413/1.392 ms

更新:Radvd配置

interface eth0 {
    AdvSendAdvert on;
    MinRtrAdvInterval 3; 
    MaxRtrAdvInterval 10;
    AdvLinkMTU   1280;
    prefix 2001:470:1f0a:1511:1::/64 {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
    };
};

更新2:
没有联系

ip -6 neigh
fe80::21c:c0ff:fe2b:6478 dev wlan1 lladdr 00:1c:c0:2b:64:78 router REACHABLE

连接(ping后)

fe80::21c:c0ff:fe2b:6478 dev wlan1 lladdr 00:1c:c0:2b:64:78 router STALE
2001:470:1f0a:1511::1 dev wlan1 lladdr 00:1c:c0:2b:64:78 router REACHABLE

ping时发生邻居请求:

fe80::21c:c0ff:fe2b:6478 2001:470:1f0a:1511:21c:bfff:fe60:b389 ICMPv6 Neighbor solicitation
2001:470:1f0a:1511:21c:bfff:fe60:b389 fe80::21c:c0ff:fe2b:6478 ICMPv6 Neighbor advertisement

解决方法

是否手动分配了客户端的前缀?通常他们应该通过邻居发现协议自动找到路由器(在此期间路由器发出广告并自动为它们分配前缀),但听起来这个步骤可能会丢失.

另外,路由器通告应该包括其链路层地址作为路由器通告的ICMP报头中的选项.如果缺少此字段,客户端将不知道如何将数据发送到路由器.听起来可能就是这种情况.客户端不知道如何到达路由器,直到它发出邻居发现消息并且它从路由器接收到邻居通告(在ICMP消息集中具有路由器标志).

要在路由器公告中包含源链接层地址,请将以下内容添加到您的radvd.conf中

AdvSourceLLAddress on;
原文链接:https://www.f2er.com/linux/400093.html

猜你在找的Linux相关文章