Solved

rate limit / bandwidth throttling / shaping

Posted on 2003-12-08
3
36,223 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux / python expert needed 3 102
Linux CentOs 6.7 : i can't start service 8 98
IPA - change main server? 3 175
Weird Samba Connectivity Issue... 7 66
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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