Solved

rate limit / bandwidth throttling / shaping

Posted on 2003-12-08
3
36,235 Views
Last Modified: 2011-04-14
I want a simple way to throttle outbound and inbound bandwidth usages on eth0.  I've used the shaper module, but sadly it only shapes outbound traffic.  I've tried using tc, but it's really damed complicated, and i could only find examples for ingress filtering.  Can somone give me an example of rate limiting both inbound & outbound traffic on an ethernet device to 128kbit?
0
Comment
Question by:thefnordling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
Jivko earned 500 total points
ID: 9902622
                 Inbond:

                  tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10mbit

        tc class add dev eth0 parent 1: classid 1:1 cbq rate 128kbit \
        allot 1500 prio 5 bounded isolated

        tc filter add dev eth0 parent 1: protocol ip prio 16 u32 \
        match ip dst 192.168.0.0/24 flowid 1:1
 

                  Outbond:

                  tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10mbit

        tc class add dev eth0 parent 1: classid 1:1 cbq rate 128kbit \
        allot 1500 prio 5 bounded isolated

        tc filter add dev eth0 parent 1: protocol ip prio 16 u32 \
        match ip dst 192.168.0.0/24 flowid 1:1


The easyest way:
cbq.init script or htb.init

Configuring CBQ can be a bit daunting, especially if all you want to do is shape some computers behind a router. CBQ.init can help you configure Linux with a simplified syntax.

For example, if you want all computers in your 192.168.1.0/24 subnet (on 10mbit eth1) to be limited to 28kbit/s download speed, put this in the CBQ.init configuration file:


DEVICE=eth1,10Mbit,1Mbit
RATE=28Kbit
WEIGHT=2Kbit
PRIO=5
RULE=192.168.1.0/24


htb.init

http://sourceforge.net/projects/htbinit/

Regards








 




0
 

Author Comment

by:thefnordling
ID: 9912779
i ended up using rshaper.  http://ar.linux.it/cgi-bin/cvsweb/rshaper/

I had to make some small changes to the import statements in the source, since its an old package using some deprecated libraries.  

i just compiled, did insmod, and it was done.   It worked very well.

Thanks for the answer though, rshaper has it's limitations and i may come back to the tc qdisc stuff if rshaper doesn't pan out.  

0
 

Expert Comment

by:kalyandeo
ID: 11526636


Hi

Try " Wondershaper"

http://lartc.org/wondershaper/

It is very easy to use.

Thanks


0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question