netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using iptables CONNMARK target and match in filter table
@ 2011-02-09  2:22 Ratnaraj Mirgal
  0 siblings, 0 replies; only message in thread
From: Ratnaraj Mirgal @ 2011-02-09  2:22 UTC (permalink / raw)
  To: netfilter-devel

Hi all,

I'm trying use CONNMARK to bypass rules for established connections.
I'm using only filter table and also not using MARK, since iproute is
not used to mark the packet.

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:cmchain - [0:0]
:inbound - [0:0]
:outbound - [0:0]
-A INPUT -m connmark ! --mark 0x0 -j ACCEPT
-A INPUT -j inbound
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j cmchain
-A OUTPUT -m connmark ! --mark 0x0 -j ACCEPT
-A OUTPUT -j outbound
-A cmchain -j CONNMARK --set-xmark 0x1/0xffffffff
-A cmchain -j ACCEPT
COMMIT

as you can see, inbound chain contains incoming traffic rules, while
outbound chain contains outbound traffic rules.

i'm trying to bypass inbound rules with checking connection mark for
non-zero. This condition is under the assumption that
skb->nfct is getting populated in prerouting hook in kernel.
Similarly thing i'm doing to bypass outbound rules for established connection.

But this implementation is not working since inbound rules are still
getting traversed for a established connection.

seems like i'm missing some step.

Please help me understand where i'm going wrong.

TIA


-- 
Warm Regards,
Ratnaraj Mirgal
http://www.google.co.in/search?q=ratnaraj+mirgal
:-)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-09  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09  2:22 Using iptables CONNMARK target and match in filter table Ratnaraj Mirgal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).