Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Ming-Ching Tiew" <mingching.tiew@redtone.com>
To: netfilter@lists.netfilter.org
Subject: Re: skip other iptables marking if packet is already marked
Date: Mon, 31 May 2004 16:41:04 +0800	[thread overview]
Message-ID: <029101c446eb$024bfdd0$0100a8c0@newlife> (raw)
In-Reply-To: 1085991395.26732.12.camel@anduril.intranet.cartel-securite.net


> 
> Why don't you just match the mark the packet has been given ?
> 
> iptables -t mangle -A PREROUTING ..... -j MARK --set-mark 1
> iptables -t mangle -A PREROUTING -m MARK --mark 1 -j ACCEPT
> iptables -t mangle -A PREROUTING ..... -j MARK --set-mark 2
> iptables -t mangle -A PREROUTING -m MARK --mark 2 -j ACCEPT

Understand, but what if I have something on top :-

iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark

I don't know what is the mark value, but i want to return as soon as the 
mark has been restored.

> 
> I think your ruleset does not work because a packet without a mark will
> match your non-zero mark rule. I mean that no mark is different than 0,
> so all packets will match the first "-m mark ! --mark 0" rule.
> 

No, it does not work because the syntax is rejected ! I tried with
"-m mark --mark ! 0" ,  it is alway rejected.

> 
> > My next question is should I use -j ACCEPT or -j RETURN ?
> 
> RETURN should not be use within builtin chains. Moreover, both have the
> same effect if used in builtin chain.
> 

Point taken.

Thanks.







  reply	other threads:[~2004-05-31  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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='029101c446eb$024bfdd0$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