Solved

rate limit / bandwidth throttling / shaping

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dns master and slave in linux 2 72
How to identify SSH user interactive login? 15 82
How to Edit Files in Linux 6 124
Help needed with BIND9 DNS on Ubuntu. 22 102
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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