wiki:ShapingNotes
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "hg": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.

Shaping with HTB

In this example you shape the outgoing traffic of eth0 to 1Mbit/s

tc qdisc add dev eth0 root handle 1: htb default 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 1Mbit ceil 1Mbit
tc qdisc add dev eth0 parent 1:1 handle 2: pfifo limit 10 

In this example you shape the outgoing traffic of IFACE to 1Mbit/s prioritizing OLSR traffic on port 698

IFACE=tap0
tc qdisc add dev $IFACE root handle 1: htb default 1
tc class add dev $IFACE parent 1: classid 1:1 htb rate 1Mbit ceil 1Mbit
tc qdisc add dev $IFACE parent 1:1 handle 2: prio bands 3
tc filter add dev $IFACE parent 2: protocol ip prio 1 u32 match ip dport 698 0xffff flowid 2:1
tc filter add dev $IFACE parent 2: protocol 0x0003 prio 2 u32 match u8 0x0 0x0 flowid 2:2

Troubleshooting

Check /proc/sys/net/ipv4/tcp_wmem

good values are 4096 16384 65536

Read the HTB FAQ: http://luxik.cdi.cz/~devik/qos/htb/htbfaq.htm

Last modified 7 years ago Last modified on Nov 18, 2010, 2:50:07 PM