Re: ipchains question
From: Brad Olin (bwo_at_bwo1.com)
Date: 05/07/04
- Next message: HooK: "attack on server from LAN"
- Previous message: V: "Re: Dlink 302g with Linux IPCop firewall"
- In reply to: PapaBear: "ipchains question"
- Next in thread: Gary Petersen: "Re: ipchains question"
- Reply:(deleted message) Gary Petersen: "Re: ipchains question"
- Reply:(deleted message) Fool: "Re: ipchains question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 07 May 2004 14:49:31 GMT
On Fri, 7 May 2004 15:36:02 +0200, PapaBear <Papabeer@No-SP_aM.nl>
wrote:
>LS.
>
>I'm working on an ipchains firewall on a litlle old Redhat 7.0 server.
>
>After flushing all rules, I start out making standard strategies as
>follows:
>
># ### Standard strategy is DENY ###
>ipchains -P input DENY # No answer for invalid incoming
>ipchains -P output REJECT # Error for invalid outgoing
>ipchains -P forward REJECT # Error for invalid forwarding
>
>Now the book I'm using suggests to put all kinds of rules in the file to
>deny access from for example class A, B and C networks.
>
I'm not certain what book your referencing, but there are reserved IP
addresses that are clearly invalid on the open Internet. These may be
used on the inside of your network, but they are never valid on the
Internet side.
So lets say you want to allow port 80, but you wouldn't want to open
port 80 to an invalid address. To resolve this issue you would have
rules, like the below set, to drop those reserved addresses before you
accept whatever ports you wanted open.
/sbin/iptables -A INPUT -i eth0 -s 127.0.0.0/8 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 192.168.0.0/16 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 172.16.0.0/12 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 10.0.0.0/8 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 169.254.0.0/16 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 224.0.0.0/4 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 240.0.0.0/5 -j DROP
Do you really need these rules? `iptables -vnL` on my boxes shows some
counts on these rules from time to time, so yes.
>Why is this? (since the standard strategy is to DENY or REJECT)
>
My default policy is DROP
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT DROP
/sbin/iptables -P FORWARD DROP
The policy is used only if all rules are exhausted, so I only have to
open ports I want. With a policy of REJECT you allow hackers to finger
print 100% of your system. Not something I would recommend.
>imho I can just ACCEPT only those packages I would want and discard the
>others, since they would be denied or rejected, am I right?
>
Basically, but use policy DROP instead.
Brad
-- "Nearly all men can stand adversity, but if you want to test a man's character, give him power." Abraham Lincoln Bradley W. Olin http://www.bwo1.com
- Next message: HooK: "attack on server from LAN"
- Previous message: V: "Re: Dlink 302g with Linux IPCop firewall"
- In reply to: PapaBear: "ipchains question"
- Next in thread: Gary Petersen: "Re: ipchains question"
- Reply:(deleted message) Gary Petersen: "Re: ipchains question"
- Reply:(deleted message) Fool: "Re: ipchains question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|