		Installing KAME onto your FreeBSD 2.2.8

		KAME Project
		http://www.kame.net/
		$Date: 1999/04/14 16:37:37 $

Let us assume the followings:
	- the package you have is kame-1999xxxx-fbsd228-stable.tgz,
	- kernel source tree of FreeBSD is contained in "/usr/src/sys",
	- this packages are in "$SOMEWHERE/kit/",
	- v6 commands/libraries are to be stored in "/usr/local/v6".

Note: the following procedure modifies in files in "/usr/include".
So, we strongly recommend you to backup those files.
An example is as follows:

	# cd /usr
	# tar zcvf include.tar.gz. include

THE PACKAGE HAS BEEN WELL DESIGNED AND TESTED TO NOT DAMAGE YOUR HOST. 
THE FOLLOWING PROCEDURE MAY HOWEVER DAMAGE YOUR KERNEL, SOURCE TREE,
AND/OR FILES ON YOUR HOST. KAME PROJECT DISCLAIMS ALL RESPONSIBILITY
FOR SUCH DAMAGE CAUSED BY THIS PACKAGE.

Installation is organized as follows:

	(0) Extracting this package
	(1) Kernel reconfiguration 
	(2) Making sources of commands
	(3) Setup /usr/local/v6
	(4) Setting up /etc/rc
	(5) Rebooting the new kernel
	(6) Exploring ports

(0) Extract this package. 

	% cd $SOMEWHERE
	% gzip -c -d kame-1999xxxx-fbsd228-stable.tgz | tar -xvf -
	% cd kit

(1.1) Copy kernel source code tree to $SOMEWHERE/sys.  Apply
"$SOMEWHERE/kit/sys-228.diff" to the tree.

	# cd $SOMEWHERE
	# (cd /usr/src; tar Bpcf - sys) | tar Bpxf -
	# patch -p -f < $SOMEWHERE/kit/sys-228.diff

This command generates "$SOMEWHERE/sys/i386/conf/GENERIC.v6".

(1.2) Edit your configuration file as you like.
"$SOMEWHERE/sys/i386/conf/GENERIC.v6" is just a sample. 

	# cd $SOMEWHERE/sys/i386/conf
	# cp GENERIC.v6 IP6
	# vi IP6

You must carefully define INET6 in your configuration file. 

	--- IP6 ---
	options	"INET6"
	options "GATEWAY6"
	options IPSEC
	pseudo-device bpfilter  4
	pseudo-device gif       4
	--- IP6 ---

Your node acts as a router by default if GATEWAY6 is defined.  If
GATEWAY6 is not defined, the node acts as a host.  Even in the case,
you can dynamically change your host to a router by the following
command:
	sysctl -w net.inet6.ip6.forwarding=1
For more information, see etc/rc.net6.

If you wish to use IPsec, add "options" lines with IPSEC.

The number after "gif" indicates the number of configured tunnels.  If
you don't need gif, comment out the line.

If you want to have ATM features, add the followings:

	options         NATM
	pseudo-device   atm

(1.3) Re-configure your kernel then move the new one to "/".  Simple
"mv kernel /kernel" may not work, due to the new security mechanism in
4.4BSD.  If you wish to do mv/cp the kernel, invoke "chflags noschg
/kernel" beforehand.

	# config IP6
	# cd ../../compile/IP6
	# make depend
	# make
	# make install

(2) All commands and libraries EXCEPT "ports" are to be stored only in
"/usr/local/v6".  Commands are provided in source form so we should
compile them.

(2.1) Update include files.  First, apply the patch to "netdb.h",
"unistd.h" and "resolv.h". (If this is not the first time to install KAME,
this step may be unnecessary. )

	# cd /usr/include
	# patch -p1 -f < $SOMEWHERE/kit/include-228.diff

Note: If you dont't have /usr/include/Makefile, the patch command makes
a reject file. However, you can safely ignore the rejection.

Then create symbolic links so that they refer to the kernel sources.

	# mv net net-dist
	# ln -s $SOMEWHERE/sys/net
	# mv netinet netinet-dist
	# ln -s $SOMEWHERE/sys/netinet
	# mv netkey netkey-dist
	# ln -s $SOMEWHERE/sys/netkey
	# mv sys sys-dist
	# ln -s $SOMEWHERE/sys/sys
	# mv machine machine-dist
	# ln -s $SOMEWHERE/sys/i386/include machine
	# ln -s $SOMEWHERE/sys/netinet6

(3) Now you can "make" the userland tools in the kit directory.

	% cd $SOMEWHERE/kit
	% make
	% su
	# make install

(4) Add the following line in "/etc/rc". 

	[ -f /usr/local/v6/etc/rc.net6 ] && sh /usr/local/v6/etc/rc.net6

Copy "/usr/local/v6/etc/rc.net6.sample" into "rc.net6" and edit the
content to make it fit into your configuration.

(5) OK, now reboot the new kernel.

	# shutdown -r now

(6) If you want to use more useful applications, please explore the
"ports" directory.

It is convenient to add "/usr/local/v6/man" in "/etc/manpath.config".

Each user may want to add "/usr/local/v6/bin" and "/usr/local/v6/sbin"
to `PATH' or `path'.

							<end of INSTALL>
