Bandwidth Management with HTB

Posted on Updated on

The following steps for creating bandwidth Management with HTB, this is a standard tutorial to limit bandwidth based on IP address  not port or services.

Labs: 1 linux box with two ethernet card, configured eth0 direct to internet, and eth1 direct to LAN 

1. Download htb-init file

2. create directory /etc/sysconfig/htb

    # mkdir /etc/sysconfig/htb

3.  Go to the directory and create all htb config files:

      # cd /etc/sysconfig/htb

 4. create the interface config

      # vi eth0

              DEFAULT=0

              R2Q=1000

        # vi eth1

                 DEFAULT=0

                 R2Q=10000

5. create root interface configuration on each interface

       # vi eth0-2.root

             RATE=512kbps

             CEIL= 512kbps

        # vi eth1-5.root

                RATE=512kbps

                CEIL=512 kbps

6. create bandwidth for the source / destination, in the following example we create the rule on eth1, with the assumption to limit bandwidth go and from eth1. the following example is using id 1002 and the name is VOIP-BDG, while RULE=10.162.36.254 is the IP address we would like to manage its bandwidth

  # eth1-2:1002.VOIP-BDG
     RATE=32Kbit
     CEIL=64Kbit
      BURST=2K
      LEAF=sfq
      PRIO=1
     MARK=1002
      RULE=10.162.36.254
the rule is applied to eth1, so that each packet comes from 10.162.36.254 will have the guarantee bandwidth of 32kbps and max 64 kbps (ceil)

2 thoughts on “Bandwidth Management with HTB

    Best CD Rate said:
    March 24, 2008 at 10:11 am

    Best CD Rate

    I work with the poor daily. Most poor (not “broke”) people really do lack wisdom in the US; many lack average intelligence; many have learned lies of advertisers and culture. There is nothing condescending or contempuous in acknowledging this. Educat…

    Network Bandwidth Management said:
    August 6, 2010 at 6:49 pm

    Thanks for posting this. Bandwidth management is really important for any company.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s