ipp2p HOWTO for Fedora Core 6

23 01 2007

While this post is titled “for Fedora Core 6″, it may be applicable to previous versions of Fedora Core. I tested this on Fedora Core 4 too, but some steps are different.
Note: This guide uses iptables-1.3.5-1.2.1 and kernel-2.6.19-1.2895.fc6.

First, grab ipp2p-0.8.2.tar.gz or the latest version if there’s any. Extract the tarball and make sure you have iptables and the currently installed kernel’s SRPMs installed. To proceed, I recommend rpm-build to be installed (simply use yum to install, i.e. yum install rpm-build). Next, install both SRPMs using the following command: rpm -ivh file.rpm. If you get “error: cannot create %sourcedir /usr/src/redhat/SOURCES” message, you can create the required directory: mkdir -p /usr/src/redhat. Also, rpm-building the kernel source requires redhat-rpm-config and unifdef to be installed.
Now that the “ingredients” are ready, let’s start doing the fun part..

Go to /usr/src/redhat/SPECS and do rpmbuild -bp iptables.spec, this will prepare the iptables’ source tree to match with the currently installed iptables binaries’ source. Do the same for the kernel, rpmbuild -bp kernel-2.6.spec. The newly patched source tree can be found inside /usr/src/redhat/BUILD directory.

Grab symvers-2.6.19-1.2895.fc6.gz from /boot, gunzip and rename it as Module.symvers, then move it to the kernel’s source directory (/usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19-i386). Go into that directory, make sure that existing kernel config (.config) exists, then do: make scripts/kconfig/.
Note: If you can’t find symvers file in /boot, install kernel-devel package and you will find Module.symvers in /usr/src/kernels/<kernel-version>/.

Next, return to the ipp2p source directory and do two modifications.

Add:

KERNEL_SRC=/usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19.i386

before

KERNEL_SRC ?= $(firstword $(wildcard …

Add:

IPTABLES_SRC = /usr/src/redhat/BUILD/iptables-1.3.5

before

ifeq ($(IPTABLES_SRC),)

Save the changes and do make.

If it compiles successfully, then ipt_ipp2p.ko and libipt_ipp2p.so should be in the directory now.
Copy libipt_ipp2p.so to /lib/iptables. To verify whether this iptables module works, do iptables -m ipp2p -h.
In case you get the following: iptables v1.3.8: Couldn’t load match `ipp2p’, don’t worry. Have a look at this solution and simply recompile the modules.

There are two ways to load the ipp2p kernel module, insmod ipt_ipp2p.ko or copy ipt_ipp2p.ko to /lib/modules/2.6.19-1.2895.fc6/kernel/net/ipv4/netfilter and do depmod -a.