From: "Michael H. Warfield" <mhw@wittsend.com>
To: Ray Leach <raymondl@knowledgefactory.co.za>
Cc: Netfilter Mailing List <netfilter@lists.netfilter.org>
Subject: Re: Best Practices for iptables
Date: Fri, 5 Dec 2003 10:40:12 -0500 [thread overview]
Message-ID: <20031205154012.GA23513@alcove.wittsend.com> (raw)
In-Reply-To: <1070633501.10348.10.camel@raylinux.internal>
[-- Attachment #1: Type: text/plain, Size: 2829 bytes --]
On Fri, Dec 05, 2003 at 04:11:42PM +0200, Ray Leach wrote:
> On Fri, 2003-12-05 at 16:01, Gabby James wrote:
> > Hi,
> > I want to allow everything on eth1 and be selective on eth0. What is the
> > best way of handling unwanted packets?
> > A) Change the policy of the chain to DROP then allow what I want. Example:
> > iptables -P INPUT DROP
> > iptables -A INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT
> > B) or leave the policy of the INPUT chain to ACCEPT but put REJECT rules at
> > the end. Example:
> > iptables -A INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT
> > iptables -A INPUT -p tcp -m tcp -j REJECT
> > iptables -A INPUT -p udp -m udp -j REJECT
> > iptables -A INPUT -p icmp -j DROP
> > This will give me the same outcome won't it?
> No, none of your rules reference the interface, e.g -i eth0
> So your rules allow/reject on all interfaces.
One HUGE difference between A and B is what's not seen in there
at all. Not all protocols are tcp, udp, or icmp. There's also things
like AH, ESP, SIT (aka IPv6), and GRE. All of these things would be
blocked by A and will pass straight through B unempeded. SIT, especially,
could be problematical since an attacker could simply set up and IPv6 over
IPv4 tunnel that will pass straight through your firewall and route
entire subnets out to the Internet. With 6to4 (6over4 using the 2002::/16
TLA) they don't even need static IPv6 configurations. If you let that
pass through, your IPv4 iptables won't even see tcp or udp in that
tunnel, all it will see is IPv4 protocol 41 (SIT/ipv6). Even if you have
iptables6 loaded, it wont see tcp or udp on IPv6, because it's IPv4
protocol 41 and not seen by the IPv6 iptables at all. So, either way,
that protocol has to be stopped or you may end up with IPv6 on your network
and never realize it or successfully filter it.
Always remember... There's more riding on the next layer up than
just tcp, udp, and icmp. A lot more. And what you don't know can come
back to bite you.
> > Thanks in advance!
> > _________________________________________________________________
> > Winterize your home with tips from MSN House & Home.
> > http://special.msn.com/home/warmhome.armx
> --
> --
> Raymond Leach <raymondl@knowledgefactory.co.za>
> Network Support Specialist
> http://www.knowledgefactory.co.za
> "lynx -source http://www.rchq.co.za/raymondl.asc | gpg --import"
> Key fingerprint = 7209 A695 9EE0 E971 A9AD 00EE 8757 EE47 F06F FB28
> --
Mike
--
Michael H. Warfield | (770) 985-6132 | mhw@WittsEnd.com
/\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!
[-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --]
next prev parent reply other threads:[~2003-12-05 15:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-05 14:01 Best Practices for iptables Gabby James
2003-12-05 14:11 ` Ray Leach
2003-12-05 15:40 ` Michael H. Warfield [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-12-05 14:28 Gabby James
2003-12-05 17:40 Daniel Chemko
2003-12-05 18:09 ` Antony Stone
2003-12-05 19:29 ` Ted Kaczmarek
2003-12-05 19:43 ` Michael Gale
2003-12-05 21:16 ` Ramin Dousti
2003-12-05 20:52 Gabby James
2003-12-05 20:54 Daniel Chemko
2003-12-05 21:33 ` Antony Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031205154012.GA23513@alcove.wittsend.com \
--to=mhw@wittsend.com \
--cc=netfilter@lists.netfilter.org \
--cc=raymondl@knowledgefactory.co.za \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox