我们build立了一个小型的IPv6testingnetworking。 设置看起来像这样:
::/0 +----------+ | Firewall | Router to the public net +----------+ | 2001:...::/106 | +----------+ +-------| SIT GW | sit Tunnel gatway to the some test users | +----------+ | +----------+ | Test Sys | Testsystem +----------+
这个想法是通告防火墙的默认路由以及来自坐席网关的SIT子网的路由。 radvd的configuration是:
# Firewall interface eth0 { AdvSendAdvert on; route ::/0 { }; }; # SIT Gatway interface eth0 { AdvSendAdvert on; route 2001:...::/106 { }; };
我们已经抓住了这个adv。 包与tcpdump和包看起来不错。 我们看到从fw的默认路由和从SIT gatway的子网路由。
但是如果我们看一下testing系统,两个网关都有两条默认路由。 没有子网路由。 当然路由不工作。 这里我们得到的路线:
2001:.....::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 default via fe80::baac:6fff:fe8e:XXXX dev eth0 proto kernel metric 1024 expires 0sec mtu 1500 advmss 1440 hoplimit 64 default via fe80::e415:aeff:fe12:XXXX dev eth0 proto kernel metric 1024 expires 0sec mtu 1500 advmss 1440 hoplimit 64
任何想法?
我发现了这个问题。
默认情况下,Linux内核只通过icmpv6中的路由器通告选项接受默认路由。
要解决这个问题,必须设置正确的内核参数:
net.ipv6.conf.all.accept_ra_rt_info_max_plen = 128
从内核文档:
accept_ra_rt_info_max_plen – INTEGER RA中路由信息的最大前缀长度。
Route Information w/ prefix larger than or equal to this variable shall be ignored. Functional default: 0 if accept_ra_rtr_pref is enabled. -1 if accept_ra_rtr_pref is disabled.