Text Size

As a follow-up to my Traffic Shaping article, I was asked how this could be applied to multiple subnets with different speeds. Fortunately, it's very easy to configure.

This article assumes that Vyatta has three network interfaces

eth0 - In my case, this is the main interface the connects to the internet
eth1 - This is my Guest network that I want limited
eth2 - This is my Virtual Machine network that will have a different limit.

First we will create a policy for the Guest Network.

#set traffic-policy shaper GUEST-UL

You can also give the policy a description if you wish. (This step is optional)

#set traffic-policy shaper GUEST-UL description “QoS policy for GUEST LAN”

Now we set the max upload bandwidth that we want to allow

#set traffic‐policy shaper GUEST-UL bandwidth 128kbit

We need to set the default bandwidth policy. If you add other QoS settings in the future you can change this to a lower number. This will not limit the default bandwidth unless there are other QoS policies in place but it is required to get the upload cap to work.

#set traffic‐policy shaper GUEST-UL default bandwidth 50%

Now we set the max amount of bandwidth that the default policy can utilize. In this case we're setting it to 100%.

#set traffic‐policy shaper GUEST-UL default ceiling 100%

Now we must bind the policy to the interface for the Guest Network. To ensure the policy will limit the bandwidth you must bind it to the correct interface. If you miss this step your bandwidth will not be limited.

#set interfaces ethernet eth1 traffic‐policy out GUEST-UL

Commit your changes

#commit

Now save them to ensure they will survive a reboot.

#save

Before you continue, test the settings with your favorite speed test site to make sure it works. If it does not, look to see where you went wrong.

Now that we have limited the upload for the guest network, let's limit the download. Create the limiter policy and give it a name.

#set traffic‐policy limiter GUEST-DL

You can also give the policy a description if you wish. (This step is optional)

#set traffic‐policy limiter GUEST-DL default description “Limit inbound guest traffic”

Set the default policy bandwidth. In this command we are limiting the bandwidth to 300kbps.

#set traffic‐policy limiter GUEST-DL default bandwidth 300kbit

As in the upload limiter we must bind the policy to the external interface to ensure the download policy will limit the bandwidth. If you miss this step your bandwidth will not be limited.

#set interfaces ethernet eth1 traffic‐policy in GUEST-DL

Commit your changes

#commit

Now save them to ensure they will survive a reboot.

#save

Before you continue, test the settings with your favorite speed test site to make sure it works. If it does not, look to see where you went wrong. If everything works as expected move on to the VM Network.

#set traffic-policy shaper VMN-UL

You can also give the policy a description if you wish. (This step is optional)

#set traffic-policy shaper VMN-UL description “QoS policy for Virtual Machine Network”

Now we set the max upload bandwidth that we want to allow. Unlike the Guest network above, we are allowing 500kbits versus 128kbps

#set traffic‐policy shaper VMN-UL bandwidth 500kbit

We need to set the default bandwidth policy for this network too. If you add other QoS settings in the future you can change this to a lower number. This will not limit the default bandwidth unless there are other QoS policies in place but it is required to get the upload cap to work.

#set traffic‐policy shaper VMN-UL default bandwidth 50%

Now we set the max amount of bandwidth that the default policy can utilize. In this case we're setting it to 100%.

#set traffic‐policy shaper VMN-UL default ceiling 100%

Now we must bind the policy to the interface for the Virtual Machine Network. To ensure the policy will limit the bandwidth for your Virtual Machine Network, you must bind it to the correct interface. Again, if you miss this step your bandwidth will not be limited.

#set interfaces ethernet eth2 traffic‐policy out VMN-UL

Commit your changes

#commit

Now save them to ensure they will survive a reboot.

#save

Before you continue to the download limiter, test the settings with your favorite speed test site to make sure it works. If it does not, look to see where you went wrong. Now that we have limited the upload for the Virtual Machine Network, let's limit the download. Create the limiter policy and give it a name.

#set traffic‐policy limiter VMN-DL

You can also give the policy a description if you wish. (This step is optional)

#set traffic‐policy limiter VMN-DL default description “Limit inbound VM traffic”

Set the default policy bandwidth. In this command we are limiting the bandwidth to 1500kbps.

#set traffic‐policy limiter GUEST-DL default bandwidth 1500kbit

As in the upload limiter we must bind the policy to the correct interface to ensure the download policy will limit the bandwidth. If you miss this step your bandwidth will not be limited.

#set interfaces ethernet eth1 traffic‐policy in VMN-DL

Commit your changes

#commit

Now save them to ensure they will survive a reboot.

#save

Before you continue, test the settings with your favorite speed test site to make sure it works. If it does not, look to see where you went wrong. If everything works as expected both your Guest and VM Networks are not limited at different speeds.

PLEASE NOTE: Check your upload and download speeds, if they are reversed, just swap the shaper and limiter speeds. I've seen the speeds swapped in a couple of configurations so I wanted to warn you.

Tech Stocks


Warning: Invalid argument supplied for foreach() in /home/sohowe5/public_html/tonystech.com/modules/mod_rokstock/lib/googlestock.class.php on line 71

Donations

If you like the site and feel the need to donate to help support the site, you can do it here.



Login Form