All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Question about marking traffic.
Date: Mon, 28 Jun 2004 17:31:40 +0100	[thread overview]
Message-ID: <200406281731.40331.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <1987903676.20040628181707@op.pl>

On Monday 28 June 2004 5:17 pm, mortar wrote:

> Hi
>
> I marked few types of traffic:
>
> $IPTABLES -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark
> $IPTABLES -t mangle -A PREROUTING -p tcp -m mark ! --mark 0 -j ACCEPT
>
> $IPTABLES -t mangle -A PREROUTING -p tcp -m ipp2p --ipp2p -j MARK
> --set-mark $P2P $IPTABLES -t mangle -A PREROUTING -p tcp --dport 21   -j
> MARK --set-mark $FTP $IPTABLES -t mangle -A PREROUTING -p tcp --dport 80  
> -j MARK --set-mark $WWW
>
> $IPTABLES -t mangle -A PREROUTING -p tcp -j CONNMARK --save-mark
>
>
> With rules below I can count traffic of this types:
>
>
> $IPTABLES -t mangle -A POSTROUTING -m mark --mark $P2P -j ACCEPT
> $IPTABLES -t mangle -A POSTROUTING -m mark --mark $FTP -j ACCEPT
> $IPTABLES -t mangle -A POSTROUTING -m mark --mark $WWW -j ACCEPT
>
>
> But I want count all other traffic, not marked with marks $P2P, $FTP,
> $WWW withe speparated rule. How can I do that?

I believe unMARKed packets are the same as packets with MARK = 0

Therefore "$IPTABLES -t mangle -A POSTROUTING -m mark --mark 0" should count 
the packets not marked with anything.

By the way, I suggest you remove the "-j ACCEPT" from the end of the lines in 
your mangle table - that table should not be used for filtering actions 
(that's what the filter table is for), and ACCEPT is a filtering action.

Rules without targets will still happily count packets for you.

Regards,

Antony.

-- 
Bill Gates has personally assured the Spanish Academy that he will never allow 
the upside-down question mark to disappear from Microsoft word-processing 
programs, which must be reassuring for millions of Spanish-speaking people, 
though just a piddling afterthought as far as he's concerned.

 - Lynne Truss, "Eats, Shoots and Leaves"

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-06-28 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-28 16:17 Question about marking traffic mortar
2004-06-28 16:31 ` Antony Stone [this message]
2004-06-28 20:50   ` Re[2]: " mortar
2004-06-28 21:04     ` Antony Stone
2004-06-29  9:29       ` Marco Colombo
2004-06-30 20:09         ` Antony Stone

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=200406281731.40331.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.