Please Insert Text

Custom Search

Monday, December 15, 2008

Mikrotik Bandwidth Control

Limit the Bandwidth

In order to configure the bandwidth using Mikrotik, Aradial uses VSA (Vendor Specific Attributes) from Mikrotik:

VSA Definition:
rate-limit (text; default: "") - Rate limitation in form of rx-rate[/tx-rate] [rx-burstrate[/tx-burst-rate] [rx-burst-threshold[/tx-burst-threshold] [rx-burst-time[/tx-burst-time][priority] [rx-rate-min[/tx-rate-min]]]] from the point of view of the router (so "rx" is client upload, and "tx" is client download). All rates should be numbers with optional 'k'(1,000s) or 'M' (1,000,000s). If tx-rate is not specified, rx-rate is as tx-rate too. Same goes for tx-burst-rate and tx-burst-threshold and tx-burst-time. If both rx-burstthreshold and tx-burst-threshold are not specified (but burst-rate is specified), rx-rate and tx-rate is used as burst thresholds. If both rx-burst-time and tx-burst-time are not specified, 1s is used as default. Priority takes values 1..8, where 1 implies the highest priority, but 8 - the lowest. If rx-rate-min and tx-rate-min are not specified rx-rate and
tx-rate values are used. The rx-rate-min and tx-rate-min values can not exceed rxrate and tx-rate values.

1. Configure the NAS to use Mikrotik.
2. Edit Raddb/NasCfgDbs to add a new service to Mikrotik.

At the Mikrotik section put:
[Mikrotik]
Dictionary=Mikrotik.dic
IgnoreAcctSig=Yes
UniquePorts=No
BW:User-Service-Type=Framed-User,Framed-Protocol=PPP,Framed-Address=$FramedAddress,Framed-Filter-Id=$FramedFilterId,Framed-
Netmask=255.255.255.255,Rate-Limit=$bwrate

In the Aradial user or Group screen in RADIUS Attributes please put:
$bwrate=128k/256k 100000000k/100000000k 96k/192k 8

Limit the Upload MB and Download MB

The VSA attributes to use:
Recv-Limit=... To limit downloads.
Xmit-Limit=.... To limit uploads.
Example:
BW:User-Service-Type=Framed-User,Framed-Protocol=PPP,Framed-Address=$FramedAddress,Framed-Filter-Id=$FramedFilterId,Framed-
Netmask=255.255.255.255,Rate-Limit=$bwrate,Recv-Limit=100000,Xmit-Limit=50000

0 Comments: