ubuntu
写入网卡/etc/network/interfaces
auto tun0
iface tun0 inet static
address <local tunnel IP>
netmask <tunnel subnet mask>
pre-up iptunnel add tun1 mode gre local <local IP> remote <remote IP> ttl 255
up ifconfig tun1 multicast
pointopoint <remote tunnel IP>
post-down iptunnel del tun1
Centos类方法
约定:
hostA IP:公网 100.xx.xx.101 内网10.0.0.1
hostB IP:公网192.xx.xx.101 内网10.0.0.2