MobileIP encapsulating network
mobileip driver provides IP tunnel
construction using the Mobile IP (RFC 2004) encapsulation protocol
mobileip datagrams (IP protocol number 55)
are encapsulated into IP using a small encapsulation header. This protocol,
in line with the RFC, only supports encapsulating IPv4.
mobileip interface can be created at
runtime using the
create command or by setting up a
hostname.if(5) configuration file for
The MTU is set to 1488 by default. This may not be an optimal value depending on the link between the two tunnel endpoints, but it can be adjusted via ifconfig(8).
For correct operation, the route to the tunnel destination must not go over the interface itself. This can be implemented by adding a distinct or a more specific route to the tunnel destination than the hosts or networks routed via the tunnel interface. Alternatively, the tunnel traffic may be configured in a separate routing table to the encapsulated traffic.
mobileip interfaces support the following
ioctl(2)s for configuring tunnel options:
SIOCSLIFPHYADDRstruct if_laddrreq *
- Set the addresses of the outer IP header. The addresses may only be configured while the interface is down.
SIOCGLIFPHYADDRstruct if_laddrreq *
- Get the addresses of the outer IP header.
- Clear the outer IP header addresses. The addresses may only be cleared while the interface is down.
SIOCSLIFPHYRTABLEstruct ifreq *
- Set the routing table the encapsulated IP packets operate within. The routing table may only be configured while the interface is down.
SIOCGLIFPHYRTABLEstruct ifreq *
- Get the routing table the encapsulated IP packets operate within.
Host X --- Host A ----------- MobileIP ------------ Host D --- Host E \ / \ / +------ Host B ------ Host C ------+
On Host A (OpenBSD):
# route add default B # ifconfig mobileipN create # ifconfig mobileipN tunnel A D # ifconfig mobileipN A D netmask 255.255.255.255 # route add E D
On Host D (OpenBSD):
# route add default C # ifconfig mobileipN create # ifconfig mobileipN tunnel D A # ifconfig mobileipN D A netmask 255.255.255.255 # route add D E
The route domain used for the encapsulated traffic may be set using ifconfig(8) and the tunneldomain argument:
# ifconfig mobileipN tunneldomain 1
inet(4), ip(4), netintro(4), options(4), hostname.if(5), protocols(5), ifconfig(8), netstart(8)
C. Perkins, Minimal Encapsulation within IP, RFC 2004, October 1996.
Support for the MobileIP protocol was originally implemented as
part of the gre(4) driver. The
mobileip driver was split
off from gre(4) in OpenBSD 6.3.