old-www/HOWTO/Mobile-IPv6-HOWTO/mipv6.html

605 lines
9.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Mobile IPv6 for Linux</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Linux Mobile IPv6 HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="IPv6"
HREF="ipv6.html"><LINK
REL="NEXT"
TITLE="Test bed"
HREF="testbed.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Mobile IPv6 HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="ipv6.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="testbed.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="MIPv6"
></A
>3. Mobile IPv6 for Linux</H1
><P
>There are currently two Mobile IPv6 Linux implementations
available. The Lancaster University in the UK has the oldest(?)
implementation (<A
HREF="http://www.cs-ipv6.lancs.ac.uk/MobileIP/"
TARGET="_top"
>&#13;http://www.cs-ipv6.lancs.ac.uk/MobileIP/</A
>). The latest kernel
supported is 2.1.90, and is compatible with IETF mobile IPv6 draft-v5
(the current revision is v24). The code and website has not been
updated since 1998, so it is considered obsolete. </P
><P
>The other implementation, which is up-to-date, is Helsinki
University of Technology's MIPL project. The latest supported
kernel is 2.4.22, and they have patches for the upcoming 2.6
kernel (see the FAQ). Visit <A
HREF="http://www.mobile-ipv6.org/"
TARGET="_top"
>&#13;http://www.mobile-ipv6.org/</A
> for papers, software or to
browse the mail archive. </P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="patch"
></A
>3.1. Patching the kernel</H2
><P
>The MIPL MIPv6 implementation requires a kernel patch. The
implementation modifies the IPv6 kernel stack, so a kernel recompile
is necessary. The installation process is well documented, but I
will give a brief step-by-step howto. </P
><P
><EM
>Please note! The need for two different kernels, one for MN and
one for HA, is obsolete. Just compile support for MN and HA in the
same kernel. It is not possible to run as both an MN and an HA at
the same time; which mode is chosen depends on which of the modules
are loaded.</EM
>
</P
><P
>&#13; <P
></P
><OL
TYPE="1"
><LI
><P
> Download the latest Linux MIPv6 source code from
<A
HREF="http://www.mobile-ipv6.org/"
TARGET="_top"
>&#13; http://www.mobile-ipv6.org/</A
>. The latest release today is:
<EM
>mipv6-1.0-v2.4.22</EM
>. The last four numbers
corresponds to the Linux kernel the patch should be applied to:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # cd /usr/local/src
# wget http://www.mobile-ipv6.org/download/mipv6-1.0-v2.4.22.tar.gz
# tar zxfv mipv6-1.0-v2.4.22.tar.gz
</PRE
></FONT
></TD
></TR
></TABLE
></LI
><LI
><P
> Download and unpack the correspondent Linux kernel version
from <A
HREF="ftp://ftp.kernel.org"
TARGET="_top"
>ftp.kernel.org</A
>:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # cd /usr/src
# wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.22.tar.bz2
# tar jxvf linux-2.4.22.tar.bz2
# ln -s linux-2.4.22 linux
# cd linux
</PRE
></FONT
></TD
></TR
></TABLE
></LI
><LI
><P
>Apply the MIPv6 patch:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # patch -p1 --dry-run &#60; /usr/local/src/mipv6-1.0-v2.4.22/mipv6-1.0-v2.4.22.patch
</PRE
></FONT
></TD
></TR
></TABLE
><P
>The --dry-run option checks that the patch will apply
correctly. If you get any failed hunks, you should
<EM
>not</EM
> proceed. If everything went fine do:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>
# patch -p1 &#60; /usr/local/src/mipv6-1.0-v2.4.22/mipv6-1.0-v2.4.22.patch
</PRE
></FONT
></TD
></TR
></TABLE
></LI
><LI
><P
> Now your kernel tree is ready for configuration. Run your
favorite <B
CLASS="command"
>make *config</B
>. The MIPv6 options are under
<SPAN
CLASS="QUOTE"
>"Networking Options"</SPAN
>. The following options should be present in
<EM
><SPAN
CLASS="QUOTE"
>".config"</SPAN
></EM
>:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; CONFIG_EXPERIMENTAL=y
CONFIG_SYSCTL=y
CONFIG_PROC_FS=y
CONFIG_MODULES=y
CONFIG_NET=y
CONFIG_NETFILTER=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IPV6=m
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_IPV6_TUNNEL=m
CONFIG_IPV6_MOBILITY=m
CONFIG_IPV6_MOBILITY_MN=m
CONFIG_IPV6_MOBILITY_HA=m
</PRE
></FONT
></TD
></TR
></TABLE
><P
> Since MIPL is still a work-in-progress you might want to
enable:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; CONFIG_IPV6_MOBILITY_DEBUG=y
</PRE
></FONT
></TD
></TR
></TABLE
><P
> With debug messages it is easier to figure out what
happened when something goes wrong. Also, when reporting a bug,
debug messages are very helpful.</P
><P
>To be sure you have all the correct options, you can run
<TT
CLASS="userinput"
><B
>chkconf_kernel.sh</B
></TT
>, which is a small shell
script included in the MIPL tarball.</P
></LI
><LI
><P
> Next you should compile and install your kernel.</P
><P
> Hint: To easily distinguish this kernel from other
kernels, you can change the <SPAN
CLASS="QUOTE"
>"EXTRAVERSION"</SPAN
> variable
in the <TT
CLASS="userinput"
><B
>/usr/src/linux/Makefile</B
></TT
> to for
example <SPAN
CLASS="QUOTE"
>"-MIPv6-1"</SPAN
>.</P
></LI
></OL
>
</P
><P
>Read the <A
HREF="http://tldp.org/HOWTO/Kernel-HOWTO/"
TARGET="_top"
>Linux Kernel
HOWTO</A
> for detailed instruction on how to patch, compile and
install your new kernel.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="userspace"
></A
>3.2. Userspace tools</H2
><P
>The userspace tool <TT
CLASS="userinput"
><B
>mipdiag</B
></TT
>, config
files and init scripts must be installed for the module to work
correctly:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # cd /usr/local/src/mipv6-1.0-v2.4.22
# ./configure
# make &#38;&#38; make install
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="dev"
></A
>3.3. MIPv6 device node</H2
><P
>The MIPv6 module also needs a new device node entry. Issue
the command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # mknod /dev/mipv6_dev c 0xf9 0
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="startup"
></A
>3.4. Automatic startup</H2
><P
></P
><OL
TYPE="1"
><LI
><P
><EM
>Red Hat:</EM
></P
><P
>All init scripts are located in <TT
CLASS="filename"
>/etc/init.d/</TT
>,
which are sym-linked to the correct runlevel
(<TT
CLASS="filename"
>/etc/rcX.d/</TT
>). You can issue the command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # chkconfig --add mobile-ip6
</PRE
></FONT
></TD
></TR
></TABLE
><P
>to enable MIPv6 at startup, or</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # chkconfig --del mobile-ip6
</PRE
></FONT
></TD
></TR
></TABLE
><P
>to remove MIPv6 from startup.</P
></LI
><LI
><P
><EM
>Debian:</EM
></P
><P
>If you are so lucky to be running Debian, you can issue
the command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # update-rc.d -n mobile-ip6 start 75 3 4 5 . stop 05 1 2 6 .
</PRE
></FONT
></TD
></TR
></TABLE
><P
>to set up all the necessary links.</P
></LI
><LI
><P
><EM
>Slackware:</EM
></P
><P
>Slackware users have all their startup/runlevel scripts in
<TT
CLASS="filename"
>/etc/rc.d</TT
>. Since 'configure' doesn't check for
<SPAN
CLASS="QUOTE"
>"/etc/rc.d"</SPAN
>,
you can add <EM
>INIT_SLACK="/etc/rc.d"</EM
>, and then
INIT_SLACK to INITDIRS in 'configure' (search for INITDIR in
configure). Since you are running Slackware, you probably know
this already. The following command should then do the
trick:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; # echo '/etc/rc.d/mobile-ip6 start' &#62;&#62; /etc/rc.d/rc.local
</PRE
></FONT
></TD
></TR
></TABLE
><P
>If you don't hack the Makefile, the
<TT
CLASS="filename"
>mobile-ip6</TT
> script is installed at '/' (you
may then move it to /etc/rc.d/).</P
></LI
></OL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="ipv6.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="testbed.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>IPv6</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Test bed</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>