潘多拉固件设置ipv6_k2p路由器PandoraBox潘多拉与openwrt固件配置ipv6地址方法

本文介绍了如何在潘多拉固件(PandoraBox)和openwrt中设置IPv6,特别是使用dhcpv6-pd方式获取公网前缀。内容涵盖了wan6接口的配置、RA和DHCPv6的模式选择,以及lan接口的dhcpv6服务器设定,并提供了iptables的基本规则以确保网络安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我这宽带分配ipv6使用dhcpv6-pd方式,潘多拉默认配置ipv6就能正常使用,由于使用虚拟机和未使用自带的firewall走了一些坑,顺便将openwrt的ipv6分配了解了下。

wan6接口的dhcpv6客户端获取ipv6公网前缀:

路由获取IPV6前缀后向局域网内机器分发址使用RA路由通告(无状态)和dhcpv6方式,RA可分配IP地址、网关,不包含DNS,dhcpv6可分配IP地址、DNS,不包含网关。

RA和DHCPV6模式有:服务器模式、中继模式、混合模式,前缀分配使用服务器模式,如果运营商不支持dhcpv6-pd可使用中继方式,中继模式要将wan6的dhcp客户端设置成master,lan的dhcp相当于slave。

混合模式会根据配置自动选择使用中继还是服务器模式。

If the interface was master, then hybrid means relay or disabled. If there was no slave relay in the other interfaces, then it will be configured to disabled.

If the interface was not master, then hybrid means relay or server. If there was no master, then the interface will be configured to server.

默认lan接口的dhcpv6服务器配置:

配置iptables:ip6tables -F

ip6tables -X

ip6tables -Z

ip6tables -P INPUT DROP

ip6tables -P OUTPUT ACCEPT

ip6tables -P FORWARD DROP

ip6tables -A INPUT -i lo -j ACCEPT

ip6tables -A INPUT -i br-lan -j ACCEPT

ip6tables -A INPUT -p icmpv6 -j ACCEPT

ip6tables -A INPUT -m conntrack --ctstate NEW -m udp -p udp --sport 547 --dport 546 -s fe80::/64 -d fe80::/64 -j ACCEPT

#ip6tables -A INPUT -s fe80::/10 -d fe80::/10 -p udp -m udp --sport 547 --dport 546 -j ACCEPT

#ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT

ip6tables -A INPUT -i pppoe-wan -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

ip6tables -A FORWARD -i br-lan -o pppoe-wan -j ACCEPT

ip6tables -A FORWARD -i br-lan -o br-lan -j ACCEPT

ip6tables -A FORWARD -i pppoe-wan -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

ip6tables -t mangle -F

ip6tables -t mangle -X

ip6tables -t mangle -Z

ip6tables -t mangle -A POSTROUTING -o pppoe-wan -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值