我这宽带分配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