Vyatta To Control Bandwidth
Vyatta To Control Bandwidth
Vyatta router has two interfaces: eth0 LAN, and eth1 WAN interface
set bandwidth for upload traffic at 1Mbits/sec and download traffic at 2Mbits/se
c
$ configure
[you are entering Vyatta's CLI]
$ set traffic-policy shaper UPLOAD-POLICY
$ set traffic?policy shaper UPLOAD-POLICY bandwidth 1Mbit
$ set traffic?policy shaper UPLOAD-POLICY default bandwidth 50%
$ set traffic?policy shaper UPLOAD-POLICY default ceiling 100%
$ set traffic?policy shaper UPLOAD-POLICY default burst 15k
$ set traffic?policy shaper UPLOAD-POLICY default queue-type fair-queue
$ set interfaces ethernet eth1 traffic?policy out UPLOAD-POLICY
$ set traffic-policy shaper DOWNLOAD-POLICY
$ set traffic?policy shaper DOWNLOAD-POLICY bandwidth 2Mbit
$ set traffic?policy shaper DOWNLOAD-POLICY default bandwidth 50%
$ set traffic?policy shaper DOWNLOAD-POLICY default ceiling 100%
$ set traffic?policy shaper DOWNLOAD-POLICY default burst 15k
$ set traffic?policy shaper DOWNLOAD-POLICY default queue-type fair-queue
$ set interfaces ethernet eth0 traffic?policy out DOWNLOAD-POLICY
$ commit
$ save
$ exit
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
ADVANCED EXAMPLE
-----------------i've 2 network. One is wireless and one is LAN line
scope
lan line limit traffic 15mbit used http https dns pop3 minimum 60% other minimum
20%
wiless limit 5mbit used http https dns pop3 minimum 60% other minimum 20%
here is sample config
set
set
set
set
set
set
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
shaper
shaper
shaper
shaper
shaper
shaper
5m
5m
5m
5m
5m
5m
bandwidth '5120kbit'
class 2 bandwidth '60%'
class 2 ceiling 100%
class 2 match dns ip protocol 'udp'
class 2 match dns ip source port '53'
class 2 match http ip protocol 'tcp'
set
set
set
set
set
set
set
set
set
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
traffic-policy
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
5m
5m
5m
5m
5m
5m
5m
5m
5m
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
set traffic-policy
commit
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
shaper
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
15m
class 2
class 2
class 2
class 2
class 2
class 2
default
default
default
bandwidth '15mbit'
class 2 bandwidth '60%'
class 2 ceiling 100%
class 2 match dns ip protocol 'udp'
class 2 match dns ip source port '53'
class 2 match http ip protocol 'tcp'
class 2 match http ip source port '80'
class 2 match pop3 ip protocol 'tcp'
class 2 match pop3 ip source port '110'
class 2 match https ip protocol 'tcp'
class 2 match https ip source port '443'
class 2 queue-type 'fair-queue'
default bandwidth '20%'
default ceiling 100%
default queue-type 'fair-queue'