局域网能不能单个设备关闭 ipv6

2022-05-17 18:51:03 +08:00
 mikeluckybiy

由于局域网内的几台设备需要 ipv6 ,所以路由开启了 ipv6 但发现问题,所有设备访问 Google 都会先用 ipv6 地址去请求,没办法通过软路由的 ipv4 连接,导致 Google 打不开, 能不能单个设备关闭 ipv6 ?

PS:不是电脑,是手机和平板,WIFI 设置中没办法关闭

1301 次点击
所在节点    宽带症候群
13 条回复
kxy09
2022-05-17 22:12:01 +08:00
加个二级路由
LGA1150
2022-05-17 23:37:28 +08:00
关闭 SLAAC ,有需要的设备设置静态或者 DHCPv6
mikeluckybiy
2022-05-18 01:03:44 +08:00
@LGA1150 是使用有状态的还是使用无状态的?另外 ipv6 好像说没办法设置静态地址?
berry10086
2022-05-18 13:32:12 +08:00
加防火墙规则

ip6tables -I input_lan_rule -i br-lan -p ipv6-icmp -m mac --mac-source xx:xx... -j ACCEPT
ip6tables -I input_lan_rule -i br-lan -p udp --dport 547 -m mac --mac-source xx:xx.. -j ACCEPT


ip6tables -A input_lan_rule -i br-lan -p ipv6-icmp -j DROP
ip6tables -A input_lan_rule -i br-lan -p udp --dport 547 -j DROP

只允许特定设备获取 ipv6 地址
woshijidan
2022-05-25 03:04:01 +08:00
@berry10086 这个我参考 https://www.v2ex.com/t/664819 设定在 openwrt 防火墙的自定义规则之后,手机过一段时间还是能获取到 ipv6 地址 并且地址是 2408 公网 ip 不过 ipv6 访问倒是禁止了 导致时不时手机显示网络上不了网 wifi 打叉的情况 是否还需要什么设定
berry10086
2022-05-25 14:58:44 +08:00
@woshijidan LAN 口 ipv6 设置
路由通告 dhcpv6 服务都选服务器模式,dhcpv6 模式选有状态
接口 全局网络选项 IPv6 ULA 前缀 设成空

编辑 /etc/config/dhcp
找到 config dhcp 'lan'
加一行: option ra_slaac '0'
berry10086
2022-05-25 14:59:34 +08:00
@woshijidan dns 高级设置,禁止解析 ipv6
woshijidan
2022-05-25 19:51:27 +08:00
@berry10086 禁止解析 v6 ?但是我只需要单独一台设备需要 v6 (跑 pt )其余都不用唉,要是 openwrt 那禁止解析 v6 ,就真的用不了了吧 我目前 openwrt 设定是这样
woshijidan
2022-05-25 19:53:50 +08:00
woshijidan
2022-05-25 20:02:40 +08:00
woshijidan
2022-05-25 20:03:44 +08:00
berry10086
2022-05-26 09:42:20 +08:00
@woshijidan pt 机 dns 设成 114.114.114.114
berry10086
2022-05-26 09:42:35 +08:00
@woshijidan dhcpv6 只开有状态

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

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

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

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

© 2021 V2EX