LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ip bandwidth limiter script problems (https://www.linuxquestions.org/questions/linux-networking-3/ip-bandwidth-limiter-script-problems-344498/)

mrweirdo 07-18-2005 10:50 PM

ip bandwidth limiter script problems
 
Hello after some research I was able to come up with a traffic shaping bandwidth limiter script that makes use of tc comands. For some reason I am unable to get it to work however. I'm trying to limit the upload links from my Ubuntu box to the ip 192.168.10 on the same LAN as the Ubuntu box. Basicaly I want the box assigned the IP to only be able to download files off the ubuntu box at 512kpbs.

here is the script:
shaper.sh
Code:

# change these values to suit your needs
DEV=eth0
UPLINK=512
IP=192.168.0.10

tc qdisc add dev $DEV root handle 1: cbq avpkt 10000 bandwidth 100mbit

tc class add dev $DEV parent 1: classid 1:1 cbq rate ${UPLINK}kbit allot 1500 prio 5 bounded isolated

tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst ${IP} flowid 1:1

The when I go to run i get the following:
Code:

mrweirdo@ubuntu:~$ sudo sh /etc/shaper/shaper-script.sh
"?at is "
Usage: ... cbq bandwidth BPS avpkt BYTES [ mpu BYTES ]
              [ cell BYTES ] [ ewma LOG ]
Illegal "rate"
Illegal "match"
mrweirdo@ubuntu:~$

Hopefully someone out there has some ideas as I'm currently stuck. Anyways thanks for taking the time to look at my thread :)


All times are GMT -5. The time now is 05:31 PM.