Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Setting upload bandwidth limit for an user.
- # This user is only for the purpose of uploading stuff to YouTube.
- # The purpose of this is to not inhibit normal web browsing / watching YouTube videos
- # while another video is being uploaded.
- iptables -t mangle -F OUTPUT
- iptables -t mangle -A OUTPUT -p tcp -m owner --uid-owner yt_upload -j MARK --set-mark 10
- ip6tables -t mangle -F OUTPUT
- ip6tables -t mangle -A OUTPUT -p tcp -m owner --uid-owner yt_upload -j MARK --set-mark 10
- # Configuration: Set device interface name and bandwidth limit.
- i=br0
- s=400kbit
- tc qdisc del dev $i root
- tc qdisc replace dev $i root handle 1: htb default 30
- tc class replace dev $i parent 1: classid 1:1 htb rate $s burst 5k
- tc class replace dev $i parent 1:1 classid 1:10 htb rate $s ceil $s
- tc qdisc replace dev $i parent 1:10 handle 10: sfq perturb 10
- tc filter add dev $i parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
- tc filter add dev $i parent 1:0 prio 0 protocol ipv6 handle 10 fw flowid 1:10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement