1. 编辑 /etc/config/network 文件
(1) 在 config interface 'wan6'
下添加 option reqaddress 'force'
(2) 在 config interface 'lan'
下添加 option ip6assign '64'
(3) 添加 config globals 'globals'
并在下面添加 option ula_prefix 'fdcf:b746:88a0:0::/64'
2. 编辑 /etc/config/dhcp 文件
(1) 删除 config dnsmasq
下的 option filter_aaaa '1'
(2) 在 config dhcp 'lan'
下添加以下配置:
option ra 'server'
option dhcpv6 'server'
option ra_management '1'
option ra_default '1'
list dns '2001:4860:4860::8888'
list dns '2001:4860:4860::8844'
3. 编辑 /etc/config/firewall 文件
(1) 在名为 'wan'
的 config zone
下添加以下配置:
option output 'ACCEPT'
option input 'ACCEPT'
option forward 'ACCEPT'
option masq '1'
option mtu_fix '1'
config include
option path '/etc/firewall.user'
4. 编辑 /etc/firewall.user 文件
在文件末尾添加 ip6tables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
这句命令中的 eth1 是wan网口对应的网卡名称,可以通过ifconfig命令查看。
5. 编辑 /etc/rc.local 文件
(1) 命令行执行命令 ip -6 route | grep default
查看网关以及网卡
例:执行代码后返回
default from 2001:da8:1234:5678::910 via fe80::5616:51ff:fe56:8fb9 dev eth1 proto static metric 512 pref medium
那么网关就是 fe80::5616:51ff:fe56:8fb9
网卡就是 eth1
(2) 构造命令 route -A inet6 add default gw [网关] dev [网卡]
例:route -A inet6 add default gw fe80::5616:51ff:fe56:8fb9 dev eth1
(3) 将构造的命令添加到 /etc/rc.local 文件末尾 exit 0 这一行
的 上方。
6. 重新启动系统
有空再写
因篇幅问题不能全部显示,请点此查看更多更全内容