Skip to contentSkip to conversation

Iptables connbytes

LARTC Todor Neshev 2 participants 2 messages Nov 3, 2003 – Nov 4, 2003

lore
Share & tools
lore
#1 lore raw
Quoted 6 lines · Todor Neshev

Hello,
Is it possible to mark packets from particular IP and if it downloads over 100Kbytes, then it enters in CBQ shaper 32kbit/s for example ? My kernel is 2.4.22.
If someone experimented with connection bytes patch please answer me.

I did, and I am running it since I saw it first anounced on the list, and works really smooth ( ymmv ).

I declare a download class and after that I mark the packets like this :
$i -t mangle -A PREROUTING -m connbytes --connbytes 307200: -j MARK

                                                        --set-mark 3

and then :

$tc filter add dev $dev parent 1:0 protocol ip prio 1 handle 3 fw

                                                        classid 1:30

this allows me to do dynamic shaping, shaping that keeps track of medium/large downloads and takes action when those are detected.

hope it helps.

Quoted 6 lines

Regards,
Todor Neshev

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

Signature · 9 lines
Cezar ATANASIU
GMB Computers
Departamentul Internet
Tel/fax: +40 241 619222/673199     


_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/