# iptables getsockopt failed strangely: No such file or..

## klausjulius

hi together,

i installed iptables on a root server with kernel 2.6 (gentoo-sources). 

after installing iptables i always get the error message "getsockopt failed strangely: No such file or directory" when i

try to start it. i put the the rules in /var/lib/iptables/rules-save which i took from another root server which is running very well. i changed the ip adresses in tis rules-save. i compiled the modules for using iptables in the kernel.

does anyone had the same problem and solved it?

hoping for help

klaus

----------

## klausjulius

my kernel net config

 *Quote:*   

> #
> 
> # Networking
> 
> #
> ...

 

----------

## magic919

Could you post the firewall config you are trying to use.  It's the only way to check kernel config supports it.

And maybe just have the one thread at a time, please.

----------

## thoughtform

xxxLast edited by thoughtform on Sun Dec 31, 2006 12:37 pm; edited 1 time in total

----------

## newtonian

Try setting multi port match support on in the kernel

<*>   Multiple port match support

```

Location:                                                                                          

     -> Networking                                                                                    

       -> Networking support (NET [=y])                                                                

         -> Networking options                                                                         

           -> Network packet filtering (replaces ipchains) (NETFILTER [=y])                            

             -> Core Netfilter Configuration                                                          

               -> Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES [=y])     
```

Cheers,

----------

## pandrews

I'm trying to get iptables working, and I keep finding instructions like yours, but I am unable to locate anything below:

[*] Network packet filtering (relpaces ipchains) --->

When I select it, nothing seems to showup to select "Core..." and "Netfilter Xtables..." as your instructions show.

I'm using kernel-2.6.18-gentoo-r3.

Just a fun sidenote, here's what I get when I grep my .config:

```
$ grep table -i /usr/src/linux/.config

# Executable file formats

# CONFIG_NETFILTER_XTABLES is not set

```

Paul

----------

## newtonian

 *pandrews wrote:*   

> I'm trying to get iptables working, and I keep finding instructions like yours, but I am unable to locate anything below:
> 
> [*] Network packet filtering (relpaces ipchains) --->
> 
> When I select it, nothing seems to showup to select "Core..." and "Netfilter Xtables..." as your instructions show.
> ...

 

with the arrow keys move the blue selection bar down to:

Network packet filtering (replaces ipchains)  --->

Press the enter key

A new page will open up.  It took me a couple times to figure it out too.

Cheers,

----------

## pandrews

 *newtonian wrote:*   

> 
> 
> Press the enter key
> 
> 

 

Well, don't I feel silly.  I always hit the [space] key for selecting stuff and all that did on this option was to select the [*] next to it.  That just seems like a dirty trick doesn't it?

Thanks,

----------

## pandrews

Incase anyone reading this was folowing along with HOWTO Iptables for newbies and came up with an error like such:

```
# iptables-restore /etc/iptables.bak

Applying iptables firewall rules: iptables-restore: line 23 failed

[FAILED]
```

You can then try to input your rules by hand to see which ones fail.  I had lines such as:

```
# accept all from localhost

# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables: No chain/target/match by that name

# reject everything else

# iptables -A INPUT -j REJECT --reject-with icmp-port-unreachable

iptables: No chain/target/match by that name
```

These appear to correlate to the following options in the kernel:

```
CONFIG_IP_NF_CONNTRACK=y

CONFIG_IP_NF_TARGET_REJECT=y
```

Once those were fixed, the command 

```
# iptables-restore /etc/iptables.bak
```

worked without any problems.

Hope that helps someone.

Paul

----------

