出口端
ip tunnel add gre-tunnel mode gre remote $client_ipv4 ttl 128 ip link set gre-tunnel up ip addr add 2402:9e80:2b:b::1/64 dev gre-tunnel sysctl net.ipv6.conf.all.forwarding=1 sysctl net.ipv6.conf.all.proxy_ndp=1
$client_ipv4
为入口端IP地址入口端
ip tunnel add gre-tunnel mode gre remote $server_ipv4 ttl 128 ip link set gre-tunnel up ip addr add 2402:9e80:2b:b::2/64 dev gre-tunnel ip -6 route add default dev gre-tunnel # 会转发所有IPv6流量
$server_ipv4
为出口端IP地址测试
可以通过互ping来测试隧道搭建情况
维护
# 删除 ip link set gre-tunnel down ip tunnel del gre-tunnel # 修改IP ip tunnel change gre-tunnel remote $new_client_ipv4