| Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
|---|---|---|
| Prev | Chapter 25. Linux FreeS/WAN VPN | Next |
You must modify the Makefile under the FreeS/WAN source directory and subdirectories named utils, klips/utils, Pluto, and lib to specify installation paths. We must modify these files to be compliant with Red Hat's file system structure and install FreeS/WAN files under our PATH environment variable.
Move to the top-level directory of the new FreeS/WAN distribution and type the following commands on your terminal: Edit the Makefile file, vi Makefile and change the following lines:
PUBDIR=/usr/local/sbin
|
PUBDIR=/usr/sbin
|
PRIVDIR=/usr/local/lib/ipsec
|
PRIVDIR=/usr/lib/ipsec
|
FINALPRIVDIR=/usr/local/lib/ipsec
|
FINALPRIVDIR=/usr/lib/ipsec
|
MANTREE=/usr/local/man
|
MANTREE=/usr/man
|
Edit the Makefile file of the subdirectory utils, vi utils/Makefile and change the following lines:
PUBDIR=/usr/local/sbin
|
PUBDIR=/usr/sbin
|
PRIVDIR=/usr/local/lib/ipsec
|
PRIVDIR=/usr/lib/ipsec
|
FINALPRIVDIR=/usr/local/lib/ipsec
|
FINALPRIVDIR=/usr/lib/ipsec
|
MANTREE=/usr/local/man
|
MANTREE=/usr/man
|
Edit the Makefile file of the subdirectory klips/utils, vi klips/utils/Makefile and change the following lines:
BINDIR=/usr/local/lib/ipsec
|
BINDIR=/usr/lib/ipsec
|
MANTREE=/usr/local/man
|
MANTREE=/usr/man
|
Edit the Makefile file of the subdirectory pluto, vi pluto/Makefile and change the following lines:
BINDIR=/usr/local/lib/ipsec
|
BINDIR=/usr/lib/ipsec
|
MANTREE=/usr/local/man
|
MANTREE=/usr/man
|
Edit the Makefile file of the subdirectory lib, vi lib/Makefile and change the following lines:
MANTREE=/usr/local/man
|
MANTREE=/usr/man
|
Edit the Makefile file of the subdirectory libdes, vi libdes/Makefile and change the following lines:
LIBDIR=/usr/local/lib
|
LIBDIR=/usr/lib
|
BINDIR=/usr/local/bin
|
BINDIR=/usr/bin
|
INCDIR=/usr/local/include
|
INCDIR=/usr/include
|
MANDIR=/usr/local/man
|
MANDIR=/usr/man
|
Now, we must compile and install FreeSWAN on the server:
[root@deep ]/freeswan-1.3# make insert
[root@deep ]/freeswan-1.3# make programs
[root@deep ]/freeswan-1.3# make install
|
The make insert command creates a symbolic link /usr/src/linux/net/ipsec, pointing to the KLIPS source directory. It patches some kernel files, where necessary, to know about KLIPS and/or to fix bugs. It also adds its default configuration to the kernel configuration file, and finally, it makes the KLIPS communication file, /dev/ipsec, if it's not already there.
The make programs command builds the libraries, Pluto, and various user-level utilities.
The make install will install the Pluto daemon and user-level utilities, and set things up for boot-time startup.