Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't get iptables working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
baldeagle
n00b
n00b


Joined: 12 Aug 2003
Posts: 5
Location: Richardson, Texas

PostPosted: Sat Aug 16, 2003 1:29 pm    Post subject: Can't get iptables working Reply with quote

I need help. No matter what I do, I cannot get iptables to work. I get the following error message:

# iptables -L
modprobe: Can't locate module ip_tables
iptables v1.2.8: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

This is my first time installing Gentoo, but I've done Solaris, FreeBSD, OpenBSD and several different flavors of Linux (RedHat, Debian, Slackware, Caldera, etc.) I'm not a novice, but I'm not a master either.

Some stuff from dmesg:
Linux version 2.4.20-gentoo-r5 (root@cdimage) (gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)) #1 SMP Fri Jul 18 07:32:50 CDT 2003
Detected 299.957 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 596.37 BogoMIPS
Memory: 188312k/196608k available (2368k kernel code, 6372k reserved, -2896k data, 160k init, 0k highmem)

/etc/make.conf:
grep -v "#" /etc/make.conf

USE="gnome gtk -kde -qt crypt cups pam ssl tcpd opengl X"

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=i686 -O3 -pipe"

CXXFLAGS="${CFLAGS}"

PORTAGE_TMPDIR=/var/tmp
PORTDIR=/usr/portage
DISTDIR=${PORTDIR}/distfiles
PKGDIR=${PORTDIR}/packages

Things I've done:
read the install doc carefully and repeatedly
read the security doc carefully and repeatedly

emerged both iptables and gentoo-sources numerous times (just did both again last night)

compiled using genkernel --config

compiled using the "manual" method:
make oldconfig
make mrproper
make dep
etc.

# depmod -a returns tons of these errors:
depmod: *** Unresolved symbols in /lib/modules/2.4.20-gentoo-r5/kernel/net/sunrpc/sunrpc.o

# slocate ip_tables.o doesn't return anything. (slocate on any of the expected object files returns their location. I've also rebuilt the db several times - slocate -u)

The system runs fine, has no stability problems, networking works perfectly, every app I've installed works fine *except* iptables.

I can't help but think that I'm missing some ridiculously simply step somewhere, but I'm at a loss to know what it is. Any pointers in the right direction would be gratefully appreciated.
_________________
Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Sat Aug 16, 2003 2:18 pm    Post subject: Reply with quote

The simplest problem would be if you didn't have the right kernel options selected. I was stumped when I first tried to find the iptables stuff. So even though you probably already know this, the kernel configuration can be found at http://projectfiles.com/firewall/install.html :
Code:
Base configuration
CONFIG_NETFILTER
 Networking options -> Network packet filtering

CONFIG_IP_NF_CONNTRACK   (Required, even if you aren't doing NAT, since the script performs stateful inspection.)
 Networking options -> IP: Netfilter Configuration -> Connection tracking (required for masq/NAT)

CONFIG_IP_NF_IPTABLES
 Networking options -> IP: Netfilter Configuration -> IP tables support (required for filtering/masq/NAT)

CONFIG_IP_NF_MATCH_STATE   (This script is virtually entirely based upon the state matching module of netfilter.)
 Networking options -> IP: Netfilter Configuration -> Connection state match support

CONFIG_IP_NF_FILTER
 Networking options -> IP: Netfilter Configuration -> Packet Filtering

CONFIG_IP_NF_TARGET_REJECT   ('graceful' reject target)
 Networking options -> IP: Netfilter Configuration -> REJECT target support
Required only if you are doing NAT or port forwarding:

CONFIG_IP_NF_NAT
 Networking options -> IP: Netfilter Configuration -> Full NAT

CONFIG_IP_NF_FTP   (Since FTP uses two ports, one for control and one for data, connection tracking requires special helpers provided by this kernel option.)
 Networking options -> IP: Netfilter Configuration -> FTP protocol support

CONFIG_IP_NF_IRC   (Allows IRC clients to initiate DCC chats and file transfers through a linux firewall.)
 Networking options -> IP: Netfilter Configuration -> IRC protocol support
Required only if you have dynamic (dial-up) interfaces:

CONFIG_IP_NF_TARGET_MASQUERADE
 Networking options -> IP: Netfilter Configuration -> MASQUERADE target support
Required only if you enable logging:

CONFIG_IP_NF_TARGET_LOG
 Networking options -> IP: Netfilter Configuration -> LOG target support

CONFIG_IP_NF_MATCH_LIMIT
 Networking options -> IP: Netfilter Configuration -> limit match support
Required only if you are doing port forwarding:

CONFIG_IP_NF_MATCH_MARK
 Networking options -> IP: Netfilter Configuration -> netfilter MARK match support

CONFIG_IP_NF_MANGLE
 Networking options -> IP: Netfilter Configuration -> Packet mangling

CONFIG_IP_NF_TARGET_MARK
 Networking options -> IP: Netfilter Configuration -> MARK target support
Required only if you are using TTL stealth router mode: (NOTE: This usually requires a custom patched kernel)

CONFIG_IP_NF_TARGET_TTL (Not to be confused with CONFIG_IP_NF_MATCH_TTL aka "TTL match support"!!!)
 Networking options -> IP: Netfilter Configuration -> TTL target support
Back to top
View user's profile Send private message
baldeagle
n00b
n00b


Joined: 12 Aug 2003
Posts: 5
Location: Richardson, Texas

PostPosted: Sat Aug 16, 2003 5:26 pm    Post subject: Reply with quote

BitJam wrote:
The simplest problem would be if you didn't have the right kernel options selected. I was stumped when I first tried to find the iptables stuff. So even though you probably already know this, the kernel configuration can be found at http://projectfiles.com/firewall/install.html :


Hmm...this is pretty weird. I've been using menuconfig to do the kernel config options, yet I just looked in there and found this:
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
CONFIG_INET=y

I made *sure* that I had selected this stuff, yet it's commented out. Guess I'll just config manually.

Thanks for pointing me in the right direction.
_________________
Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/
Back to top
View user's profile Send private message
siti
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2003
Posts: 118
Location: Canterbury, New Zealand

PostPosted: Sat Aug 16, 2003 7:40 pm    Post subject: Reply with quote

Try a kernel other than gentoo sources such as vanilla-sources.
Back to top
View user's profile Send private message
baldeagle
n00b
n00b


Joined: 12 Aug 2003
Posts: 5
Location: Richardson, Texas

PostPosted: Sat Aug 16, 2003 11:05 pm    Post subject: Reply with quote

siti wrote:
Try a kernel other than gentoo sources such as vanilla-sources.


Wouldn't that be rather like admitting failure? I'm rather more inclined to determine the cause of the problem so that I can solve it quickly if I encounter it again.

I'm compiling the kernel now, after using "make menuconfig" rather than "genkernel --config". I'll let you know what the results are when it's done. If this fails, I will be manually creating a kernel-config file to use for compiling.

I'm certain that the problem is that iptables is not configured in the kernel. What I don't know yet is why I can select netfilter in menuconfig and yet the config file still has it commented out afterwards.
_________________
Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/
Back to top
View user's profile Send private message
vidigiani
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2003
Posts: 116
Location: Houston, TX

PostPosted: Sat Aug 16, 2003 11:14 pm    Post subject: Reply with quote

I had some trouble with iptables earlier today. I found info at this link useful: http://shorewall.sourceforge.net/kernel.html... Now I am still having troubles with Shorewall (going to more closely match the kernel settings outline), but atleast iptables is working.
Back to top
View user's profile Send private message
sschlueter
Guru
Guru


Joined: 26 Jul 2002
Posts: 578
Location: Dortmund, Germany

PostPosted: Sun Aug 17, 2003 12:06 am    Post subject: Re: Can't get iptables working Reply with quote

baldeagle wrote:

compiled using the "manual" method:
make oldconfig
make mrproper
make dep
etc.


Just in case that this is the exact order in which you issued these commands: This is not what you want. Your kernel config will be lost after "make mrproper". You have to save your .config file before and restore it after this command.
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Sun Aug 17, 2003 12:26 am    Post subject: Reply with quote

I saw that you used 'genkernel' ...

genkernel doesn't add the appropriate modules needed for iptables (netfilter). You'll need to modify your kernel config after executing genkernel or roll your own kernel by hand.
_________________
http://get.a.clue.de
Back to top
View user's profile Send private message
Xiol
Apprentice
Apprentice


Joined: 24 Jul 2003
Posts: 209
Location: UK

PostPosted: Sun Aug 17, 2003 2:04 am    Post subject: Reply with quote

I had this problem, turning off module versioning in the kernel seemed to fix it. (Also fixed my ALSA problem at the same time...)

Edit: Also re-emerge iptables.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum