|
|
|
Re: tc htb question regarding sharing bandwidth [message #47965 is a reply to message #47874] |
Thu, 20 September 2012 13:54 |
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
|
|
|