LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-12-2007, 09:17 AM   #1
baltika_no_9
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Rep: Reputation: 0
Bandwidth shaping/throttling - How to?


Hi all

I've seen similar questions answered in these forums and as a result I've looked at stuff in www.lartc.org etc but still it doesn't seem to match what I am looking for.

I have a firewall/router running Fedora Core 6 and it connects to a 512kbs ADSL link. There's 4 or 5 PCs/laptops attached behind this firewall sharing the ADSL bandwidth. Unfortunately, one of the kids tends to eat up most of the bandwidth and I'm wondering how I can restrict the traffic to this one particular IP address? Let's say I'd like for instance to permit this address to get a maximum of say 50% of the available b/w?

Has anyone doen something like that?

Many thanks all
 
Old 01-13-2007, 12:53 AM   #2
abakali
Member
 
Registered: Dec 2005
Location: karachi
Distribution: RedHat
Posts: 75

Rep: Reputation: 15
Us tc to control the user here is example to bound ip with tc class id to bound xxx.xxx.xxx.xxx ip to 128 kbit
Lan Eth0

## First Create the cbq id let sey your lan is 10 MB
tc qdisc add dev eth0 root handle 10: cbq bandwidth 10Mbit avpkt 1000

## Then Bound with parent with define different classid:1
tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt 1000

## Now the set parent id with your classid and your speed rate
tc class add dev eth0 parent 10:1 classid 10:2 cbq bandwidth 10Mbit rate 128kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded

## The Final Step bond classid with ip address
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.2 flowid 10:2

## to Flush rules
tc qdisc del dev eth0 root

this is simple example to create single ip if you have to many ips to need to repeat this step with different classid


tc class add dev eth0 parent 10:1 classid 10:3 cbq bandwidth 10Mbit rate 64kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.3 flowid 10:3


tc class add dev eth0 parent 10:1 classid 10:4 cbq bandwidth 10Mbit rate 256kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.4 flowid 10:4


Happy linux !!
 
Old 01-13-2007, 02:50 AM   #3
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
Hi could you please give us same in the htb.I heard htb is far more advanced.
Thanks for your help.
 
Old 01-13-2007, 07:14 AM   #4
baltika_no_9
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Abakali I very much apprciate your help, I'll give it a try!

Best regards



Quote:
Originally Posted by abakali
Us tc to control the user here is example to bound ip with tc class id to bound xxx.xxx.xxx.xxx ip to 128 kbit
Lan Eth0

## First Create the cbq id let sey your lan is 10 MB
tc qdisc add dev eth0 root handle 10: cbq bandwidth 10Mbit avpkt 1000

## Then Bound with parent with define different classid:1
tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt 1000

## Now the set parent id with your classid and your speed rate
tc class add dev eth0 parent 10:1 classid 10:2 cbq bandwidth 10Mbit rate 128kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded

## The Final Step bond classid with ip address
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.2 flowid 10:2

## to Flush rules
tc qdisc del dev eth0 root

this is simple example to create single ip if you have to many ips to need to repeat this step with different classid


tc class add dev eth0 parent 10:1 classid 10:3 cbq bandwidth 10Mbit rate 64kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.3 flowid 10:3


tc class add dev eth0 parent 10:1 classid 10:4 cbq bandwidth 10Mbit rate 256kbit allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst xxx.xxx.0.4 flowid 10:4


Happy linux !!
 
  


Reply



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 throttling bhogalts Linux - Networking 1 05-10-2006 02:57 AM
Bandwidth throttling joeljkp Linux - Networking 4 07-28-2005 12:59 PM
bandwidth throttling greenmeanie Debian 1 07-10-2005 09:06 PM
Bandwidth Throttling... dolvmin Linux - Networking 3 09-21-2004 08:56 AM
Bandwidth Throttling chasingmytail Slackware 6 06-30-2004 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration