IPIP is a very simple method of tunneling IP packets over an IP connection.
You need to have ip over ip routing support compiled in or compiled as a module
Networking Options -> IP Tunneling (CONFIG_NET_IPIP)
You will also need /sbin/ip (see iproute(8)?). This usually comes in a package called iproute (eg Debian) or iproute2 depending on your distribution.
There are two machines that we want to create a ip over ip link between for some reason. Lets call them Router A and Router B. These routers are both connected to the internet, you will also need a network to use on the tunnel. In the example below Router A and B have addreses in the same subnet, this is not a requirement, you can create a tunnel to a host on the other side of the internet if you want.
| Tunnel Network | 192.168.1.0/24 | Router A - IP | 192.0.2.34 | Router A - Tunnel IF | 192.168.1.1 | Router B - IP | 192.0.2.69 | Router B - Tunnel IF | 192.168.1.254
You can call your tunnel whatever you like, substitute <name> for something more descriptive in the examples below
ip tunnel add <name> mode ipip remote 192.0.2.69 local 192.0.2.34 ip link set <name> up ip addr add 192.168.1.1/24 dev <name>
ip tunnel add <name> mode ipip remote 192.0.2.34 local 192.0.2.69 ip link set <name> up ip addr add 192.168.1.254/24 dev <name>
Edit /etc/network/interfaces
auto <name> iface <name> inet static
address 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 pre-up /sbin/ip tunnel add <name> mode ipip remote 192.0.2.69 local 192.0.2.34 post-down /sbin/ip tunnel del <name>
Then execute
ifup <name>
Edit /etc/network/interfaces
auto <name> iface <name> inet static
address 192.168.1.254 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 pre-up /sbin/ip tunnel add <name> mode ipip remote 192.0.2.34 local 192.0.2.69 post-down /sbin/ip tunnel del <name>
Then execute
ifup <name>
After you have configured your tunnel via one of the examples above you should be able to ping the remote end
ping 192.168.1.254
ping 192.168.1.1
Both pings should succeed without problems.
See also: IPIPHowto?
2 pages link to IPIP: