Compile and Install FreeSWAN on RedHat Linux 7.3

I had the need to install FreeSWAN on an old RedHat Linux 7.3 machine. While most people's initial reaction would be to upgrade the system, we all know this is not always an option.

I initially tried to do a simple “rpmbuild –rebuild…” but that did not do the trick. I would get “unresolved symbol…” errors. However, I finally found a way to get the kernel module to compile correctly.

Compile Source RPMs

The machine I was working on had the following kernel installed:
kernel-2.4.20-42.7.legacy
kernel-utils-2.4-7.4
kernel-source-2.4.20-42.7.legacy

I needed to recompile using a source RPM.
prompt> rpmbuild --rebuild --without smp --without uml --without bigmem --without debug --target i686 freeswan-2.06-1fs.src.rpm

Adjust the above options to match your particular needs.

Install Compiled RPMs

Move to the folder with the compiled RPMs
prompt> cd /usr/src/redhat/RPMS/i686/

Install the RPMs
prompt> rpm -Uvh freeswan-*.rpm

Refresh the kernel module dependencies
prompt> /sbin/depmod -ae

If the above command did not give any errors, proceed. Otherwise, go back and check the options chosen during the “rpmbuild”.

Load the IPSec kernel module
prompt> /sbin/modprobe ipsec

Edit the IPSec settings to your needs. Go to the FreeS/WAN Project Documentation on configuring your machine.
prompt> vi /etc/ipsec.conf

Start the FreeS/WAN IPSec Services
prompt> /sbin/service ipsec start

FreeS/WAN Project
freeswan, linux, vpn, compile

Leave a Reply

Your email address will not be published. Required fields are marked *