 | Distribution:
 | Clean installation of Debian "potato" 2.2r5. |
 | Linux kernel
2.2.19. |
 | FreeS/WAN 1.96   |
|
 | Recommended reading:
|
 | Why did I write this?
 | I think that I have found a few tricks that have been missed by others
-- at least I had trouble finding them. |
 | I wasn't able to find anything specific to configuring the kernel for
Debian for use with FreeSwan. It seems that most information out
there assumes that you know how to compile a kernel. |
 | I was in the process of installing Debian and FreeS/WAN on a few
machines and wanted a reference for myself so I could replicate
theinstallation.   |
|
 | Stuff to get:
 | FreeS/WAN |
 | Kernel source, kernel-package and the related utilities. The
easiest way to do this is with:# apt-get install kernel-package dpkg-dev debianutils binutils gcc \
libc6-dev make kernel-source-2.2.19 task-tcltk-dev bin86 gmp patch
On my installation, I only needed kernel-package, kernel-source-2.2.19,
and gmp. apt-get will only get the packages which
aren't already installed.
As of 2002-05-01 under Woody, there is no gmp package. Instead
I got libgmp3-dev which seems to do the trick.   |
|
 | Configure the kernel
It is a good idea to install a "custom" kernel without
installing FreeS/WAN in order to get familiar with the build process and to
test the kernel. If a custom kernel without the FreeS/WAN patches
doesn't work, it isn't going to work any better with the patches :)
 | Unpack the kernel source and make a symbolic link to it. If you
already have a linux directory in /usr/src, then you should use mv to
rename it. Then start xconfig to configure the kernel.# cd /usr/src
# bunzip2 kernel-source-2.2.19.tar.bz2
# tar xf kernel-source-2.2.19.tar
# ln -s kernel-source-2.2.19 linux
# make xconfig |
 | Once xconfig has launched its GUI, click on the "Load Configuration from
file" button. Enter "/boot/config-2.2.19" for the
filename. This will load the configuration used in building the kernel
installed on your system by Debian. This makes configuration much easier! |
 | Optionally, you can trim the size of the kernel by going through and
deselecting options that you don't need in the kernel (for instance network
cards not in your system). You can also optimize the kernel to your
processor type.   |
|
 | Building and installing the test kernel:
|
 | Building FreeS/WAN
|
 | Check to see if FreeS/WAN installed properly:
 | Look at /var/log/messages. There should be some lines looking
like:Mar 13 12:37:23 starbase kernel: klips_info:ipsec_init: KLIPS startup, FreeS/WAN IPSec version: 1.96
Mar 13 12:37:23 starbase kernel: early initialization of device ipsec0 is deferred
Mar 13 12:37:23 starbase kernel: early initialization of device ipsec1 is deferred
Mar 13 12:37:23 starbase kernel: early initialization of device ipsec2 is deferred
Mar 13 12:37:23 starbase kernel: early initialization of device ipsec3 is deferred |
 | /var/log/syslog should have some lines like:Mar 13 12:37:23 starbase ipsec_setup: Starting FreeS/WAN IPsec 1.96...
Mar 13 12:37:23 starbase ipsec_setup: KLIPS debug `none'
Mar 13 12:37:23 starbase ipsec_setup: WARNING: ipsec0 has route filtering turned on, KLIPS may not work
Mar 13 12:37:23 starbase ipsec_setup: (/proc/sys/net/ipv4/conf/ipsec0/rp_filter = `1', should be 0)
Mar 13 12:37:23 starbase ipsec_setup: WARNING: eth0 has route filtering turned on, KLIPS may not work
Mar 13 12:37:23 starbase ipsec_setup: (/proc/sys/net/ipv4/conf/eth0/rp_filter = `1', should be 0)
Mar 13 12:37:23 starbase ipsec_setup: ...FreeS/WAN IPsec started |
|
 | Fix the rp_filter settings:
 | Edit /etc/network/options and make the following change (bold)ip_forward=no
spoofprotect=no
syncookies=no
NOTE: this requires adding "forwardcontrol=yes" to the ipsec.conf file in
the config setup section. The alternative is to set ip_forward=yes here.
  |
|
 | Configuring FreeS/WAN:
Configuring FreeS/WAN is beyond the scope of this document. Instead, I have
provided some links to sites which do cover the configuration.  
|
 | Acknowledgments:
|
 | Disclaimer:
 | These are the steps that worked for me. Your mileage may vary. Attempting to install
FreeSwan or a compiled kernel can be dangerous. You could end up
with a totally unusable system or one with reduced
functionality. Follow my footsteps at your own risk. |
  |