Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- user=debian-transmission
- rate=200kbit
- mark=128
- dev=$(ip r |awk '/^default/{print$5}')
- iptables -F
- tc qdisc del dev $dev root 2>/dev/null
- [ "$1" = stop ] && exit 0
- iptables -A OUTPUT -m owner --uid-owner $user -j MARK --set-mark $mark
- tc qdisc add dev $dev root handle 1:0 htb default 1
- tc class add dev $dev parent 1:0 classid 1:10 htb rate $rate burst 5kb prio 0
- tc filter add dev $dev parent 1:0 prio 0 handle $mark fw flowid 1:10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement