IPIP(4)

NAME
ipip - encapsulating network device

SYNOPSIS
pseudo-device ipip [count]

DESCRIPTION
The ipip network interface is a pseudo device that allows to encapsulate datagrams into IP. These encapsulated datagrams are routed to a destination host, where they are decapsulated and further routed to their final destination. The so called ``tunnel'' appears to the inner datagrams like one hop. Encapsulation is according to RFC 2003. The outer datagram header is of IP type 4 (IPIP).

The network interfaces are named ipip0, ipip1 and so on, as many as have given on the pseudo-device line in the system config file.

Note that the IP addresses of the tunnel endpoints may be the same as the ones defined with ifconfig for the interface (as if IP is encapsulated), but need not be.

EXAMPLE
Configuration example: Host X-- Host A ----------------tunnel---------- cisco D------Host E \ | \ / +------Host B----------Host C----------+ On host A (NetBSD): # route add default B # ifconfig ipipN A D netmask 0xffffffff up # route add E D On Host D (Cisco): Interface TunnelX ip unnumbered D ! e.g. address from ethernet interface tunnel source D ! e.g. address from ethernet interface tunnel destination A ip route C <some interface and mask> ip route A mask C ip route X mask tunnelX OR On Host D (NetBSD): # route add default C # ifconfig ipipN D A

If all goes well, you should see packets flowing ;-)

If you want to reach Host A over the tunnel (from the Cisco D), then you have to have an alias on Host A for e.g. the ethernet interface like: ifconfig <etherif> alias Y and on the cisco ip route Y mask tunnelX

NOTE
For correct operation, the ipip device needs a route to the destination, that is less specific than the one over the tunnel. (Basically, there needs to be a route to the decapsulating host that does not run over the tunnel, as this would be a loop ..)

In order to ifconfig to actually mark the interface as up, the keyword ``up'' must be given last on its command line.

The kernel must be set to forward datagrams by either option ``GATEWAY'' in the kernel config file or by issuing the appropriate option to sysctl.

SEE ALSO
netintro(4), ip(4), gre(4), atalk(4), inet(4), ifconfig(8), options(4), protocols(5), sysctl(8)

A description of IPIP encapsulation can be found in RFC 2003.

BUGS
The ipip_compute_route() code in ip_ipip.c toggles the last bit of the IP-address to provoke the search for a less specific route than the one directly over the tunnel to prevent loops. This is possibly not the best solution.

Traceroute does not work yet over the tunnel :(