# Problems with iptables!

## cod3gen

I've got a problem with IPtables. I want to set up my home network for sharing internet connection. I've read this HOWTO: http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO and compiled my kernel straight after that howto...(tried with modules and compiled into the kernel) but still get confused because: 

- I still can't load the module ip_tables. And got the same error message even if I've compiled ip tables into the kernel (using iptables-1.2.6a).

In the boot progress (well actually in the deafult progress after the boot) and when I'm trying modprobe ip_tables I get this message:

```
# modprobe ip_tables

/lib/modules/2.4.19-gentoo-r4/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_unregister_sockopt

/lib/modules/2.4.19-gentoo-r4/kernel/net/ipv4/netfilter/ip_tables.o: unresolved symbol nf_register_sockopt

/lib/modules/2.4.19-gentoo-r4/kernel/net/ipv4/netfilter/ip_tables.o: insmod

/lib/modules/2.4.19-gentoo-r4/kernel/net/ipv4/netfilter/ip_tables.o failed

/lib/modules/2.4.19-gentoo-r4/kernel/net/ipv4/netfilter/ip_tables.o: insmod ip_tables failed
```

(I'm using a rc.firewall-2.4-stronger script that comes with the HOWTO above with the only modification setting the iptables right path).

Someone got any idea on any possible solution for this?

----------

## shakti

same error here...searching for answers   :Question: 

----------

## Snoopy

Does IP-Masq need iptables? Ok read the how to and I see it does. Reading the how to there are alot of deps to the kernel. Have you checked to make sure you have all of the options selected for the kernel that need to be (compiled into the kernel that is). Second, it talks about patching the kernel with iptables, not sure if the is needed but it caught my eye. Might need a kernel upgrade. Is the version of iptables you have the newest version? I don't really know a solution but trying to give possible areas to look at. I will be setting up iptables myslef soon and would like to see you get this resloved incase I run into a similar situation.

----------

## marks

When compiling the kernel, make sure you do not compile the ipchains and ipfwadm modules; they are just there for backwards compatibility. 

As I found out, even if you do not compile ipchains and ipfwadm directly into the kernel, they cause all sorts of frustrating errors when compiled as modules. When you omit them, you should be able to 'modprobe ip_tables'.

Mark Spanbroek

----------

## Mr_Chicken

I get the same errors, but taking out ipchains and ipfwadm didn't help. I'm using 2.4.19-gentoo-r7, but I believe the same thing happens with r9. Did this fix the problem for the original poster?

----------

## noise

i'm having the same error (used vanilla)

i did it like this but dont know if that does the same thing  :Smile: 

rc-update add iptables boot

and the boot sequence is bringing iptables up with no errors

well i'm new to this and trying to figure out how it's working.. i would like to see how this is gonna end for yall... 

please replay if u get it resolved...

----------

## securiteaze

What kernel compiling procedure are you using?  :Question: 

Try this (assuming you use grub)

```
mount /boot

cd /usr/src/linux

make mrproper

make menuconfig

make dep

make bzImage

make modules

make modules_install

cp arch/i386/boot/bzImage /boot/

cp System.map /boot/
```

If that doesn't work, what is the output of

```
lsmod
```

or

```
grep CONFIG_IP_NF /usr/src/linux/.config
```

----------

## mterlouw

I'm having the same problem. I found this but I think my System.map is fine. I'm going to try re-emerging vanilla-sources and start over.

Ok, the ip_tables will load now. I think the make mrproper command does the trick.

----------

## Velcro

Hmmm, kernel 2.4.19 seems a little old, I have linux 2.4.25-r3, istalled from "gentoo-sources". Have you updated your world recently?

If so have a look in /var/cache/edb/world and check that sys-kernel/gentoo-sources is in there so your kernel sources does get updated.

Hope this helps.

Cheers, Martin

----------

