2011-05-05

IPIP Tunnels in Linux

NetA – RouterA – Inet – RouterB – NetB

Router A (eth0: 172.16.1.2/24; eth1: 10.0.0.0/24)

modprobe ipip
ip tunnel add tun0 mode ipip \
remote 172.16.2.2 local 172.16.1.2
ip addr add 192.168.1.1 peer 192.168.1.2 dev tun0
ip link set tun0 up
ip route add 10.0.4.0/24 dev tun0
netstat -rn

 

Router A (eth0: 172.16.2.2/24; eth1: 10.0.4.0/24)

modprobe ipip
ip tunnel add tunnel0 mode ipip \
remote 172.16.1.2 local 172.16.2.2
ip addr add 192.168.1.2 peer 192.168.1.1 dev tunnel0
ip link set tunnel0 up
ip route add 10.0.0.0/24 dev tunnel0
netstat -rn

No comments: