Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Ray Leach <raymondl@knowledgefactory.co.za>
To: Netfilter Mailing List <netfilter@lists.netfilter.org>
Subject: Re: Best Practices for iptables
Date: Fri, 05 Dec 2003 16:11:42 +0200	[thread overview]
Message-ID: <1070633501.10348.10.camel@raylinux.internal> (raw)
In-Reply-To: <BAY10-F59WC6BgBxfpG0000cde9@hotmail.com>

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

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.

> 
> 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
--

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2003-12-05 14:11 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 [this message]
2003-12-05 15:40   ` Michael H. Warfield
  -- 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=1070633501.10348.10.camel@raylinux.internal \
    --to=raymondl@knowledgefactory.co.za \
    --cc=netfilter@lists.netfilter.org \
    /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