LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-18-2002, 07:34 AM   #1
karunesh
Member
 
Registered: Jan 2002
Location: India
Distribution: CentOS/Mandriva
Posts: 126

Rep: Reputation: 15
Unhappy bandwidth limiting


Hi folks.

Today I was just trying to test tc filters with cbq.
But it was not working..I don't know may be I am making some mistake.Please someone correct me.

Here is what I have done.
I have linux kernel 2.4.2-2 on which I am running ipchains 1.3.10 with iproute2-ss000305.

Now my network is something like this.

[ INTERNET ]------[eth0]=====[eth1]-----[ Private LAN ]

eth0 = 202.142.x.x
eth1 = 192.168.2.1
LAN = 192.168.2.0/24


I am doing masquerading for my internal network.

Now I have 1 PC on my internal network 192.168.2.100
for that I want to restrict on 5Kbps download speed.I have total bandwidth of 128Kbps.
Now following are the commands I have tested.



# ipchains -I forward -s 192.168.2.0/24 -j MASQ
# tc qdisc add dev eth1 root handle 1: cbq bandwidth 128Kbit avpkt 1000 mpu 64
# tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 128Kbit rate 5Kbit avpkt 1000 prio 1 maxburst 20 bounded
# ipchains -I input -s 0/0 -d 192.168.2.100 -m 100
# tc filter add dev eth1 parent 1:0 protocol ip prio 10 handle 100 fw classid 1:1


But after these commands still on 192.168.2.100Pc I am getting good downbload speed somewhere around 30-35 Kbps.

Please someone help me,where I am making mistake.

 
Old 08-18-2002, 10:28 PM   #2
darkmage
Member
 
Registered: Jun 2002
Location: Lousiville,KY
Distribution: Gentoo
Posts: 89

Rep: Reputation: 15
http://www.tldp.org/HOWTO/Bandwidth-...WTO/index.html
Presenting the official LDP Howto! Hopefully that helps
 
Old 08-18-2002, 11:09 PM   #3
karunesh
Member
 
Registered: Jan 2002
Location: India
Distribution: CentOS/Mandriva
Posts: 126

Original Poster
Rep: Reputation: 15
Thanks for that link but it will be better if you can pin point me,where I am making mistake.

 
Old 08-19-2002, 02:03 PM   #4
darkmage
Member
 
Registered: Jun 2002
Location: Lousiville,KY
Distribution: Gentoo
Posts: 89

Rep: Reputation: 15
I'll do my best but I'll have to do a bit of reading first. Let you know if I find anything. Hopefully someone who's an expert will reply to this before I finish .

Last edited by darkmage; 08-19-2002 at 02:30 PM.
 
Old 08-19-2002, 02:42 PM   #5
darkmage
Member
 
Registered: Jun 2002
Location: Lousiville,KY
Distribution: Gentoo
Posts: 89

Rep: Reputation: 15
http://lartc.org/howto/lartc.qdisc.html
Here's one document I found, when I have time I'll get back to reading it.

http://lartc.org/howto/lartc.qdisc.classful.html#AEN679
This one also seems to apply to you. Section 9.5.3.2

Last edited by darkmage; 08-19-2002 at 02:45 PM.
 
Old 11-09-2002, 02:28 AM   #6
chris200t
LQ Newbie
 
Registered: Nov 2002
Distribution: Redhat 8.0
Posts: 4

Rep: Reputation: 0
Well Aparently you need to load SQUID with delay pools and CBQ runs through that.. You do not need any TC Commands Well I didn't. I am kinda really new to Linux

But I was able to get it to run on all 4 of my LAN based NIC's.. ETH1,2,3,4 running as a masq through ETH0.

You can also use
SHAPECFG "VARY EASY"
if you don't care about port based limiting or garenteed bandwith per ports you can use this utility to do total NIC card limiting

insmod -o shaper1 /lib/modules/2.4.18-14/kernel/drivers/net/shaper.o
shapecfg attach shaper1 eth1
shapecfg speed shaper1 56000
ifconfig shaper1 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
route add -net 192.168.1.0 netmask 255.255.255.0 dev shaper1


INSMOD is needed to add the modual name for the shaper.
Line 2 attach's the shaper to the intrnal LAN to be shaped
Line 3 is the speed in bit's 56000 = 56k easy enough
line 4 is to bring the IP to the Shaper device. You use whatever IP you are useing for your ETH1 or other Intrnal LAN card in my case I had to do this 4 times with my ETH1,2,3,4
Line 5 is to add a route so it will route data. Vary easy to do..
 
  


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
bandwidth limiting gubak Linux - Networking 1 03-02-2005 06:51 AM
Bandwidth Limiting UnrealTear Linux - Software 2 04-10-2004 10:33 PM
Bandwidth limiting dunkyb Linux - Networking 3 09-17-2003 04:36 AM
Bandwidth limiting turb0freak Linux - Networking 10 08-15-2003 10:29 PM
Bandwidth Limiting boundless Linux - Networking 2 04-15-2003 02:07 PM


All times are GMT -5. The time now is 01:23 AM.

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