Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Alexandru Dragoi <alex@zoomnet.ro>
To: Mircea Croitor <mcroitor@yahoo.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: how to set mark using host bits ?
Date: Tue, 06 Mar 2007 09:54:22 +0200	[thread overview]
Message-ID: <45ED1E2E.5020303@zoomnet.ro> (raw)
In-Reply-To: <loom.20070305T203202-917@post.gmane.org>

Mircea Croitor wrote:
> Hello,
>
> I want to know if there is an extension for iptables which allows automating
> setting of mark in the mangle table, using last n bits of source ip, with an
> optional offset, to do something like :
>
> (the network is 192.168.0.0/20, offset 0x100)
>
> 192.168.0.0 will have mark 0x100
> 192.168.0.1 will have mark 0x101
> ...
> 192.168.2.0 will have mark 0x300
> ...
> 192.168.15.255 will have mark 0x10FF
>
> This setting of mark should be done on a single rule, since the mark is computed
> from host bits and offset.
> It is useful for efficient upload limiting, when SNAT is used, since the source
> IP is replaced before tc filters see the packet, but I'm sure you knew that. By
> the way, this kind of auto matching is possible on tc filters, using "hashed
> filters".
>
>
>
>   
There was a target called IPMARK for doing that in pach-o-matic-ng. Try 
using older snapshots, or maybe new kernels already include it.


      reply	other threads:[~2007-03-06  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05 19:53 how to set mark using host bits ? Mircea Croitor
2007-03-06  7:54 ` Alexandru Dragoi [this message]

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=45ED1E2E.5020303@zoomnet.ro \
    --to=alex@zoomnet.ro \
    --cc=mcroitor@yahoo.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