IPv6 链路本地路由

IPv6 链路本地路由

链路本地地址

路由器不转发具有链路本地地址的数据包。

我想知道的是:如果目的地是链路本地地址,但如果我的盒子只有链路本地地址,并试图到达全局/站点范围地址,该怎么办?流量可以返回吗?或者会失败,因为返回的数据包将到达链路本地地址?

答案1

路由器永远不会转发具有源单播链路本地 IPv6 地址的数据包。

请看一下这个例子:Linux 机器仅有的尝试 ping 的本地链路地址ipv6.google.com(google的全局范围ipv6地址):

root@u1010:~# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:0c:29:2d:ff:26
          inet addr:172.16.1.130  Bcast:172.16.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe2d:ff26/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:408884 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43885 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:151390854 (151.3 MB)  TX bytes:6098973 (6.0 MB)
          Interrupt:19 Base address:0x2000

root@u1010:~# ping6 ipv6.google.com
PING ipv6.google.com(pw-in-x68.1e100.net) 56 data bytes
From fe80::223:33ff:fe71:6827 icmp_seq=1 Destination unreachable: Beyond scope of source address
From fe80::223:33ff:fe71:6827 icmp_seq=2 Destination unreachable: Beyond scope of source address
From fe80::223:33ff:fe71:6827 icmp_seq=3 Destination unreachable: Beyond scope of source address
From fe80::223:33ff:fe71:6827 icmp_seq=4 Destination unreachable: Beyond scope of source address

在路由器上调试 ipv6 数据包显示以下内容...

Mar  5 14:14:17.240: IPv6: Looking up 2001:XXXX:20::2 [Source FE80::20C:29FF:FE2D:FF26] in FIB
Mar  5 14:14:17.240: IPv6: FIB lookup for 2001:XXXX:20::2 succeeded. if=Tunnel0, nexthop 2001:XXXX:20::2
Mar  5 14:14:17.240: IPV6: source FE80::20C:29FF:FE2D:FF26 (Vlan200)
Mar  5 14:14:17.240:       dest 2001:XXXX:20::2 (Tunnel0)
Mar  5 14:14:17.240:       traffic class 0, flow 0x0, len 81+14, prot 17, hops 63, forwarding
Mar  5 14:14:17.240: IPv6-Fwd: Beyond scope of source address

相关内容