LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-27-2003, 07:50 AM   #1
saturn_vk
Member
 
Registered: Feb 2003
Location: Sofia
Distribution: slackware
Posts: 104

Rep: Reputation: 15
Angry neither cbq nor htb run correctly!


In order to limit some of the computers from hogging the internet connection, i've tried using htb, and then cbq in order to limit some of them. neither cbq nor htb seem to do anything at all however.

here are my 2 scripts (only one is run at a time of course)
Code:
#!/bin/sh
tc qdisc add dev eth1 root handle 1: htb default 100
tc class add dev eth1 parent 1: classid 1:1 htb rate 256kbps ceil 256kbps
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 120kbps ceil 256kbps prio 1 #maya 
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 90kbps ceil 256kbps prio 0 #sat 
tc class add dev eth1 parent 1:1 classid 1:30 htb rate 80kbps ceil 256kbps prio 2 #kapi 
tc class add dev eth1 parent 1:1 classid 1:40 htb rate 30kbps ceil 256kbps prio 2 #xp1400 
tc class add dev eth1 parent 1:1 classid 1:50 htb rate 80kbps ceil 256kbps burst 5k

tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev eth1 parent 1:30 handle 30: sfq perturb 10
tc qdisc add dev eth1 parent 1:40 handle 40: sfq perturb 10
tc qdisc add dev eth1 parent 1:50 handle 50: sfq perturb 10

U32="tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32"
U33="tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32"
$U32 match ip src 192.168.0.1 flowid 1:10
$U32 match ip src 192.168.0.2 flowid 1:20
$U33 match ip src 192.168.0.7 flowid 1:30
$U33 match ip src 192.168.0.6 flowid 1:40

$U32 match ip dst 192.168.0.1 flowid 1:10
$U32 match ip dst 192.168.0.2 flowid 1:20
$U33 match ip dst 192.168.0.7 flowid 1:30
$U33 match ip dst 192.168.0.6 flowid 1:40
tc qdisc show
Code:
#!/bin/sh
tc qdisc add dev eth1 root handle 1:0 cbq bandwidth 256Kbit avpkt 1000 cell 8
tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 256Kbit rate 256Kbit weight 25Kbit prio 8 allot 1514 cell 8 maxburst 10 avpkt 1000 bounded

tc class add dev eth1 parent 1:1 classid 1:10 cbq bandwidth 256Kbit rate 120Kbit weight 12Kbit prio 5 allot 1514 cell 8 maxburst 10 avpkt 1000
tc class add dev eth1 parent 1:1 classid 1:20 cbq bandwidth 256Kbit rate 90Kbit weight 9Kbit prio 5 allot 1514 cell 8 maxburst 10 avpkt 1000
tc class add dev eth1 parent 1:1 classid 1:30 cbq bandwidth 256Kbit rate 80Kbit weight 8Kbit prio 5 allot 1514 cell 8 maxburst 5 avpkt 1000
tc class add dev eth1 parent 1:1 classid 1:40 cbq bandwidth 256Kbit rate 60Kbit weight 6Kbit prio 5 allot 1514 cell 8 maxburst 3 avpkt 1000

tc qdisc add dev eth1 parent 1:10 handle 100: sfq
tc qdisc add dev eth1 parent 1:20 handle 200: sfq
tc qdisc add dev eth1 parent 1:30 handle 300: sfq
tc qdisc add dev eth1 parent 1:40 handle 400: sfq

tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.1 flowid 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.2 flowid 1:20
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.7 flowid 1:30
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.6 flowid 1:40

tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.1 flowid 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.2 flowid 1:20
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.7 flowid 1:30
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.6 flowid 1:40

tc qdisc show
neither displays any errors, and tc qdisc show displays exactly what it is supposed to display, however, computers 192.168.0.6 and 7 are still getting the most bandwidth, sometimes even all of it, even though i have tried giving them the least. they are also windows computers, if that helps any.

can anyone please tell me WHY nothing works !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTB as a child of another HTB - doesn't work ddaas Linux - Networking 5 07-25-2005 03:21 AM
HTB, CBQ, shapecfg: howto prioritize network? Artik Linux - Networking 3 06-10-2005 12:09 PM
Getting KPPP to run correctly azebuski Linux - Software 7 10-02-2004 12:38 PM
Can't run vdr or kvdr correctly bruno buys Linux - Software 1 09-18-2004 06:31 PM
iptables doesn't run correctly abd_bela Linux - Security 2 08-02-2003 11:20 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration