# IPtables howto ?

## castra

Trying to install/add iptables but with out success..

Added packet filtering in kernel and recopiled, but when i run iptables -L

I get :

 *Quote:*   

> iptables -L
> 
> /lib/modules/2.4.20-gentoo-r6/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_unregister_sockopt
> 
> /lib/modules/2.4.20-gentoo-r6/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_register_sockopt
> ...

 

What am I doing wrong ? 

Thanks

----------

## pcassidy

You most likely don't have all the required modules in your kernel, See the IP Masquerade howto

http://www.linux.org/docs/ldp/howto/IP-Masquerade-HOWTO/ipmasq-compiling3.1.html#IPMASQ-COMPILING3.1.1

If  As well as adding packet filtering you'll need some of the modules under

IP NetFilter Configuration.

Let me know how you get on, I went through this a couple of weeks ago..

----------

## bmichaelsen

Go to

```

cd /usr/src/linux/

make menuconfig

Networking options  --->           IP: Netfilter Configuration  --->
```

and compile in more modules.

You are missing some that are needed for your ipfilter setup ...

----------

## ClausH

I found this a good tutorial: http://iptables-tutorial.frozentux.net/iptables-tutorial.html

Mvh ClausH

----------

## SouthOfHeaven

Also remember after you compile the kernel with those options make sure to copy the new bzImage file in your /boot directory.

----------

## TheWart

I am using shorewall, but since that is pretty much a front end for iptables (i think), this is what I did.

Just configure pretty much everything under netfilter as a module.  Then you can take away a few at a time after this works.  Either way, if they are modules, it is not like you are making your kernel too big.

----------

## castra

Wow nice response....

I added Package filtering and these modules:

 *Quote:*   

> Base configuration
> 
>     * CONFIG_NETFILTER
> 
>       Networking options -> Network packet filtering
> ...

 

Still doesn't work ! It seams that I had to add all modules ...

Do you agree guys ?

----------

## herring

http://shorewall.net/kernel.htm

should suffice for most firewalls

----------

## castra

Add everything that was http://shorewall.net/kernel.htm  and still getting error when runing 

iptables -L

 *Quote:*   

> iptables -L
> 
> /lib/modules/2.4.20-gentoo-r6/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_unregister_sockopt
> 
> /lib/modules/2.4.20-gentoo-r6/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_register_sockopt
> ...

 

Maybe its something with kernel !

----------

## pcassidy

What does lsmod say? 

Did you definetely reboot on the new kernel after copying it into /boot?

Did you mount /boot before the copy.

----------

## ixion

I would suggest a clean kernel tree....

run 'make mrproper' from /usr/src/linux... then 'make menuconfig && make dep && make clean bzImage modules modules_install' and copy the new bzImage '/usr/src/linux/arch/i386/boot/bzImage' to /boot and setup LILO/GRUB accordingly.

If that doesn't work, I would suggest removing that kernel tree and emerging a fresh one. These two things have always solved unresolved symbols errors for me..  :Wink: 

edit: Don't forget to do a 'make menuconfig' FIRST and save out your configuration (in the save dialog, type 'config1' (without quotes), and press Enter. Once you've done 'make mrproper', then under 'make menuconfig' load it up (config1).  :Wink: 

----------

## GMFTatsujin

I agree. Starting with a clean kernel is always a good step when things go wrong or aren't reacting the way you expect them to.

Another trick: If you're using LILO as the boot manager, don't forget to run /etc/lilo after you replace your kernel, even if you delete the old one! Lilo doesn't go by the name of the image; I believe it uses the starting block of the file instead. That means that even if you delete the old kernel, unless you replace the information on the disk, your system will still boot. Weird but true. This one gets me more often then not. I must have recompiled my kernel 5 times trying to get PCMCIA support to work before I thought of Lilo....

----------

## castra

Kernel upgrade fixed iptables ....

Thanks guys for your help !

----------

## ixion

good to hear, glad you're up and running now!  :Very Happy:   :Very Happy:   :Very Happy: 

----------

## ank

I had the same problem but kernel upgrade fix it.

Thanks for help

mrproper rules  :Laughing: 

----------

