From: Ratnaraj Mirgal <ratnaraj20@gmail.com>
To: netfilter-devel <netfilter-devel@vger.kernel.org>
Subject: Using iptables CONNMARK target and match in filter table
Date: Wed, 9 Feb 2011 07:52:42 +0530 [thread overview]
Message-ID: <AANLkTikSoTmnZ3JAS8Bb0WfuuVbA64T0Qj0UHuphxLiD@mail.gmail.com> (raw)
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
:-)
reply other threads:[~2011-02-09 2:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=AANLkTikSoTmnZ3JAS8Bb0WfuuVbA64T0Qj0UHuphxLiD@mail.gmail.com \
--to=ratnaraj20@gmail.com \
--cc=netfilter-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).