OpenVZ Forum


Home » General » Support » tc htb question regarding sharing bandwidth (How do I limit each connection while using the total uplink?)
Re: tc htb question regarding sharing bandwidth [message #47965 is a reply to message #47874] Thu, 20 September 2012 13:54 Go to previous message
dr4g0nl0rd is currently offline  dr4g0nl0rd
Messages: 17
Registered: May 2008
Junior Member
Limit to 10Mbit in / out

WANDEV="eth0"
LANDEV="venet0"
TC="/sbin/tc"
IPTABLES="/sbin/iptables"

$TC qdisc add dev $WANDEV root handle 1: cbq avpkt 1000 bandwidth 1000mbit
$TC class add dev $WANDEV parent 1: classid 1:1 cbq rate 10mbit allot 1500 prio 1 bounded isolated
$TC qdisc add dev $WANDEV parent 1:1 sfq perturb 10

$TC qdisc add dev $LANDEV root handle 1: cbq avpkt 1000 bandwidth 1000mbit
$TC class add dev $LANDEV parent 1: classid 1:1 cbq rate 10mbit allot 1500 prio 1 bounded isolated
$TC qdisc add dev $LANDEV parent 1:1 sfq perturb 10

$IPTABLES -t mangle -I POSTROUTING -o eth0 -s x.x.x.x -j CLASSIFY --set-class 1:1
$IPTABLES -t mangle -I POSTROUTING -o venet0 -d y.y.y.y -j CLASSIFY --set-class 1:1

replace x.x.x.x and y.y.y.y with CTID IP Adress
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Previous Topic: Vzdump exclude path
Next Topic: SERVER CRASH WITH RHEL6 2.6.32-042stab061.2
Goto Forum:
  


Current Time: Tue Aug 05 00:17:31 GMT 2025

Total time taken to generate the page: 1.75348 seconds