Anda di halaman 1dari 2

Boost BGP Network Performance by 42% - [Free Demo]

How to set up QoS bandwidth rate limit on


Vyatta router
Last updated on October 31, 2012 Authored by Dan Nanni 1 Comment

If you are running a network shared by multiple devices, you probably want to set up QoS
policies (e.g., average bandwidth rate, burst size), so that network bandwidth is properly shared
by them. Vyatta software router supports powerful QoS settings. You can easily define any QoS
policy, and bind the policy to a specific network interface/port, or to specific types of traffic, etc.

If you would like to set up QoS bandwidth rate limit on Vyatta, follow the instructions below.

I assume that Vyatta router has two interfaces: eth0 connected to internal LAN, and eth1
connected to external networks. Here I will set bandwidth cap for upload traffic at 1Mbits/sec
and download traffic at 2Mbits/sec.

What I will do is the following. First, define outgoing traffic shaper on eth1 to rate limit
outbound traffic (i.e., upload traffic), and then define another outgoing shaper on eth0 to rate
limit inbound traffic (i.e., download traffic). I am going to use Vyatta's Command Line Interface
(CLI) to set this up.

$ configure
[you are entering Vyatta's CLI]
$ set traffic-policy shaper UPLOAD-POLICY
$ set trafficpolicy shaper UPLOAD-POLICY bandwidth 1Mbit
$ set trafficpolicy shaper UPLOAD-POLICY default bandwidth 50%
$ set trafficpolicy shaper UPLOAD-POLICY default ceiling 100%
$ set trafficpolicy shaper UPLOAD-POLICY default burst 15k
$ set trafficpolicy shaper UPLOAD-POLICY default queue-type fair-queue
$ set interfaces ethernet eth1 trafficpolicy out UPLOAD-POLICY
$ set traffic-policy shaper DOWNLOAD-POLICY
$ set trafficpolicy shaper DOWNLOAD-POLICY bandwidth 2Mbit
$ set trafficpolicy shaper DOWNLOAD-POLICY default bandwidth 50%
$ set trafficpolicy shaper DOWNLOAD-POLICY default ceiling 100%
$ set trafficpolicy shaper DOWNLOAD-POLICY default burst 15k
$ set trafficpolicy shaper DOWNLOAD-POLICY default queue-type fair-queue
$ set interfaces ethernet eth0 trafficpolicy out DOWNLOAD-POLICY
$ commit
$ save
$ exit
[you are exiting Vyatta's CLI]
The resulting /config/config.boot looks like the following:

interfaces {
ethernet eth0 {
address 192.168.10.1/24
......
traffic-policy {
out DOWNLOAD-POLICY
}
}
ethernet eth1 {
address dhcp
....
traffic-policy {
out UPLOAD-POLICY
}
}
}

traffic-policy {
shaper UPLOAD-POLICY {
bandwidth 1Mbit
default {
bandwidth 50%
burst 15k
ceiling 100%
queue-type fair-queue
}
}
shaper DOWNLOAD-POLICY {
bandwidth 2Mbit
default {
bandwidth 50%
burst 15k
ceiling 100%
queue-type fair-queue
}
}
}

Later if you want to change your bandwidth rate limit on Vyatta, you can simply do:

$ configure
$ set traffic-policy shaper DOWNLOAD-POLICY bandwidth 8Mbit
$ set traffic-policy shaper UPLOAD-POLICY bandwidth 4Mbit
$ commit
$ save
$ exit

The change will take effect upon commit. So you do not need to reboot Vyatta.

Anda mungkin juga menyukai