* how to set mark using host bits ?
@ 2007-03-05 19:53 Mircea Croitor
2007-03-06 7:54 ` Alexandru Dragoi
0 siblings, 1 reply; 2+ messages in thread
From: Mircea Croitor @ 2007-03-05 19:53 UTC (permalink / raw)
To: netfilter
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: how to set mark using host bits ?
2007-03-05 19:53 how to set mark using host bits ? Mircea Croitor
@ 2007-03-06 7:54 ` Alexandru Dragoi
0 siblings, 0 replies; 2+ messages in thread
From: Alexandru Dragoi @ 2007-03-06 7:54 UTC (permalink / raw)
To: Mircea Croitor; +Cc: netfilter
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-06 7:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 19:53 how to set mark using host bits ? Mircea Croitor
2007-03-06 7:54 ` Alexandru Dragoi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox