All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boryan Yotov <yotov@prosyst.com>
To: netfilter@lists.netfilter.org
Subject: Re: iptables rule chain question
Date: Thu, 09 Feb 2006 15:17:08 +0100	[thread overview]
Message-ID: <43EB4EE4.7010004@prosyst.com> (raw)
In-Reply-To: <20060209131739.GA4441@server.homelinux.net>

Mark-Walter@t-online.de wrote:
> Hi,
> 
> I've have this in my firewall rule script and I'am unsure about DROP:
> 
> #
> # allowed chain
> #
> 
> $IPTABLES -A allowed -p TCP --syn -j ACCEPT
> $IPTABLES -A allowed -p TCP -m state --state ESTABLISHED,RELATED -j
> ACCEPT
> $IPTABLES -A allowed -p TCP -j DROP
> 
> The first should allow tcp connections with syn,rst,ack and he should
> accept it.
> 
> The second one describes already established connections with ACCEPT.
> 
> But what happens in the third rule ?
> 
> Does it mean iptables DROP every TCP connection in the case syn,rst,ack is not set and the connection is not established.

Yes and no. Yes, it will drop the rest of the tcp packets going
through this chain ONLY. And no, because this is a user defined
chain. Since it is a user defined, then one of the native chains
filter INPUT, filter OUTPUT, etc. should have an exisiting rule,
which sends SOME packets through it.

Somewhere in your script you have a rule like this, but not
necessary exactly the same:

iptables -A INPUT -p tcp -s <one_ip> -d <second_ip> -j allowed

In the example above only packets which match the source and
destination IP's will be sent to the "allowed" chain. All other
TCP packets will continue to travel the INPUT chain and will
never have the opportunity to hit the 3rd rule of the "allowed"
chain.


> 
> Does iptables storing all connection's with connection tracking to know
> which connection is established,related ? (2. rule)

Yes, iptables keeps track of the connections statuses.
Check the content of /proc/net/ip_conntrack

> 
> Sorry, for these questions but I think it's fast answer for you.
> 
> 



  parent reply	other threads:[~2006-02-09 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-09 13:17 iptables rule chain question Mark-Walter
2006-02-09 14:13 ` Rob Sterenborg
2006-02-09 18:21   ` Mark-Walter
2006-02-09 14:17 ` Boryan Yotov [this message]
2006-02-09 18:42   ` Mark-Walter
2006-02-10  1:47     ` ludi

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=43EB4EE4.7010004@prosyst.com \
    --to=yotov@prosyst.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.