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-burst-rate[/tx-burstrate]
[rx-burst-threshold[/tx-burst-threshold] [rx-burst-time[/tx-burst-time] [priority] [rx-ratemin[/
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-burst-threshold 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-bursttime
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 txrate
values are used. The rx-rate-min and tx-rate-min values can not exceed rx-rate and tx-rate
values.
Use the following string schema: x1k/y1k x2k/y2k x3k/y3k x5/y5 P x6k/y6k
where:

x1k/y1k: Rate (txrate/rxrate e.g 128k/1024k)
x2k/y2k: Burst Rate (e.g 256k/2048k)
x3k/y3k: Burst Threshold (e.g 160k/1280k)
x5/y5: Burst Time (in seconds e.g: 60/60)
Priority: P (use integer from 1-8)
Minimum rate: x6k/y6k (e.g 32k/256k)
1. Configure the NAS to use Mikrotik.
2. You can review Raddb\NasCfgDbs to view how the BW service is implemented:
At the Mikrotik section:
[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
Aradial automatically limits the MB for both up and down when using the Metering feature.
The VSA attributes to use:
MTK-Total-Limit - limit in bytes until 4GB.
MTK-Total-Limit-Gigawords - in 4GB units. 2 mean 8GB.
If one wishes to create new services and configure the limits for upload and download
manually:
The VSA attributes to use:
Recv-Limit - limit downloads in bytes until 4GB.
Xmit-Limit - limit uploads in bytes until 4GB.
Recv-Limit-Gigawords - in 4GB units. 4 means 16GB.
Xmit-Limit-Gigawords - in 4GB units. 4 means 16GB.
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:

Post a Comment

Thanks For All
Please You Folow My Site