wlan1接口忽略IPv6 SLAAC(ICMPv6路由器广告)

我在Thinkpad W520上安装了15.04。 但是,我无法让IPv6在wlan1接口上运行:

ifconfig wlan1 wlan1 Link encap:Ethernet HWaddr 8c:70:5a:d2:65:bc inet addr:10.0.1.61 Bcast:10.0.1.255 Mask:255.255.255.0 inet6 addr: fe80::8e70:5aff:fed2:65bc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1534790 errors:0 dropped:0 overruns:0 frame:0 TX packets:1281764 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:618961336 (618.9 MB) TX bytes:249411071 (249.4 MB) 

在Wireshark中,我能够看到ICMPv6 RA消息:

 No. Time Source Destination Protocol Length Info 3 775.989536000 fe80::bac7:5dff:fec8:50e ff02::1 ICMPv6 150 Router Advertisement from b8:c7:5d:c8:05:0e Frame 3: 150 bytes on wire (1200 bits), 150 bytes captured (1200 bits) on interface 0 Ethernet II, Src: Apple_c8:05:0e (b8:c7:5d:c8:05:0e), Dst: IPv6mcast_01 (33:33:00:00:00:01) Internet Protocol Version 6, Src: fe80::bac7:5dff:fec8:50e (fe80::bac7:5dff:fec8:50e), Dst: ff02::1 (ff02::1) Internet Control Message Protocol v6 Type: Router Advertisement (134) Code: 0 Checksum: 0x215a [correct] Cur hop limit: 64 Flags: 0x48 Router lifetime (s): 1800 Reachable time (ms): 0 Retrans timer (ms): 0 ICMPv6 Option (Source link-layer address : b8:c7:5d:c8:05:0e) ICMPv6 Option (Prefix information : 2601:xxxx:xxxx:47fc::/64) ICMPv6 Option (Route Information : Medium 2601:xxxx:xxxx:47fc::/64) ICMPv6 Option (Recursive DNS Server 2601:xxxx:xxxx:47fc:bac7:5dff:fec8:50e) 

启用了Sysctl accept_ra:

 net.ipv6.conf.wlan1.accept_dad = 1 net.ipv6.conf.wlan1.accept_ra = 1 net.ipv6.conf.wlan1.accept_ra_defrtr = 0 net.ipv6.conf.wlan1.accept_ra_from_local = 0 net.ipv6.conf.wlan1.accept_ra_pinfo = 0 net.ipv6.conf.wlan1.accept_ra_rt_info_max_plen = 0 net.ipv6.conf.wlan1.accept_ra_rtr_pref = 0 net.ipv6.conf.wlan1.accept_redirects = 1 net.ipv6.conf.wlan1.accept_source_route = 0 net.ipv6.conf.wlan1.autoconf = 1 net.ipv6.conf.wlan1.dad_transmits = 1 net.ipv6.conf.wlan1.disable_ipv6 = 0 net.ipv6.conf.wlan1.force_mld_version = 0 net.ipv6.conf.wlan1.force_tllao = 0 net.ipv6.conf.wlan1.forwarding = 0 net.ipv6.conf.wlan1.hop_limit = 64 net.ipv6.conf.wlan1.max_addresses = 16 net.ipv6.conf.wlan1.max_desync_factor = 600 net.ipv6.conf.wlan1.mc_forwarding = 0 net.ipv6.conf.wlan1.mldv1_unsolicited_report_interval = 10000 net.ipv6.conf.wlan1.mldv2_unsolicited_report_interval = 1000 net.ipv6.conf.wlan1.mtu = 1500 net.ipv6.conf.wlan1.ndisc_notify = 0 net.ipv6.conf.wlan1.proxy_ndp = 0 net.ipv6.conf.wlan1.regen_max_retry = 3 net.ipv6.conf.wlan1.router_probe_interval = 60 net.ipv6.conf.wlan1.router_solicitation_delay = 1 net.ipv6.conf.wlan1.router_solicitation_interval = 4 net.ipv6.conf.wlan1.router_solicitations = 3 net.ipv6.conf.wlan1.suppress_frag_ndisc = 1 net.ipv6.conf.wlan1.temp_prefered_lft = 86400 net.ipv6.conf.wlan1.temp_valid_lft = 604800 net.ipv6.conf.wlan1.use_tempaddr = 2 net.ipv6.neigh.wlan1.anycast_delay = 100 net.ipv6.neigh.wlan1.app_solicit = 0 net.ipv6.neigh.wlan1.base_reachable_time_ms = 30000 net.ipv6.neigh.wlan1.delay_first_probe_time = 5 net.ipv6.neigh.wlan1.gc_stale_time = 60 net.ipv6.neigh.wlan1.locktime = 0 net.ipv6.neigh.wlan1.mcast_solicit = 3 net.ipv6.neigh.wlan1.proxy_delay = 80 net.ipv6.neigh.wlan1.proxy_qlen = 64 net.ipv6.neigh.wlan1.retrans_time_ms = 1000 net.ipv6.neigh.wlan1.ucast_solicit = 3 net.ipv6.neigh.wlan1.unres_qlen = 31 net.ipv6.neigh.wlan1.unres_qlen_bytes = 65536 

IPv6路由表:

 $ route -6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If fe80::/64 :: U 256 0 0 wlan1 ::/0 :: !n -1 1 11529 lo ::1/128 :: Un 0 7 32 lo fe80::8e70:5aff:fed2:65bc/128 :: Un 0 1 0 lo ff00::/8 :: U 256 1 0 wlan1 ::/0 :: !n -1 1 11529 lo 

IPv6邻居:

 $ ip -6 neigh fe80::bac7:5dff:fec8:50e dev wlan1 lladdr b8:c7:5d:c8:05:0e router STALE 

…我能够ping住我住宅网关的链接本地地址:

 $ ping6 -I wlan1 fe80::bac7:5dff:fec8:50e PING fe80::bac7:5dff:fec8:50e(fe80::bac7:5dff:fec8:50e) from fe80::8e70:5aff:fed2:65bc wlan1: 56 data bytes 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=2 ttl=64 time=277 ms 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=3 ttl=64 time=0.848 ms 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=4 ttl=64 time=13.4 ms 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=5 ttl=64 time=1.32 ms 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=6 ttl=64 time=0.934 ms 64 bytes from fe80::bac7:5dff:fec8:50e: icmp_seq=7 ttl=64 time=1.66 ms ^C 

关于它可能是什么以及如何解决这个问题的任何想法?

谢谢。

问题出在您的某些sysctl设置中:

 net.ipv6.conf.wlan1.accept_ra = 1 

这个很好:接受路由器广告

 net.ipv6.conf.wlan1.accept_ra_defrtr = 0 

但是这个告诉你的系统不要接受来自RA的默认路由。 RA确实将路由器通告为默认网关。 如果您希望系统了解这一点,则必须将其设置为1

 net.ipv6.conf.wlan1.accept_ra_pinfo = 0 

这个告诉您的系统不要接受来自RA的任何前缀信息。 它将无法了解链接上的前缀,因此无法自动配置其地址。

 net.ipv6.conf.wlan1.accept_ra_rt_info_max_plen = 0 

您的RA还包含2601:xxxx:xxxx:47fc::/64的更具体路由2601:xxxx:xxxx:47fc::/64 。 此设置告诉内核不要接受任何长于/0路由。 如果要接受/64则需要将此值设置为至少64

 net.ipv6.conf.wlan1.autoconf = 1 

这很好。 但是,您没有包含有关RA消息的所有详细信息。 这仅在RA中的前缀信息选项设置了Autoconf(A)标志时才有效,并且该标志在您的问题中不可见。