下面的命令为全新的 OpenWrt 所做的设置,如果不是全新的 OpenWrt 并不能直接用。
- 如果代理软件使用 realip 模式
1.1. wan6 有 IPv6 和长度 64 的 PD
# /etc/config/dhcp
uci del dhcp.lan.dhcpv6
uci del dhcp.lan.ra_flags
uci add_list dhcp.lan.ra_flags='none'
uci set dhcp.lan.dns_service='0'
# /etc/config/network
uci set network.lan.ip6assign='64'
uci set network.lan.ip6ifaceid='eui64'
uci del network.globals.ula_prefix
# save & apply
uci commit dhcp
uci commit network
service network restart
1.2. wan6 有长度 64 的 IPv6 但无 PD 需要使用中继模式
# /etc/config/dhcp
uci set dhcp.wan6=dhcp
uci set dhcp.wan6.interface='wan6'
uci set dhcp.wan6.ignore='1'
uci set dhcp.wan6.master='1'
uci set dhcp.wan6.ra='relay'
uci set dhcp.wan6.ndp='relay'
uci del dhcp.lan.dhcpv6
uci del dhcp.lan.ra_flags
uci del dhcp.lan.dns_service
uci set dhcp.lan.ra='relay'
uci set dhcp.lan.ndp='relay'
# /etc/config/network
uci set network.lan.ip6assign='64'
uci set network.lan.ip6ifaceid='eui64'
uci del network.globals.ula_prefix
# save & apply
uci commit dhcp
uci commit network
service network restart
1.3. wan6 只有长度 128 的 IPv6 但无 PD 需要使用 NAT66 模式
# /etc/config/firewall
uci set firewall.cfg03dc81.masq6='1'
# /etc/config/dhcp
uci del dhcp.lan.dhcpv6
uci del dhcp.lan.ra_flags
uci add_list dhcp.lan.ra_flags='none'
uci set dhcp.lan.dns_service='0'
# /etc/config/network
uci set network.lan.ip6assign='64'
uci set network.lan.ip6ifaceid='eui64'
uci set network.globals.ula_prefix='fd71:576d:52df::/48'
# save & apply
uci commit firewall
uci commit dhcp
uci commit network
service network restart
- 如果代理软件使用 fakeip 模式
在使用 fakeip 模式的情况下,客户端获取的所有的域名解析都是 fakeip,所有的网络访问都需要通过路由器进行访问。
# /etc/config/dhcp
uci del dhcp.lan.ra
uci del dhcp.lan.ra_slaac
uci del dhcp.lan.ra_flags
uci del dhcp.lan.dhcpv6
# /etc/config/network
uci del network.lan.ip6assign
uci set network.globals.ula_prefix='fd71:576d:52df::/48'
# save & apply
uci commit dhcp
uci commit network
service network restart