-----Original Message----- From: Allan Gee Sent: Tuesday, March 12, 2002 3:27 PM To: ''lartc-request@mailman.ds9a.nl'' Subject: Rate goes over setting Hi guys I have a small problem that I want to limit each network behind us to different rates. The box sits between our router to the internet and the clients. I have attached a mrtg graph to show the stats and one can see that every now and then the rate goes over the limit. This is the code I use for that client who has 64kbit from us and we give him 16kbit only with no borrowing. As you can see from the script I have tried to set the burst rate to as low as possible but it still goes over. What am I doing wrong? #!/bin/sh cbq stop /home/allang/resetFW TCHTB="/sbin/tc" BURS="burst 0.1kbit cburst 0.1kbit" # Destination TCCLASSDST="/sbin/tc class add dev eth1 parent" TCQDISCDST="/sbin/tc qdisc add dev eth1 parent" TCFILTERDST="/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32" # Source TCCLASSSRC="/sbin/tc class add dev eth0 parent" TCQDISCSRC="/sbin/tc qdisc add dev eth0 parent" TCFILTERSRC="/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32" # # For Transparent Proxy # iptables -A PREROUTING -t nat -s 192.168.178.0/24 -p tcp --dport 80 -j DNAT --to 192.168.177.231:3128 iptables -A POSTROUTING -t nat -s 192.168.178.0/24 -d 192.168.177.231 -j SNAT --to 192.168.177.15 # Root & Default Class $TCHTB qdisc add dev eth1 root handle 1: htb default 11 $TCCLASSDST 1: classid 1:10 htb rate 100Mbit $TCCLASSDST 1:10 classid 1:11 htb rate 100Mbit ceil 100Mbit $TCQDISCDST 1:11 handle 12: sfq perturb 10 $TCHTB qdisc add dev eth0 root handle 1: htb default 11 $TCCLASSSRC 1: classid 1:10 htb rate 100Mbit $TCCLASSSRC 1:10 classid 1:11 htb rate 100Mbit ceil 100Mbit $TCQDISCSRC 1:11 handle 12: sfq perturb 10 # The 16kbit client $TCCLASSDST 1: classid 1:20 htb rate 16kbit ceil 16kbit $BURS $TCCLASSDST 1:20 classid 1:21 htb rate 16kbit ceil 16kbit $BURS $TCQDISCDST 1:21 handle 22: sfq perturb 10 $TCFILTERDST match ip dst 129.0.0.0/24 flowid 1:21 $TCCLASSSRC 1: classid 1:20 htb rate 16kbit ceil 16kbit $BURS $TCCLASSSRC 1:20 classid 1:21 htb rate 16kbit ceil 16kbit $BURS $TCQDISCSRC 1:21 handle 22: sfq perturb 10 $TCFILTERSRC match ip src 129.0.0.0/24 flowid 1:21 Regards Allan Gee Equation 021 4181777
Hi, I have not X terminal here so I don''t see the gif, but what ammount is the difference ? Also attach please tc -s -d class show ethX output in times of bad shaping. devik> Hi guys I have a small problem that I want to limit each network behind us > to different rates. The box sits between our router to the internet and the > clients. I have attached a mrtg graph to show the stats and one can see that > every now and then the rate goes over the limit. This is the code I use for > that client who has 64kbit from us and we give him 16kbit only with no > borrowing. As you can see from the script I have tried to set the burst rate > to as low as possible but it still goes over.
On Tuesday 12 March 2002 14:27, Allan Gee wrote:> -----Original Message----- > From: Allan Gee > Sent: Tuesday, March 12, 2002 3:27 PM > To: ''lartc-request@mailman.ds9a.nl'' > Subject: Rate goes over setting > > > Hi guys I have a small problem that I want to limit each network behind us > to different rates. The box sits between our router to the internet and the > clients. I have attached a mrtg graph to show the stats and one can see > that every now and then the rate goes over the limit. This is the code I > use for that client who has 64kbit from us and we give him 16kbit only with > no borrowing. As you can see from the script I have tried to set the burst > rate to as low as possible but it still goes over. > What am I doing wrong?The script looks OK. But like Devik said, the output of tc is important. I have some scripts if you are interested to create graphs of the output of tc. It records allmost all available counters. You can find it on www.docum.org under GUI (example can be found on http://home.docum.org/stef.coene/qos/gui/rrd.html). It uses snmp to get remote information and uses rrd to store the data and to create graphs. This gives you the oppurtinity to get more information when there is a problem. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net