vps交流

踩坑启用ipv6转发之后就失联了


echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding=1" >> /etc/sysctl.conf
sysctl -p

原来是启用ipv6转发之后ipv6出口路由消失了
把ipv6路由添加回来即可
ip -6 route add default via <ipv6 gateway address> dev <interface>

PS.
查看IPV6路由
route -6

看::指向那个地址 那个优先级高的就是

参考
https://askubuntu.com/questions/463625/ipv6-forwarding-kills-ipv6-connection