|
保姆级图文教程:
https://kejimm.com/87.html
关键步骤(以下都是在母鸡配置):
编辑文件:/etc/network/interfaces,添加:
auto vmbr1
iface vmbr1 inet static
address 10.1.1.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
iface vmbr1 inet6 static
address 2001:****:****:cf5a::2/64
post-up iptables -t nat -A POSTROUTING -s '10.1.1.1/24' -o vmbr0 -j MASQUERADE
pre-down iptables -t nat -D POSTROUTING -s '10.1.1.1/24' -o vmbr0 -j MASQUERADE
post-up /sbin/ip -f inet6 route add 2001:****:****:cfff:ff:ff:ff:ff dev vmbr0
pre-down /sbin/ip -f inet6 route del 2001:****:****:cfff:ff:ff:ff:ff dev vmbr0
post-up /sbin/ip -f inet6 route add default via 2001:****:****:cfff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del default via 2001:****:****:cfff:ff:ff:ff:ff
post-up /sbin/ip -f inet6 neigh add proxy 2001:****:****:cf5a::2 dev vmbr1
pre-down /sbin/ip -f inet6 neigh del proxy 2001:****:****:cf5a::2 dev vmbr1
post-up /sbin/ip -f inet6 neigh add proxy 2001:****:****:cf5a::100 dev vmbr0
pre-down /sbin/ip -f inet6 neigh del proxy 2001:****:****:cf5a::100 dev vmbr0
修改后运行/etc/init.d/networking restart重启网络。
更新:有的机器修改/etc/network/interfaces后重启网络失败,可以去掉下面两行再试试:
post-up /sbin/ip -f inet6 route add default via 2001:****:****:cfff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del default via 2001:****:****:cfff:ff:ff:ff:ff
文件/etc/sysctl.conf添加:
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.vmbr0.autoconf=0
net.ipv6.conf.vmbr0.accept_ra=2
小鸡IPV6网关:2001:****:****:cf5a::2 |
|