From: "Ming-Ching Tiew" <mingching.tiew@redtone.com>
To: netfilter@lists.netfilter.org
Subject: skip other iptables marking if packet is already marked
Date: Mon, 31 May 2004 15:24:11 +0800 [thread overview]
Message-ID: <020701c446e0$44e95ee0$0100a8c0@newlife> (raw)
I have many iptables setmark commands, but as soon
as there is one match, I would like to skip all the rest.
How to do this.
-------not-working-not-mark-zero-is-not-accepted---------
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
iptables -t mangle -A PREROUTING -m MARK ! --mark 0 -j ACCEPT
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
iptables -t mangle -A PREROUTING -m MARK ! --mark 0 -j ACCEPT
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
--------------------end-----------------------------------
Since it is not working, I change it to :-
Assuming I have AND-ed all the mark together to obtain the MASK,
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
iptables -t mangle -A PREROUTING -m MARK ! --mark MASK/MARK -j ACCEPT
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
iptables -t mangle -A PREROUTING -m MARK ! --mark MASK/MARK -j ACCEPT
iptables -t mangle -A PREROUTING ..... -j MARK --set-mark .....
Wonder if it will work ?
My next question is should I use -j ACCEPT or -j RETURN ?
next reply other threads:[~2004-05-31 7:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-31 7:24 Ming-Ching Tiew [this message]
2004-05-31 8:16 ` skip other iptables marking if packet is already marked Cedric Blancher
2004-05-31 8:41 ` Ming-Ching Tiew
2004-05-31 9:36 ` Sheldon Hearn
2004-05-31 11:46 ` Cedric Blancher
2004-05-31 11:56 ` Sheldon Hearn
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='020701c446e0$44e95ee0$0100a8c0@newlife' \
--to=mingching.tiew@redtone.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox