# 40.10 Paul 40.11 Mark tc class add dev imq0 parent 40:1 classid 40:10 htb rate 5Kbps ceil 7Kbps burst 2k tc class add dev imq0 parent 40:1 classid 40:11 htb rate 5Kbps ceil 6Kbps burst 3k # 40:12 Mike 40:13 Brian tc class add dev imq0 parent 40:1 classid 40:12 htb rate 200Kbps ceil 220Kbps burst 4k tc class add dev imq0 parent 40:1 classid 40:13 htb rate 200Kbps ceil 240Kbps burst 4k how do i show 40:1x is the ip w.x.y.z (and for the other ip's) ? Working off the prensentation.. Basically we have a 256Kb connection (yes small fry) ## We Start at the root of the device, eth0 # Install HTB as the root qdisc, names it 1:0. tc qdisc add dev eth0 root handle 1: htb # This attaches a shaping HTB to the HTB root, 256kps with a 2k bucket tc gdisc add dev eth0 parent 1: classid 1:1 htb rate 256Kbps burst 20k #The first class is guaranteed 5Kbps of the 256Kbps, but can grow to 7 if available #The second class however can take up to 240kbits (changed) # 1.10 Paul 1.11 Mark tc class add dev eth0 parent 1:1 classid 1:10 htb rate 5Kbps ceil 7Kbps burst 2k tc class add dev eth0 parent 1:1 classid 1:11 htb rate 5Kbps ceil 6Kbps burst 3k # 1:12 Mike 1:13 Brian tc class add dev eth0 parent 1:1 classid 1:12 htb rate 200Kbps ceil 220Kbs burst 4k tc class add dev eth0 parent 1:1 classid 1:13 htb rate 200Kbps ceil 240Kbs burst 4k ## Filtering to Classify traffic # When a packet enters the qdisc it needs to be classified. This is done with 'tc filters': U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32" $U32 match ip dport 25 0xffff flowid 1:10 $U32 match ip sport 80 0xffff flowid 1:11 ## Shape incoming Traffic (IMQ) modprobe imq numdevs=1 tc qdisc add dec imq0 root handle 40: htb default 22 tc class add dev imq0 parent 40: classid 40:1 htb rate 256Kbps burst 20k # 40.10 Paul 40.11 Mark tc class add dev imq0 parent 40:1 classid 40:10 htb rate 5Kbps ceil 7Kbps burst 2k tc class add dev imq0 parent 40:1 classid 40:11 htb rate 5Kbps ceil 6Kbps burst 3k # 40:12 Mike 40:13 Brian tc class add dev imq0 parent 40:1 classid 40:12 htb rate 200Kbps ceil 220Kbps burst 4k tc class add dev imq0 parent 40:1 classid 40:13 htb rate 200Kbps ceil 240Kbps burst 4k tc class add dev imq0 parent 40:10 classid 40:11 htb rate 240Kbps burst 4k iptables -t mangle -A PREROUTING -i eth0 -j IMQ # Push all Pauls traffic through IMQ iptables -t mangle -A PREROUTING -i eth0 -p tcp -d 10.0.0.9 -j IMQ --todev 0 ip link setup imq0 up am i close? :)
Attachment:
signature.asc
Description: This is a digitally signed message part