老哥们,路由已有 pb 前缀,设备 ipv6 依然无法上网

2021-11-29 18:20:21 +08:00
 sorasyl
设备已经分配到了公网的 ipv6 地址,依然无法访问纯 ipv6 网站
ip6tables 添加以下
ip6tables -t nat -A POSTROUTING -o pppoe-wan -j MASQUERADE
就可以通过路由器的 ipv6 地址上网

请教下各位老哥,如何通过设备的 ipv6 访问公网?
3815 次点击
所在节点    宽带症候群
25 条回复
sorasyl
2021-12-04 21:11:04 +08:00
@acbot network 设置如下
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option delegate '0'

config device
option name 'br-wan'
option type 'bridge'
list ports 'eth1'
list ports 'eth0'

config interface 'wan'
option device 'br-wan'
option proto 'pppoe'
option username 'CD65772695'
option password '65772695'
option ipv6 '1'

config interface 'wan6'
option proto 'dhcpv6'
option device '@wan'
option reqaddress 'try'
option reqprefix 'no'

dhcp 设置如下
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ra 'relay'
option dhcpv6 'relay'
option ndp 'relay'
list ra_flags 'none'
option ndproxy_routing '0'

config dhcp 'wan'
option interface 'wan'
option ignore '1'
list ra_flags 'none'

config dhcp 'wan6'
option interface 'wan6'
option ignore '1'
option master '1'
option ra 'relay'
option dhcpv6 'relay'
option ndp 'relay'
list ra_flags 'none'
option ndproxy_routing '0'
sorasyl
2021-12-04 21:17:03 +08:00
@sorasyl 设备已经能正确获取到公网 ip ,但依旧找不到路由
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 3c:06:30:4b:73:6f
inet6 fe80::463:37b7:e560:f9c4%en0 prefixlen 64 secured scopeid 0xb
inet 192.168.1.227 netmask 0xffffff00 broadcast 192.168.1.255
inet6 240e:398:332:129:df:95f1:506a:c13b prefixlen 64 autoconf secured
inet6 240e:398:332:129:19ba:8549:eb48:faaa prefixlen 64 autoconf temporary
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active

但设备无法找到正确路由
traceroute6 -s 240e:398:332:129:19ba:8549:eb48:faaa bbs6.ustc.edu.cn
traceroute6 to bbs6.ustc.edu.cn (2001:da8:d800::3) from 240e:398:332:129:19ba:8549:eb48:faaa, 64 hops max, 12 byte packets
1 * * *
2 * * *
3 *
sorasyl
2021-12-04 21:18:27 +08:00
路由器 v6 路由表
route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
::/0 fe80::ce1a:faff:feea:e1a0 UG 512 5 0 pppoe-wan
240e:398:332:129:11dc:91a6:7884:44a8/128 :: U 1024 4 0 pppoe-wan
240e:398:332:129:1511:ff98:66a9:2b16/128 :: U 1024 1 0 pppoe-wan
240e:398:332:129:300d:2bfd:ffab:91e8/128 :: U 1024 2 0 pppoe-wan
240e:398:332:129:36c9:3dff:fe0f:361/128 :: U 1024 3 0 pppoe-wan
240e:398:332:129:45f2:786d:9abc:b052/128 :: U 1024 2 0 pppoe-wan
240e:398:332:129:705b:d6f0:90d5:8530/128 :: U 1024 1 0 pppoe-wan
240e:398:332:129:95a9:1ffa:f7b6:7d4e/128 :: U 1024 3 0 pppoe-wan
240e:398:332:129:a0eb:4c21:5428:f5ec/128 :: U 1024 3 0 pppoe-wan
240e:398:332:129:c82c:8b6c:196c:9914/128 :: U 1024 3 0 pppoe-wan
240e:398:332:129::/64 :: UA 256 2 0 pppoe-wan
240e:398:332:129::/64 :: !n 2147483647 1 0 lo
fe80::1e40:e8d7:7612:327d/128 :: U 256 1 0 pppoe-wan
fe80::ce1a:faff:feea:e1a0/128 :: U 1 1 0 pppoe-wan
fe80::/64 :: U 256 2 0 br-wan
fe80::/64 :: U 256 2 0 br-lan
fe80::/64 :: U 256 1 0 wlan0
fe80::/64 :: U 256 1 0 wlan1
::/0 fe80::1 UGDA 1024 5 0 br-wan
::/0 fe80::ce1a:faff:feea:e1a0 UGDA 1024 2 0 pppoe-wan
::1/128 :: Un 0 7 0 lo
240e:398:332:129::/128 :: Un 0 3 0 pppoe-wan
240e:398:332:129:1e40:e8d7:7612:327d/128 :: Un 0 5 0 pppoe-wan
fe80::/128 :: Un 0 5 0 br-wan
fe80::/128 :: Un 0 3 0 br-lan
fe80::/128 :: Un 0 3 0 wlan0
fe80::/128 :: Un 0 3 0 wlan1
fe80::1e40:e8d7:7612:327d/128 :: Un 0 4 0 pppoe-wan
fe80::1e40:e8ff:fe12:327c/128 :: Un 0 3 0 br-lan
fe80::1e40:e8ff:fe12:327d/128 :: Un 0 5 0 br-wan
fe80::1e40:e8ff:fe12:327e/128 :: Un 0 3 0 wlan0
fe80::1e40:e8ff:fe12:327f/128 :: Un 0 2 0 wlan1
ff00::/8 :: U 256 2 0 br-wan
ff00::/8 :: U 256 5 0 pppoe-wan
ff00::/8 :: U 256 5 0 br-lan
ff00::/8 :: U 256 1 0 wlan0
ff00::/8 :: U 256 1 0 wlan1
::/0 :: !n -1 2 0 lo

路由器系统设置
net.ipv6.conf.default.forwarding=2
net.ipv6.conf.all.forwarding=2
net.ipv6.conf.default.accept_ra=2
net.ipv6.conf.all.accept_ra=2
sorasyl
2021-12-04 21:20:46 +08:00
设备路由表
Internet6:
Destination Gateway Flags Netif Expire
default fe80::1e40:e8ff:fe12:327c%en0 UGcg en0
default fe80::%utun0 UGcIg utun0
default fe80::%utun1 UGcIg utun1
::1 ::1 UHL lo0
240e:398:332:129::/64 link#11 UC en0
240e:398:332:129:df:95f1:506a:c13b 3c:6:30:4b:73:6f UHL lo0
240e:398:332:129:19ba:8549:eb48:faaa 3c:6:30:4b:73:6f UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%anpi1/64 link#4 UCI anpi1
fe80::1c80:20ff:fe1e:8a5a%anpi1 1e:80:20:1e:8a:5a UHLI lo0
fe80::%anpi0/64 link#5 UCI anpi0
fe80::1c80:20ff:fe1e:8a59%anpi0 1e:80:20:1e:8a:59 UHLI lo0
fe80::%en0/64 link#11 UCI en0
fe80::463:37b7:e560:f9c4%en0 3c:6:30:4b:73:6f UHLI lo0
fe80::1e40:e8ff:fe12:327c%en0 1c:40:e8:12:32:7c UHLWIir en0
fe80::%awdl0/64 link#14 UCI awdl0
fe80::28c4:46ff:fe35:17c4%awdl0 2a:c4:46:35:17:c4 UHLI lo0
fe80::%llw0/64 link#15 UCI llw0
fe80::28c4:46ff:fe35:17c4%llw0 2a:c4:46:35:17:c4 UHLI lo0
fe80::%utun0/64 fe80::7481:c99a:72ad:3621%utun0 UcI utun0
fe80::7481:c99a:72ad:3621%utun0 link#16 UHLI lo0
fe80::%utun1/64 fe80::57b5:fcce:7615:3dd5%utun1 UcI utun1
fe80::57b5:fcce:7615:3dd5%utun1 link#17 UHLI lo0
ff00::/8 ::1 UmCI lo0
ff00::/8 link#4 UmCI anpi1
ff00::/8 link#5 UmCI anpi0
ff00::/8 link#11 UmCI en0
ff00::/8 link#14 UmCI awdl0
ff00::/8 link#15 UmCI llw0
ff00::/8 fe80::7481:c99a:72ad:3621%utun0 UmCI utun0
ff00::/8 fe80::57b5:fcce:7615:3dd5%utun1 UmCI utun1
ff01::%lo0/32 ::1 UmCI lo0
ff01::%anpi1/32 link#4 UmCI anpi1
ff01::%anpi0/32 link#5 UmCI anpi0
ff01::%en0/32 link#11 UmCI en0
ff01::%awdl0/32 link#14 UmCI awdl0
ff01::%llw0/32 link#15 UmCI llw0
ff01::%utun0/32 fe80::7481:c99a:72ad:3621%utun0 UmCI utun0
ff01::%utun1/32 fe80::57b5:fcce:7615:3dd5%utun1 UmCI utun1
ff02::%lo0/32 ::1 UmCI lo0
ff02::%anpi1/32 link#4 UmCI anpi1
ff02::%anpi0/32 link#5 UmCI anpi0
ff02::%en0/32 link#11 UmCI en0
ff02::%awdl0/32 link#14 UmCI awdl0
ff02::%llw0/32 link#15 UmCI llw0
ff02::%utun0/32 fe80::7481:c99a:72ad:3621%utun0 UmCI utun0
ff02::%utun1/32 fe80::57b5:fcce:7615:3dd5%utun1 UmCI utun1
acbot
2021-12-06 08:56:14 +08:00
你在路由器上用 traceroute6 -s [路由器 br-lan ipv6 公网地址] bbs6.ustc.edu.cn ,你这个情况应该是路由没有通告到下面的设备,正常情况你在设备上添加一条 v6 默认路由指向路由器 LAN 或者 WAN 口就可以通,我个人感觉你之前你修改过默认防火墙,你看一下防火墙上应该有 dhcpv6 icmpv6 ipcmv6-forward 等等允许通过的规则。个人建议你重置一下所有设置然后仅仅只修改

config dhcp 'lan'
option interface 'lan'

....

option ndp 'relay'
option dhcpv6 'relay'
option ra 'relay'

另外一般情况 pppoe 成功之后是生成一个 WAN_6 的虚拟接口 你这里这个 WAN6 接口应该是系统自带的 我建议可以删除并且暂时不要配置 option master '1'

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/818830

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX