herz the script that i have done.
Hello there,
Having made quite a lot of expensive mistakes i have finally clobbered
together a script for the users on my network.
Have a look at it and please suggest as to how can i limit bandwidth to
each ip on this network to about 64Kbits.
Trevor
Signature · 5 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/
#!/bin/bash
#####################################
#Deleting and setting up
#Root qdisc's
#####################################
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 1Mbit avpkt 1000 cell 8
#######################################
#Setting up top 2 qdiscs
#for initial packet classification
#######################################
# Exatt Rules
#######################################
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 1Mbit rate 800kbit weight 80kbit allot 1514 cell 8 maxburst 20 avpkt 1000 isolated tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.10.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.11.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.12.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.13.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.14.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.15.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.16.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.17.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.18.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.19.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:1
##########################################
#Paradyne Rules
##########################################
tc class add dev eth0 parent 1:0 classid 1:2 cbq bandwidth 1Mbit rate 200kbit weight 20kbit allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.20.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.21.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.22.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.23.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.24.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.25.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.26.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.27.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.28.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.29.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:2
#######################################
#Setting up top 10 qdiscs
#for initial Exatt packet classification
#######################################
tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.10.0/24 classid 1:3
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:3
tc class add dev eth0 parent 1:1 classid 1:4 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.11.0/24 classid 1:4
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:4
tc class add dev eth0 parent 1:1 classid 1:5 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.12.0/24 classid 1:5
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:5
tc class add dev eth0 parent 1:1 classid 1:6 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.13.0/24 classid 1:6
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:6
tc class add dev eth0 parent 1:1 classid 1:7 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.14.0/24 classid 1:7
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:7
tc class add dev eth0 parent 1:1 classid 1:8 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.15.0/24 classid 1:8
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:8
tc class add dev eth0 parent 1:1 classid 1:9 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.16.0/24 classid 1:9
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:9
tc class add dev eth0 parent 1:1 classid 1:10 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.17.0/24 classid 1:10
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:10
tc class add dev eth0 parent 1:1 classid 1:11 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.18.0/24 classid 1:11
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:11
tc class add dev eth0 parent 1:1 classid 1:12 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.19.0/24 classid 1:12
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:12
######################################
#Setting up top 10 qdiscs
#for initial Paradyne packet classification
#######################################
tc class add dev eth0 parent 1:2 classid 1:13 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.20.0/24 classid 1:13
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:13
tc class add dev eth0 parent 1:2 classid 1:14 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.21.0/24 classid 1:14
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:14
tc class add dev eth0 parent 1:2 classid 1:15 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.22.0/24 classid 1:15
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:15
tc class add dev eth0 parent 1:2 classid 1:16 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.23.0/24 classid 1:16
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:16
tc class add dev eth0 parent 1:2 classid 1:17 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.24.0/24 classid 1:17
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:17
tc class add dev eth0 parent 1:2 classid 1:18 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.25.0/24 classid 1:18
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:18
tc class add dev eth0 parent 1:2 classid 1:19 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.26.0/24 classid 1:19
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:19
tc class add dev eth0 parent 1:2 classid 1:20 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.27.0/24 classid 1:20
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:20
tc class add dev eth0 parent 1:2 classid 1:21 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.28.0/24 classid 1:21
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:21
tc class add dev eth0 parent 1:2 classid 1:22 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.29.0/24 classid 1:22
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:22
#################################
# Start of Actual Filters
#################################
Stef....;)
Hats off to you. I am zapped as to how did you figure out the
"isolated" class wasn't working???.
Anyway Stef, i am glad that you have detected something without my
telling you. Have changed the same and have restarted the server. Lets see. Its night time here in Bombay, hence am playing around with the production machine.
Stef, I need to traffic shape for my 1000 odd users on the network. Is
there a way to do it by having static qdisc's /classes/filters inserted.
Also, can i do them on the fly by having them login cia a SUID ROOT ph
page and then get web access and thus adding/deleting these qdisc's /classes/filters on the fly???.
Trevor
Quoted 15 lines · Stef Coene
Quoted 7 lines · Trevor Warren
Hello there,
Having made quite a lot of expensive mistakes i have finally clobbered
together a script for the users on my network.Have a look at it and please suggest as to how can i limit bandwidth to
each ip on this network to about 64Kbits.You specify bandwidth 1mbit. But that should be your real nic bandwidth. So 10mbit or 100mbit. If you want to share the same 1Mbit between some classes, you have to add 1 bounded class with rate = 1mbit to the root qdisc and add the other classes to that class.
Remove the isolated class, it's not working and can even distubr your setup.Stef
Signature · 5 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/
#!/bin/bash
#####################################
#Deleting and setting up
#Root qdisc's
#####################################
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 100Mbit rate 1Mbit avpkt 1000 cell 8
#######################################
#Setting up top 2 qdiscs
#for initial packet classification
#######################################
# Exatt Rules
#######################################
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Mbit rate 800kbit weight 80kbit allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.10.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.11.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.12.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.13.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.14.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.15.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.16.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.17.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.18.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.19.0/24 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:1
##########################################
#Paradyne Rules
##########################################
tc class add dev eth0 parent 1:0 classid 1:2 cbq bandwidth 100Mbit rate 200kbit weight 20kbit allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.20.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.21.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.22.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.23.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.24.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.25.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.26.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.27.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.28.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.29.0/24 classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:2
#######################################
#Setting up top 10 qdiscs
#for initial Exatt packet classification
#######################################
tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.10.0/24 classid 1:3
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:3
tc class add dev eth0 parent 1:1 classid 1:4 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.11.0/24 classid 1:4
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:4
tc class add dev eth0 parent 1:1 classid 1:5 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.12.0/24 classid 1:5
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:5
tc class add dev eth0 parent 1:1 classid 1:6 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.13.0/24 classid 1:6
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:6
tc class add dev eth0 parent 1:1 classid 1:7 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.14.0/24 classid 1:7
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:7
tc class add dev eth0 parent 1:1 classid 1:8 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.15.0/24 classid 1:8
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:8
tc class add dev eth0 parent 1:1 classid 1:9 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.16.0/24 classid 1:9
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:9
tc class add dev eth0 parent 1:1 classid 1:10 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.17.0/24 classid 1:10
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:10
tc class add dev eth0 parent 1:1 classid 1:11 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.18.0/24 classid 1:11
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:11
tc class add dev eth0 parent 1:1 classid 1:12 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.19.0/24 classid 1:12
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:12
######################################
#Setting up top 10 qdiscs
#for initial Paradyne packet classification
#######################################
tc class add dev eth0 parent 1:2 classid 1:13 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.20.0/24 classid 1:13
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:13
tc class add dev eth0 parent 1:2 classid 1:14 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.21.0/24 classid 1:14
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:14
tc class add dev eth0 parent 1:2 classid 1:15 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.22.0/24 classid 1:15
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:15
tc class add dev eth0 parent 1:2 classid 1:16 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.23.0/24 classid 1:16
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:16
tc class add dev eth0 parent 1:2 classid 1:17 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.24.0/24 classid 1:17
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:17
tc class add dev eth0 parent 1:2 classid 1:18 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.25.0/24 classid 1:18
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:18
tc class add dev eth0 parent 1:2 classid 1:19 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.26.0/24 classid 1:19
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:19
tc class add dev eth0 parent 1:2 classid 1:20 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.27.0/24 classid 1:20
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:20
tc class add dev eth0 parent 1:2 classid 1:21 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.28.0/24 classid 1:21
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:21
tc class add dev eth0 parent 1:2 classid 1:22 cbq bandwidth 100Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.29.0/24 classid 1:22
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:22
#################################
# Start of Actual Filters
#################################
Quoted 7 lines · Trevor Warren
Hello there,
Having made quite a lot of expensive mistakes i have finally clobbered
together a script for the users on my network.Have a look at it and please suggest as to how can i limit bandwidth to
each ip on this network to about 64Kbits.
You specify bandwidth 1mbit. But that should be your real nic bandwidth. So 10mbit or 100mbit. If you want to share the same 1Mbit between some classes, you have to add 1 bounded class with rate = 1mbit to the root qdisc and add the other classes to that class.
Remove the isolated class, it's not working and can even distubr your setup.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 4 lines · Trevor Warren
Stef....;)
Hats off to you. I am zapped as to how did you figure out the
"isolated" class wasn't working???.
I did some filter tests to see if you can split the traffic in different classes and how you have to do this. At the same time I tried the isolated parameter. If you have an isolated, not-bounded class, there is no shaping. As long as the classes are bounded, everything is working like it should be :
http://www.docum.org/stef.coene/qos/tests/cbq/filter.html
Quoted 7 lines
Anyway Stef, i am glad that you have detected something without my
telling you. Have changed the same and have restarted the server. Lets see. Its night time here in Bombay, hence am playing around with the production machine.Stef, I need to traffic shape for my 1000 odd users on the network. Is
there a way to do it by having static qdisc's /classes/filters inserted.
It depends on how much control you want to have. If you want to have tied control, you have to create 1 class (filter) / user. Or you can try the wrr qdisc (you can find a link on www.docum.org). This qdisc can create 1 class for each filter/mac-address it sees and punish big downloaders by limiting the rate.
Quoted 3 lines
Also, can i do them on the fly by having them login cia a SUID ROOT ph
page and then get web access and thus adding/deleting these qdisc's /classes/filters on the fly???.
Or you use a tc binary with a sticky bit so any user can execute tc and the execution is done as user root.
Just wondering, you make all classes bounded. So they can not borrow bandwidth from each other. But if you do this, why do you create the classes 1:1 and 1:2 ??
And you use 2 filters to put the packets in the end class. You can do this in 1 step so you need only 1 filter. Just put the packets directly in the end class. If you are interested, I did some tests with filters and how the weight parameter influence the sharing between the filters :
http://www.docum.org/stef.coene/qos/tests/cbq/splitting/splitting.html
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello Stef,
I want all these efforts ultimately to convert into a neat, ergonomic
web interface for Traffic Shaping - Bandwidth Management for Enterprises which would be in the GPL domain on sourceforge.
Though i am with a commercial organisation this is a personal effort
and gpl is what the code will be in.
Suggestions for the same would be appreciated stef.
Trevor
Quoted 41 lines · Stef Coene
Quoted 4 lines · Trevor Warren
Stef....;)
Hats off to you. I am zapped as to how did you figure out the
"isolated" class wasn't working???.I did some filter tests to see if you can split the traffic in different classes and how you have to do this. At the same time I tried the isolated parameter. If you have an isolated, not-bounded class, there is no shaping. As long as the classes are bounded, everything is working like it should be :
http://www.docum.org/stef.coene/qos/tests/cbq/filter.htmlQuoted 7 lines
Anyway Stef, i am glad that you have detected something without my
telling you. Have changed the same and have restarted the server. Lets see. Its night time here in Bombay, hence am playing around with the production machine.Stef, I need to traffic shape for my 1000 odd users on the network. Is
there a way to do it by having static qdisc's /classes/filters inserted.It depends on how much control you want to have. If you want to have tied control, you have to create 1 class (filter) / user. Or you can try the wrr qdisc (you can find a link on www.docum.org). This qdisc can create 1 class for each filter/mac-address it sees and punish big downloaders by limiting the rate.
Quoted 3 lines
Also, can i do them on the fly by having them login cia a SUID ROOT ph
page and then get web access and thus adding/deleting these qdisc's /classes/filters on the fly???.Or you use a tc binary with a sticky bit so any user can execute tc and the execution is done as user root.
Just wondering, you make all classes bounded. So they can not borrow bandwidth from each other. But if you do this, why do you create the classes 1:1 and 1:2 ??
And you use 2 filters to put the packets in the end class. You can do this in 1 step so you need only 1 filter. Just put the packets directly in the end class. If you are interested, I did some tests with filters and how the weight parameter influence the sharing between the filters :
http://www.docum.org/stef.coene/qos/tests/cbq/splitting/splitting.htmlStef
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello Stef,
thanks for the pointers. Think next time i should think before i leap.
Am setting up your web interface. The demo suggests support for HTB hope CBQ is there in it too.
Trevor
Quoted 16 lines · Stef Coene
Quoted 5 lines · Trevor Warren
Hello Stef,
I want all these efforts ultimately to convert into a neat, ergonomic
web interface for Traffic Shaping - Bandwidth Management for Enterprises which would be in the GPL domain on sourceforge.Something like http://home.docum.org/qos/ :)
Quoted 2 lines
Though i am with a commercial organisation this is a personal effort
and gpl is what the code will be in.Me too.
Quoted 1 line
Suggestions for the same would be appreciated stef.
Read all the bits you can find on www.docum.org :)
Stef
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Stef,
Am setting the same up on my machine now. Want to understand how your
code works. Getting support for cbq will be the next thing on the agenda. Your interface is quite neat though am trying to comprehend what the setup really can/can't do.
I have a whole list of options on the QOS front that we could look into
and package the same for a cbd-htb qos setup. Lets have this done with a schedule and a plan of action. Time to time reviews will help us judge the progress we have made.
I would like to hear your ideas on creating an Enterprise GUI interface
for QOS-Traffic Shaping-Bandwidth Management to be gpl'ed.
Trevor
Quoted 15 lines · Stef Coene
Quoted 5 lines · Trevor Warren
Hello Stef,
thanks for the pointers. Think next time i should think before i leap.
Am setting up your web interface. The demo suggests support for HTB hope CBQ is there in it too.No, only htb. But the framework is there, so adding cbq support is not such a big deal. But I also do a lot of rate/ceil checking with htb, so it's not only entering the values, but also checking the values to reduce user errors.
But I'm very interested in creating a GUI interface. I also did some stuff like you can see in the demo and it was harder then I thought. So if you decide to restart it, let me know and I will help you as much as I can.
Stef
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 5 lines · Trevor Warren
Hello Stef,
I want all these efforts ultimately to convert into a neat, ergonomic
web interface for Traffic Shaping - Bandwidth Management for Enterprises which would be in the GPL domain on sourceforge.
Something like http://home.docum.org/qos/ :)
Quoted 2 lines
Though i am with a commercial organisation this is a personal effort
and gpl is what the code will be in.
Me too.
Quoted 1 line
Suggestions for the same would be appreciated stef.
Read all the bits you can find on www.docum.org :)
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 5 lines · Trevor Warren
Hello Stef,
thanks for the pointers. Think next time i should think before i leap.
Am setting up your web interface. The demo suggests support for HTB hope CBQ is there in it too.
No, only htb. But the framework is there, so adding cbq support is not such a big deal. But I also do a lot of rate/ceil checking with htb, so it's not only entering the values, but also checking the values to reduce user errors.
But I'm very interested in creating a GUI interface. I also did some stuff like you can see in the demo and it was harder then I thought. So if you decide to restart it, let me know and I will help you as much as I can.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 6 lines · Trevor Warren
Stef,
Am setting the same up on my machine now. Want to understand how your
code works. Getting support for cbq will be the next thing on the agenda. Your interface is quite neat though am trying to comprehend what the setup really can/can't do.
The setup is based around some basic scripts. They are not so difficult to understand, but I sometimes had to mess around to get it working. There are still some bugs in it.
Quoted 7 lines
I have a whole list of options on the QOS front that we could look into
and package the same for a cbd-htb qos setup. Lets have this done with a schedule and a plan of action. Time to time reviews will help us judge the progress we have made.I would like to hear your ideas on creating an Enterprise GUI interface
for QOS-Traffic Shaping-Bandwidth Management to be gpl'ed.
Ok, when do we start ?
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hiyee Stef,
Can we meet on irc?. Also, figure out a new section for the gui
web/system on docum.org where we can put up the Road Map and TODO.
We will attack the web first then the system.
Web --> php
System --> tcl/tk or Py-Gtk
Wats say Stef???
Since we are in different time zones we may have to make some
adjustments towards meeting up online. Will be out to a customers location through the morning so don't mind if i don't reply immideately.
If you on irc sometime soon mail me on [email protected] and
i will get an sms stef.
Keep all those ideas of yours brewing...;)
Trevor
Quoted 21 lines · Stef Coene
Quoted 6 lines · Trevor Warren
Stef,
Am setting the same up on my machine now. Want to understand how your
code works. Getting support for cbq will be the next thing on the agenda. Your interface is quite neat though am trying to comprehend what the setup really can/can't do.The setup is based around some basic scripts. They are not so difficult to understand, but I sometimes had to mess around to get it working. There are still some bugs in it.
Quoted 7 lines
I have a whole list of options on the QOS front that we could look into
and package the same for a cbd-htb qos setup. Lets have this done with a schedule and a plan of action. Time to time reviews will help us judge the progress we have made.I would like to hear your ideas on creating an Enterprise GUI interface
for QOS-Traffic Shaping-Bandwidth Management to be gpl'ed.Ok, when do we start ?
Stef
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Giannis,
What does the script look like. How many different levels/classes have
you broken them into???.
Trevor
Quoted 13 lines · Giannis Stoilis
----- Original Message -----
From: "Trevor Warren" <[email protected]>
To: "Giannis Stoilis" <[email protected]>
Sent: Τρίτη, 17 Ιουνίου 2003 2:51 πμ
Subject: Re: [LARTC] herz the script that i have done.Quoted 2 lines
We sure would appreciate your setup for a testing ground. Are you using
cbq/htb/etc internally??Yep. HTB actually, for shaping a 256kbit link.
- Giannis
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi all,
The rest of the conversation will be between me and Trevor. If anyone is interested in following our GUI project, let me (or Trevor) know and we will keep you informed.
Of course, if we create anything usefull, the lartc list will be informed.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello Mr. Mohan,
Are you fro India??.
Anyway, an explorer like interface is okie with us too. But from my
perspective we should rather give preference to a web based interface as of now since this would drastically expand the scope of deployment where Traffic Shaping can be performed on servers.
X / windows based interface we will delve on but that would be the
second step.
Please go ahead and give us your ideas on creating an XML based
configuration for the same which can be used for the web and the desktop config too. Using PHP with XML based configuration parameters would definitely make interoperability seamless for the long run.
Do get back to us with your detailed ideas in terms of a premature
white paper on the same.
Trevor
Quoted 35 lines · S Mohan
I've also been thinking of creating a GUI based on XML with a Windows explorer like interface. I've the idea. If you are open, I can feed you the same.
Mohan
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stef Coene
Sent: Monday, June 16, 2003 1:52 PM
To: Trevor Warren
Cc: lartc
Subject: Re: [LARTC] herz the script that i have done.Quoted 5 lines · Trevor Warren
Hello Stef,
thanks for the pointers. Think next time i should think before i
leap. Am setting up your web interface. The demo suggests support for HTB hope CBQ is there in it too.No, only htb. But the framework is there, so adding cbq support is not such a
big deal. But I also do a lot of rate/ceil checking with htb, so it's not
only entering the values, but also checking the values to reduce user errors.But I'm very interested in creating a GUI interface. I also did some stuff
like you can see in the demo and it was harder then I thought. So if you
decide to restart it, let me know and I will help you as much as I can.Stef
Signature · 9 lines
( >- GNU/LINUX, It's all about CHOICE -< ) /~\ __ [email protected] __ /~\ | \) / Pre Sales Consultant - Red Hat \ (/ | |_|_ \ 9820349221(M) | 22881326(O) / _|_| \___________________________________/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/