$Id: INSTALL,v 1.40 2006/07/10 11:36:59 fukumoto Exp $

The Racoon2 installation guide
==============================

1. Make sure your platform and libraries before you will build and install
   the racoon2.

o Note

  In this release,

- NAT-T only works on Linux.

- Note that if your kernel enables NAT-T AND if you do not specify
  both "peers_sa_ipaddr" and "my_sa_ipaddr" in the configuration
  of the racoon system, then iked(8) can not install the pair of SAs
  into the kernel.

o Platform requirement
	Linux (kernel 2.6)
	FreeBSD 5.5-RELEASE
	NetBSD 3.0

	+ command
	GNU Compiler Collection 3.x/4.x
	GNU make (gmake) or pmake

o Libraries requirement

Before installing racoon2, you must install required libraries.

- OpenSSL (http://www.openssl.org/)
	Recent environments have OpneSSL installed by default so
	you don't have to install it by yourself.  Otherwise,
	install it via your package system or from the source code.

	OpenSSL 0.9.7c or upper version is recommended.

- Kerberos5 library, if you need kinkd

  Heimdal (http://www.pdc.kth.se/heimdal/)
	FreeBSD and NetBSD have integrated Heimdal so you don't need to
	install it by yourself. For Debian GNU/Linux users, install 
	'heimdal-dev' packege. 'heimdal-clients' may also help you.
	Use version 0.6.x or 0.7.x.  Newer/older versions will not work.

  MIT krb5 (http://web.mit.edu/kerberos/)
	Use version 1.3.x or 1.4.x.  Newer/older versions will not work.

2. You have to enable IPsec on your platform.

o Linux (kernel 2.6)

- enable your kernel to support IPsec.
  the following configuration items to set 'Y' or 'M' at kernel compilation.

  CONFIG_NET_KEY
  CONFIG_INET_AH
  CONFIG_INET_ESP
  CONFIG_INET_IPCOMP
  CONFIG_XFRM
  CONFIG_XFRM_USER

  ** If you have the IPv6 and you want to use IPsec on it,
     you additionally need these items.

     CONFIG_INET6_AH
     CONFIG_INET6_ESP
     CONFIG_INET6_IPCOMP

  and at least set the following Cryptograhic options

  CONFIG_CRYPTO
  CONFIG_CRYPTO_HMAC
  CONFIG_CRYPTO_NULL
  CONFIG_CRYPTO_MD5
  CONFIG_CRYPTO_SHA1
  CONFIG_CRYPTO_DES
  CONFIG_CRYPTO_AES(_586)
  CONFIG_CRYPTO_DEFLATE

  for more information about building kernel, 
  please refer to "Linux Kernel Source Directory"/README.

  If you use the kernel in some distribution and it has
  modules of IPsec, you may make the kernel support IPsec
  without re-compling.

  You may need these modules; af_key.ko, ah4.ko, esp4.ko,
  xfrm4_tunnel.ko and some crypto algorithms such as aes.ko
  and sha1.ko.
  (For IPv6, ah6.ko, esp6.ko and xfrm6_tunnel.ko are required too.)

- build racoon2

  Please refer to the section 3.

o FreeBSD 5.5-RELEASE

- install FreeBSD 5.5-RELEASE to your PC.
  for detail to install it, please refer to
    http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install.html

- enable your kernel to support IPsec.
  the following lines to your kernel configuration file.

	options IPSEC
	options IPSEC_ESP

  rebuild your kernel.

	# make buildkernel KERNCONF=YOURKERNEL
	# make installkernel KERNCONF=YOURKERNEL

  for more detail to make your kernel, please refer to
    http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html

- build racoon2
  get the racoon2 tarball from ftp://ftp.kame.net/pub/racoon2/
  and expand it to your build directory.  you can see the "racoon2" directory.
  change to the directory and just type "./configure" and "make".
  make(1) will run configure(1) in each directory then build each daemon.

	% ./configure
	% make

o NetBSD 3.0

- Build your custom kernel with IPsec support enabled.

  Add the following lines to your kernel configuration file.
	options IPSEC
	options IPSEC_ESP

  Rebuild your kernel.
	% config YOURKERNEL
	% cd ../compile/YOURKERNEL
	% make depend
	% make
	# make install

  For more information to make a custom kernel, please refer to
    http://www.netbsd.org/guide/en/chap-kernel.html

- Build racoon2

	% ./configure
	% make

  For more information, look at "Install the racoon2" section of
  this file or "FreeBSD 5.5-RELEASE" case.

3. Build and install the Racoon2.

First you have to run the configure script at the top directory
of the racoon2 kit that you expanded to your system.  Just type:

	% ./configure

The programs will be installed to the directory under /usr/local
as the default.  If you want to change the directory to $NEWDIR,
you have to type like the following:

	% ./configure --prefix=$NEWDIR

If you want to install the programs with a specific owner, then you can
define it like the following:

	% ./configure --with-install-opts="-o root -g wheel"

Available options to the configure script besides standard ones are:
	--with-krb5=<kerberos 5 directory>
	--disable-iked
	--disable-kinkd
	--enable-pcap

After you run the configure script, you have to make all programs.

	% make

Then if you want to install them, just type the following:

	# make install

If you did not change the default install directory, you can see
the following tree.

	/usr/local/
	   |
	   +-- sbin/
	   |      daemon programs and utilities
	   +-- etc/
	   |      starting scripts and a sample configuration
	   +-- man/
		  manual pages of the programs

4. See doc/USAGE for the next step.
