Re: Linux IPChains Question
From: Devdas Bhagat (devdas_at_users.sourceforge.net)
Date: 10/12/03
- Previous message: luke lyons: "Re: Norton Firewall 2003"
- In reply to: Nicholas Suan: "Re: Linux IPChains Question"
- Next in thread: The Saint: "Re: Linux IPChains Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 12 Oct 2003 09:14:36 GMT
On Fri, 10 Oct 2003 07:24:18 +0000 (UTC), Nicholas Suan <nsuan@nonexiste.net>
poured into the usenet group comp.security.firewalls:
> "stewart menday" <stewart at webstorm.net.au> wrote in news:3f8619d6$0$95047$c30e37c6@lon-reader.news.telstra.net:
>
>> Hi All
>> I am trying to setup a bit of a firewall with Red Hat Linux 7 using
>> IPChains. I want to disable forwarding for everyone except machines
>> connected to my network (one win2000 machine), I have the following rules
>>
>> ipchains -P forward DENY
>> ipchains -A forward -s myipaddress -j ACCEPT
>>
>> but it doesn't seem to work, I cannot ping (or anything else) anything
>> outside my network, it all works fine if the default policy is ACCEPT.
>>
>> What am I doing wrong? Any help would be great.
>>
I suggest adding an explicit DENY and log rule at the end.
Your ruleset boils down to this:
#ipchains -P FORWARD DENY
ipchains -A FORWARD -s my.ip.add.ress -d 0.0.0.0/0 -j ACCEPT
ipchains -A FORWARD -j DENY
Since ipchains does not maintain state, your reverse traffic hits the DENY
rule and gets dropped.
I would recommend iptables here (makes life much simpler).
iptables -t filter -P FORWARD DROP
iptables -t filter -A FORWARD -s my.ip.add.ress -d 0.0.0.0/0 -j ACCEPT
iptables -t filter -A FORWARD -s 0.0.0.0/0 -d my.ip.add.ress -m state \
--state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -j LOG
iptables -t filter -A FORWARD -j DROP
> Reverse them.
He has a policy and a single rule. Nothing to reverse.
Devdas Bhagat
<snip>
- Previous message: luke lyons: "Re: Norton Firewall 2003"
- In reply to: Nicholas Suan: "Re: Linux IPChains Question"
- Next in thread: The Saint: "Re: Linux IPChains Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|