ip route cheatsheet – tunnel with assigned interfaces

When creating an ip tunnel (see ip route cheatsheet) you may let linux to find the right routing path between the nodes.

To create a tunnel between two exact ips (eg. one node has more of one ip on the same network) you have to use the `local` options.

ex. with the following configuration

# host1
eth0: 192.168.0.1/16, 192.168.1.1/16
# host2
eth2: 192.168.0.2/16

Just force host1 to use one of the source ip.

#host1
ip tun add tun0 mode ipip remote 192.168.0.2 local 192.168.1.1
# host2
ip tun add tun0 mode ipip remote 192.168.0.1 local 192.168.0.2

Lascia un commento