Linux Netfilter discussions
 help / color / mirror / Atom feed
* skip other iptables marking if packet is already marked
@ 2004-05-31  7:24 Ming-Ching Tiew
  2004-05-31  8:16 ` Cedric Blancher
  0 siblings, 1 reply; 6+ messages in thread
From: Ming-Ching Tiew @ 2004-05-31  7:24 UTC (permalink / raw)
  To: netfilter

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 ?








^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-31 11:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-31  7:24 skip other iptables marking if packet is already marked Ming-Ching Tiew
2004-05-31  8:16 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox