Simple traffic shaping rule to limit bandwidth for clients

Posted on 2007-10-03
Medium Priority
Last Modified: 2013-12-23
Hi All
I have a 256 kbit/s connection over a network..the gateway is a natting linux server..I need some traffic shaping rules that limit the maximum available bandwidth for -> to 64 kbit/s and the rest to 32 kbits per second
Question by:http:// thevpn.guru
  • 2
LVL 30

Accepted Solution

Kerem ERSOY earned 1500 total points
ID: 20012153
A script such as this would do:

tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:1 classid 1:6 htb  rate 192kbit ceil 256kbit
tc filter add dev eth0 parent 1:0 protocol ip prio 5 u32 \
match ip src 0xffff \
match ip tos 0x10 0xff   \
flowid 1:6 police rate 64000bps burst 10240 mpu 0 action drop/continue  
tc filter add dev eth0 parent 1:0 protocol ip prio 5 u32 \
match ip src 0xffff \
match ip tos 0x10 0xff   \
flowid 1:6 police rate 32000bps burst 10240 mpu 0 action drop/continue
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 20012180
As a prerequisite you need iproute2 package and certain settings in your kernel though several up-to-date distros include iproute2:

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6. Keep in mind that subnetting requires lots of practice and time.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

862 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