【发布时间】:2011-10-11 12:10:49
【问题描述】:
尝试了所有可能的方法后无法找到解决此问题的方法。我有一台机器有两个接口 eth0 和 eth2。我希望所有 ff38:40:2001:dead:beef:cafe::/96 数据包都在 eth2 上。我尝试了以下所有方法,但是当我执行 ping6 ff38:40:2001:dead:beef:cafe::1 时,数据包总是在 eth0 上。我尝试过但没有奏效的事情(即,数据包仍然在 eth0 上发出)。
$> route add --inet6 ff38:40:2001:dead:beef:cafe::/96 gw 2003::100 dev eth2
$> route add --inet6 ff38:40:2001:dead:beef:cafe::/96 dev eth2
$> route add --inet6 ff38:40:2001:dead:beef:cafe::/96 metric 1 gw 2003::100 dev eth2
我的路由表是
[root@dev ~]# route --inet6 |grep eth0
fe80::/64 * U 256 0 0 eth0
ff00::/8 * U 256 0 0 eth0
[root@dev ~]# route --inet6 |grep eth2
2003::/64 * U 256 68 0 eth2
fe80::/64 * U 256 0 0 eth2
ff38:40:2001:dead:beef:cafe::/96 2003::100 UG 1 0 0 eth2
*/0 fe80::c671:feff:fe14:e482 UGDA 1024 0 0 eth2
ff00::/8 * U 256 0 0 eth2
但是,ping6 ff38:40:2001:dead:beef:cafe::1 -I eth2 工作得很好。此外,我只在 Linux 机器上看到这个问题(MAC 很好)。
[root@dev ~]# ping6 ff38:40:2001:dead:beef:cafe::1 -I eth2
PING ff38:40:2001:dead:beef:cafe::1(ff38:40:2001:dead:beef:cafe:0:1) from cal eth2: 56 data bytes
64 bytes from 2012::1: icmp_seq=0 ttl=253 time=19.1 ms
64 bytes from 2012::1: icmp_seq=1 ttl=253 time=2.16 ms
64 bytes from 2012::1: icmp_seq=2 ttl=253 time=2.14 ms
64 bytes from 2012::1: icmp_seq=3 ttl=253 time=2.26 ms
64 bytes from 2012::1: icmp_seq=4 ttl=253 time=2.08 ms
64 bytes from 2012::1: icmp_seq=5 ttl=253 time=2.15 ms
root@dev ~]# uname -a
Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
也许问题与 eth0 有一个 ff00::/8 的事实有关。我如何否决那条路线。我也无法删除 ff00::/8 路由。
【问题讨论】:
-
如果应用程序足够先进,可以使用 IPv6,为什么不能先进到选择传出接口。
-
@Steve-o:因为至少在传统上,这就是路由表的用途。 IPv6 的范围地址概念有所改变,但路由表肯定应该处理站点范围或更大范围的地址路由吗?
标签: linux routing ipv6 multicast