traffic shaping for certain (local) users

Posted by JMW on Server Fault See other posts from Server Fault or by JMW
Published on 2011-01-14T16:54:42Z Indexed on 2011/01/14 17:55 UTC
Read the original article Hit count: 356

Hello,

i'm using ubuntu 10.10

i've a local backup user called "backup". :)

i would like to give this user just a bandwidth of 1Mbit. No matter which software wants to connect to the network.

this solution doesn't work:

iptables -t mangle -A OUTPUT -p tcp -m owner --uid-owner 1001 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -p tcp -m owner --uid-owner 1001 -j MARK --set-mark 12

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 2 htb default 1
tc filter add dev eth0 parent 2: protocol ip pref 2 handle 50 fw classid 2:6
tc class add dev eth0 parent 2: classid 2:6 htb rate 10Kbit ceil 1Mbit

tc qdisc show dev eth0
tc class show dev eth0
tc filter show dev eth0

does anyone know how to do it?

thanks a lot in advance

© Server Fault or respective owner

Related posts about iptables

Related posts about traffic