Thursday, September 26, 2013

monowall traffic shaping

ref: http://wiki.abiquo.com/display/ABI20/How+to+Configure+a+Gateway+with+m0n0wall

8. Traffic Shaping Example

This is a simple example of how to configure traffic shaping in your firewall.

8.1. Before you begin, check the maximum download rate

In order to determine the size of the pipes, you need to know the average download rate of your WAN interface. To do so, you need to run the following command on a machine in that WAN:
$ curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
A download of a very large file will start. After some minutes, you can cancel it (by pressing Ctrl+C) and take a look at the download statistics. You'll see something like this:
The value under the Average Download column is what you need. In this network, after a 91-second test, we obtained an Average Download Rate of 211Kb/s. To make sure we're not surpassing it, we will substract 10% from this value and use it as a maximum. We'll assume we have a maximum bandwidth of 190 Kb/s.
Reliability of this value
The more time you spend testing, the more reliable the final value will be.

8.2. Setting Up the Pipes

For our example we will set up two pipes: one limited to 150 Kb/s for high-speed connections, and one limited to 40 Kb/s for low-speed connections.

8.3. Setting Up the Queues

In our high-speed connections, we want to have two queues: one for high-priority connections (weight 90) and one for low-priority connections (weight 30).

8.4. Setting Up the Rules

After defining our pipes and queues graph, we need to define the rules to filter the actual traffic:
  • SSH connections will be redirected to High-priority queue beneath High-speed pipe.
  • HTTP connections will be redirected to Low-priority queue beneath High-speed pipe.
  • All other connections will be redirected to Low-speed pipe.
Activate traffic shaping
After making all changes, make sure you check the option Enable traffic shaping in the Rules section
Related Posts Plugin for WordPress, Blogger...