Simple traffic shaping rule to limit bandwidth for clients

Posted on 2007-10-03
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://
    LVL 30

    Accepted Solution

    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
    As a prerequisite you need iproute2 package and certain settings in your kernel though several up-to-date distros include iproute2:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
    Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now