Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Lucas Diaz <lucasdiaz@eternet.cc>
Cc: netfilter@lists.netfilter.org
Subject: Re: Marks set in PREROUTING got lost
Date: Thu, 28 Sep 2006 09:17:01 -0300	[thread overview]
Message-ID: <451BBD3D.40305@eternet.cc> (raw)
In-Reply-To: <451B9794.9090209@gmx.de>

So, something marked with -j MARK can't be matched on nat table, right?
What if after you mark the packet with -j MARK, you do "-m mark --mark X 
-j CONNMARK --save-mark"; it should be visible from nat table or must be 
marked with -j CONNMARK --set-mark?


>> What marks, per-packet marks or per-connection marks?
>> 
>I am not sure, how to distinguish, I just mark all pakets that pass

-j MARK => per-packet
-j CONNMARK => per-connection

>through a certain user defined chain. I guess this is a mark per packet.
>The particular chain lookes like this:
>
>
>Chain FWD_WWW-101 (2 references)
>target     prot opt source               destination
>ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           quota:
>100000000 bytes
>MARK       all  --  0.0.0.0/0            0.0.0.0/0           MARK
>set 0x65
>ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           quota:
>1000000 bytes
>MARK       all  --  0.0.0.0/0            0.0.0.0/0           MARK
>set 0x1

MARK is only allowed in the mangle table.

>
>
>The goal is to provide full network speed for all NATed computers
>for a certain amount of bytes (first quota match), then mark their
>packets individually (each computer has its own mangle chain
>(FWD_WWW-$computernumber)) with its computernumber in hex, so tc can
>slow down their connection to 56k and after the "slow quota" is used
>up, the users packets get a different mark  (mark 1) and get a DNAT
>to an Over Quota webpage, when the user tries to access an outside
>webpage, other connectionattempts get droped.
>
>
>The problem is now, that pakets get marked with the mark 0x1, but in
>PREROUTING nat table, this mark never appears.

http://www.imagestream.com/~josh/PacketFlow.png

PREROUTING comes before FORWARD.

>
>Thanks, Clemens
>
>

Jan Engelhardt
-- 





  parent reply	other threads:[~2006-09-28 12:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-27 23:50 Marks set in PREROUTING got lost Clemens
2006-09-28  8:29 ` Jan Engelhardt
2006-09-28  9:36   ` Clemens
2006-09-28 10:55     ` Jan Engelhardt
2006-09-28 16:06       ` Clemens
2006-09-28 12:17     ` Lucas Diaz [this message]
2006-09-28 12:31       ` Jan Engelhardt
2006-09-28 16:05         ` Clemens
2006-09-29  6:15           ` Jan Engelhardt
     [not found]           ` <359510883.21717@mail.nankai.edu.cn>
     [not found]             ` <451E0EDF.2050901@mail.nankai.edu.cn>
2006-09-30  6:29               ` Bo Yang
     [not found] <359401435.12133@mail.nankai.edu.cn>
     [not found] ` <451CA4A8.5080402@mail.nankai.edu.cn>
2006-09-29  4:44   ` Bo Yang

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=451BBD3D.40305@eternet.cc \
    --to=lucasdiaz@eternet.cc \
    --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