KB-3226204

Apply a MikroTik rate limit through a profile

Set Mikrotik-Rate-Limit on a compatible RouterOS NAS and verify both traffic directions independently of usage quotas.

10 views

Separate rate from allowance

Billing Plans define usage allowances, reset periods and optional depletion disconnects. They do not expose a generic speed field in the plan API.[1] For a supported MikroTik RouterOS RADIUS service, the profile can send Mikrotik-Rate-Limit; RouterOS defines the rate from the router's perspective, with receive first and transmit second.[3] Confirm in the RouterOS documentation that the exact service on your NAS consumes the attribute before you plan a rollout.

Configure a small, measurable pilot

  1. In Profiles, create or edit a test profile such as lab-routeros-shaped. In Reply Attributes, select Mikrotik-Rate-Limit, enter 2M/5M, choose Add and save. Reopen the profile and check the exact string. This is a profile reply, not a plan selection.[2][3]
  2. Assign the profile to one identity on the supported RouterOS service and start a fresh session. Check for Mikrotik-Rate-Limit = 2M/5M in the Access-Accept and look for the resulting effective limit in the NAS's session or shaping state.
  3. With a test endpoint on a path capable of exceeding both limits, run separate upload and download measurements. For this example the intended client upload limit is 2 Mbit/s and download limit is 5 Mbit/s. Actual measured application throughput can be lower. Record results separately from the plan's data counters.[3]

Isolate the cause of an unexpected speed

If the attribute is absent, check the profile and compare the final reply with the profile's saved row. If the attribute is present and limits appear reversed, check which direction you measured and how RouterOS labels it. If no limit takes effect, confirm your RouterOS service and firmware, then check the effective shaping policy for competing local configuration. A slow link or endpoint can hide a working cap, so repeat against a controlled baseline before adjusting the value.

Keep non-MikroTik devices on their own validated profiles; do not assume another vendor supports the same reply. Restore the previous profile and reconnect only the pilot if needed. Do not raise a data allowance to fix throughput, or describe shaping as a quota reset: the mechanisms answer different operational questions.

References

  1. RadiusStack Plans API: limits, usage and reset configuration
  2. RadiusStack Profiles API: NAS restriction and reply attributes
  3. MikroTik RouterOS RADIUS: Mikrotik-Rate-Limit and rate directions