Create tunnels[edit]
- Create a logical tunnel device
- ip tunnel add tun0 mode ipip local [host's A public ip] remote [remote host's B public ip]
- Assign an IP address to the device
- ip address add [private ip address] dev tun0
- Set up routing rules to route traffic over the tunnel
- ip route add [remote network]/24 via [remote tunnels IP address]
- Each host is the mirror of the other when it comes to creating rules. E.G. The remote ip for host A is the local ip for host B and visa-versa.
Example[edit]
ip tunnel add tun0 mode ipip local 105.105.105.105 remote 41.41.41.41
ip address add 192.168.12.2 dev tun0
ip route add 10.0.10.0/24 via 192.168.12.2
ip route delete 192.168.1.0/24 dev eth0