# ========= WAN 接口 (pppoe-wan) =========
uci set network.wan=interface
uci set network.wan.proto='pppoe'
uci set network.wan.username='你的宽带账号'
uci set network.wan.password='你的宽带密码'
uci set network.wan.ipv6='1' # 启用 IPv6
uci set network.wan.delegate='1' # 允许 IPv6 前缀委派(PD)
# ========= LAN 接口 (br-lan) =========
uci set network.lan=interface
uci set network.lan.ifname='br-lan'
uci set network.lan.proto='static'
uci set network.lan.ipaddr='192.168.1.1'
uci set network.lan.netmask='255.255.255.0'
uci set network.lan.ip6assign='64' # 从 PD (/60) 中分配一个 /64 给 LAN
uci set network.lan.ip6hint='0' # 可选:指定使用哪个子前缀(0-F)
# ========= DHCPv6 / RA 设置 =========
uci set dhcp.lan=dhcp
uci set dhcp.lan.interface='lan'
uci set dhcp.lan.ra='server' # 启用 RA 广播(SLAAC)
uci set dhcp.lan.dhcpv6='server' # 启用 DHCPv6(可分配 DNS)
uci set dhcp.lan.ra_management='0' # 0=客户端可用 SLAAC,自带 DNS
uci set dhcp.lan.ignore='0' # 确保未禁用 DHCP
# ========= 防火墙 IPv6 启用 =========
uci set firewall.@zone[0].network='lan'
uci set firewall.@zone[0].input='ACCEPT'
uci set firewall.@zone[0].output='ACCEPT'
uci set firewall.@zone[0].forward='ACCEPT'
uci set firewall.@zone[0].masq6='1' # 允许 IPv6 NAT(一般 PD 不需要,但有助测试)
uci set firewall.@zone[1].network='wan'
uci set firewall.@zone[1].masq='1'
uci set firewall.@zone[1].masq6='1'
uci set firewall.@zone[1].input='REJECT'
uci set firewall.@zone[1].forward='REJECT'
uci set firewall.@zone[1].output='ACCEPT'
# ========= 应用配置 =========
uci commit network
uci commit dhcp
uci commit firewall
/etc/init.d/network restart
/etc/init.d/odhcpd restart
/etc/init.d/firewall restart
No Comments