# Firewall woes.....

## kalldrexx

Trying to manipluate IPtables and IPchains seems broken... Why do I say this?  I'm following howto examples.  I emerged ipchains after I couldn't get iptables working.  Why not?

 *My lovely console wrote:*   

> 
> 
> bash-2.05a# iptables -A INPUT -s 127.0.0.1 -p icmp -j DROP
> 
> modprobe: Can't locate module ip_tables
> ...

 

hmm right... tha'ts odd figuring i got that code from a howto that's supposed to teach me how to use iptables.  So i emerge ipchains and ipchains-firewall.  I try some examples then:

 *my lovely console wrote:*   

> 
> 
> bash-2.05a# ipchains -A input -s 127.0.0.1 -p icmp -j DENY
> 
> ipchains: Protocol not available
> ...

 

uhhhhhhhhhh.  Well i'm assuming that's not supposed to happen.  I got those STRAIGHT out of hte firewall howto....

AS you cna see i'm having trouble wiht my firewall.. I htink i finally got ssh working however i aslo can't ifgure out how to make sshd start happen at boot...

--KallDrexx[/quote]

----------

## phaze3k

I'm assuming you've got a 2.4 kernel installed, so you don't want ipchains - unmerge it now.

Did you compile iptables support directly into the kernel?  It doesn't look like it..

If you compiled it as a module try doing (as root) 

```
modprobe iptables
```

 and then adding the rules.

If that still doesn't work, you'll need to go to /usr/src/linux, make menuconfig, select iptables as a module (and any other related iptables modules you want, eg NAT), then do a 

```
make modules; make modules_install
```

Once the module is installed do

```
depmod -a
```

(you only need to do this once), modprobe iptables and add your rules..

----------

## Target

Compiling the kernel with netfilter might help with getting iptables to work.

In menuconfig, don't forget to go down to the netfilter sub-menu that will appear a little bit down the list after you enable netfilter itself, and enable all the fun stuff you need.

----------

## KallDrexx

ok (at school) I remotley unmerged ipchains (I thought that was the newst... *shrug*).  Yes i have 2.4.19.  

The thing is i DON"T see an iptables option in menuconfig.  All I see is "Network packet filtering (replaces ipchains)" which i didn't select.  Any more specific options to get iptables working would be greatly appreciated... btw modprobe iptables didn't work.

--KallDrexx

----------

## dr_strange

ah, but you _should_ select it, and then a whole bunch of additional options appear

----------

## Target

Yes, that is netfilter/iptables.

It gives you a new submenu when you select it, but it's further down so you need to go hunt for it.

----------

## KallDrexx

ok I selected it before (when i posted the first message) issued the reboot command and well, Gentoo doesn't seem to want to do the final step to shut down or reboot (gives some return error, i'll get it and post it later) so i can't ssh into it now...

basically when I selected netfilter, only 1 more option came up, the netfilter debug...   :Confused: 

so.....

 :Question: 

--KallDrexx

EDIT: Also, I compiled it into the kernel.... Should I do it as a module instead?

----------

## Target

An extra netfilter submenu comes up, but for some reason it comes up way down the page. You have to go down there and go into it.

----------

## klieber

 *KallDrexx wrote:*   

> EDIT: Also, I compiled it into the kernel.... Should I do it as a module instead?

 

Shouldn't matter, but I've always compiled my firewall stuff into the kernel.

--kurt

----------

