[LARTC] Troubles with tc/iptables - per TCP session tc

Antoniu-George SAVU santoniu at msn.com
Sun Jul 8 12:36:20 CEST 2007


Hello,
 
I have read most of the relevant emails already posted to the LARTC mailingilist and I have not found a solution to my problem.
 
What I am trying to do is: limit the HTTP output traffic to 30Mbps and also to limit each HTTP connection at 512Kbps, if the client downloads more than 1MB. I have managed to limit the total traffic but not the traffic of each HTTP connection.
 
Here it is my setup:
 
/sbin/tc qdisc add dev eth0 root handle 1:0 htb default 1/sbin/tc class add dev eth0 parent 1:0 classid 1:1 htb rate 100mbit/sbin/tc class add dev eth0 parent 1:1 classid 1:11 htb rate 512kbit ceil 512kbit/sbin/tc class add dev eth0 parent 1:1 classid 1:12 htb rate 30mbit  ceil 30mbit
/sbin/iptables --table mangle --append POSTROUTING --out-interface eth0 --protocol tcp --sport 80 -m connbytes --connbytes 1024000: --connbytes-dir reply --connbytes-mode bytes --jump CLASSIFY --set-class 1:11/sbin/iptables --table mangle --append POSTROUTING --out-interface eth0 --protocol tcp --sport 80 --jump CLASSIFY --set-class 1:12
 
I have tried, without success, to mark the matching packets with iptables and redirect a marked packet to class 1:11:
 
/sbin/iptables --table mangle --append POSTROUTING --out-interface eth0 --protocol tcp --sport 80 -m connbytes --connbytes 1024000: --connbytes-dir reply --connbytes-mode bytes --jump MARK --set-mark 11
/sbin/tc filter add dev eth0 parent 0: prio 0 protocol ip handle 11 fw classid 11
Any clue or ideas ? What I am doing wrong ? 
 
Thank you,
George
 
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ds9a.nl/pipermail/lartc/attachments/20070708/635e2bd5/attachment.htm


More information about the LARTC mailing list