KAME Mobile IPv6 How To

Keiichi SHIMA @ {KAME Project | Internet Initiative Japan}


This documents decsribes the step-by-step instruction to use KAME Mobile IPv6(KAME/MIP6) features. Since KAME/MIP6 is still under developping, these information may be outdated at the time when you are reading this document. Please refer the latest documentation included in the KAME kit in such a case.

Supported Platforms

Currently, Only FreeBSD is proved to work as a home agent and or a mobile node or a correspondent node. We are also operating a NetBSD box as a home agent (and, of course, as a correspondent node). It seems working but not tested in a heavy load/various environment. The mobile node functions are not tested on NetBSD yet. Other BSDs (OpenBSD and BSD/OS) is not tested yet.


KAME/MIP6 is under developping. You should use the latest KAME snap kit always. Get the latest kit from the KAME Project website

Compile with MIP6 extention

MIP6 is not enabled by default. You should prepare a new kernel configuration file and rebuild your kernel that is able to speak the MIP6 protocol. Also, some user-space commands need recompilation. Follow the instruction below.

recompile your kernel

To enable MIP6 features, specify following kernel options in your kernel configuration file and recompile the kernel.

options MIP6
options MIP6_DEBUG
pseudo-device hif 1

If you specify MIP6_DEBUG, the kernel will print many debuging messages. Though it may be annoying you, it is very useful when you encounter some problems.

MIP6_ALLOW_COA_FALLBACK enables the CoA fallback feature. In the MIP6 specification, the author decreres that all IPv6 node must support the home address destination option. But, there are not so many implementations those support the option. If the peer doesn't recognizes the home address destination option, the mobile node can't communicate with that node. If you specify MIP6_ALLOW_COA_FALLBACK, the kernel will try to use its home address as a source address WITHOUT the home address destination option. If this approach fails or in the next time to connect to the same peer, the kernel will use CoA as its source address. Yes, I know that the former violates MIP6 specification and the latter make the mobile node from moving from one network to another network, though, it is very useful in such a transision period that not all implementation support the home address destination option.

Build user-space commands

There are two user-space commands related to MIP6. One is rtadvd and the other is mip6control. If you want to have a home agent, you must rebuild rtadvd with MIP6 option. mip6control is a controll command of KAME/MIP6 functions. All users need to build mip6control to use KAME/MIP6.

recompile rtadvd

Go to the directory of rtadvd (${KAME}/freebsd4/sbin/rtadvd/ for FreeBSD), add the following line to Makefile

Recompile rtadvd and install it.
$ make clean
$ make
$ su (become the super user)
# make install

build mip6control

There is no operating specific directory for mip6control. Goto ${KAME}/kame/kame/mip6control/ and just make.

$ make
$ su (become the super user)
# make install

The latest KAME/FreeBSD4 will automatically compile mip6control and install it to proper position.

Set up a home agent

To become a home agent, complete the following settings.

Prepare rtadvd.conf for a home agent


The point of the configuration is flags and address(es) of the prefix infomation. raflags specifies a home agent bit (third highest bit). pinfoflags specifies a router address bit (third highest bit). addrs#1 specifies the address of this home agent. This must be a full ipv6 address (not only the netowrk prefix of this link) of the home agent.

Invoke rtadvd

Invoke rtadvd with -m option. This option enables MIP6 feature of rtadvd.

Assign home agent subnet anycast address

Assigning a home agent subnet anycast address makes it possible to do DHAAD (Dynamic Home Agent Address Discovery). The anycast address is calculated as follows.

If you have 64 bits length prefix, concatinated address of your prefix and 0xfdfffffffffffffe is the home agent subnet anycast addrss. If your prefix is not 64 bits, fill host part bits from curving proper bits from the value 0xfffffffffffffffffffffffffffffffe. For example, if your prefix is 2001:200:1:2::/64, the home agent subnet anycast address is 2001:200:1:2:fdff:ffff:ffff:fffe.

Starting MIP6

Starting a home agent

To start a home agent, invoke the following command.

mip6control -g

That's all.

Starting a mobile node

To make a node as a mobile node, you must specify your home network prefix. To do this, invoke the following command.

mip6control -H2001:200:1:1:: -P64 

Replace '2001:200:1:1::' with your home prefix. After prefix setting has finished, enable mobile function using -m option.

mip6control -m

To detect movement, a mobile node need to receive Router Advertisement packets. The easy way is to invoke rtsol command. You may want to run rtsold with -a -m options to make the node detect its location quicklly.

To Do

There are many things to do. Followings are some of them. The detailed items are described in TODO.mobile-ip6 in the top of the KAME directory.

Keiichi SHIMA
Last modified: Fri Nov 30 18:57:11 JST 2001