All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martijn Lievaart <m@rtij.nl>
To: amna bilal <bilal.amna@yahoo.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Filtering Query?
Date: Mon, 30 Jul 2007 22:05:07 +0200	[thread overview]
Message-ID: <46AE4473.8060500@rtij.nl> (raw)
In-Reply-To: <358385.10946.qm@web57412.mail.re1.yahoo.com>

amna bilal wrote:
> Hi,
>
> Looking for some insight here. What I would like to do
> is:
>
> I have four main tables
> INTERNET_IN
> INTERNET_OUT
> LAN_IN
> LAN_OUT
>
> I have a few filters I want I named them
> ALLOW_UDP
> ALLOW_TCP
> DENY_ACCESS
>
> Is it possible to set up iptables to filter down a
> list some thing like this:
>
> iptables -A INTERNET_IN -j ALLOW_UDP
> iptables -A INTERNET_IN -j ALLOW_TCP
> iptables -A INTERNET_IN -j DENY_ACCESS
>
> What I want to accomplish is that if it doesn't meet a
> filter in ALLOW_UDP it continues to ALLOW_TCP, then to
> DENY_ACCESS, the it goes into the system.
>   

Yes, absolutely. And with these very clear chain names, it is easy to 
follow the logic as well.

OTOH, You could also opt for:

-A INTERNET_IN -p udp -j UDP_IN
-A INTERNET_IN -p tcp -j TCP_IN

-A INTERNET_IN -j DENY_ACCESS

And end both UDP_IN and TCP_IN with a -j DENY_ACCESS.


Both work, the second is a bit more efficient.

HTH,
M4





      reply	other threads:[~2007-07-30 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 10:06 Filtering Query? amna bilal
2007-07-30 20:05 ` Martijn Lievaart [this message]

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=46AE4473.8060500@rtij.nl \
    --to=m@rtij.nl \
    --cc=bilal.amna@yahoo.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.