Provide IPv6 services for old Alibaba Cloud shared ECS through tunnels
This Alibaba Cloud already has relevant tutorials[ https://help.aliyun.com/document_detail/108465.html ][1]
IP tunnel add gre tunel mode gre remote Intranet IP ttl 1 of the old machine ip link set gre-tunnel up ip addr add fc00::1/64 dev gre-tunnel
IP tunnel add gre tunel mode gre remote Intranet IP of new machine ttl 1 ip link set gre-tunnel up ip addr add fc00::2/64 dev gre-tunnel
vi /etc/sysctl.conf net.ipv6.conf.all.forwarding=1 Exit vi sysctl -p service ip6tables start ip6tables -P INPUT ACCEPT ip6tables -P OUTPUT ACCEPT ip6tables -P FORWARD ACCEPT ip6tables -F ip6tables -t nat -F ip6tables -t nat -I POSTROUTING -s fc00::2/128 -j MASQUERADE Ip6tables - t nat - I PREROUTING - p tcp - d New machine public network IPv6 -- dport 80 - j DNAT -- to destination fc00:: 2 Ip6tables - t nat - I PREROUTING - p tcp - d New machine public network IPv6 -- dport 443 - j DNAT -- to destination fc00:: 2
ip -6 route add default via fc00::1
vi /etc/rc.local IP tunnel add gre tunel mode gre remote Intranet IP of new machine ttl 1 ip link set gre-tunnel up ip addr add fc00::2/64 dev gre-tunnel ip -6 route add default via fc00::1 Exit vi chmod +x /etc/rc.d/rc.local
service ip6tables save chkconfig ip6tables on vi /etc/rc.local IP tunnel add gre tunel mode gre remote Intranet IP ttl 1 of the old machine ip link set gre-tunnel up ip addr add fc00::1/64 dev gre-tunnel Exit vi chmod +x /etc/rc.d/rc.local