User Manager/Limiting

From MikroTik Wiki
Jump to: navigation, search

Applies to RouterOS: v3.x


Note: In version 4, profiles are used for user limiting


User actions can be limited in several dimensions:

  • time
  • traffic amount (download and upload)
  • rate limits (speed)


Time can be managed in two ways: user's uptime-limit field and credit's time field.

Uptime limit

Uptime limit is maximum time amount a user is allowed to be active (to have active sessions). If the user's uptime-limit field is left blank, he/she has no uptime limit. See the example below.

Used-uptime for a user is sum of durations of all sessions this user has. Used-uptime can not exceed uptime-limit.

User's request to start a new session is processed as follows:

  • uptime-limit for the user is checked. If it is not specified, start a new session, otherwise proceed to next step.
  • uptime-left is calculated (left = allowed - used). If uptime-left is not positive, raise an error, otherwise proceed to next step.
  • session-timeout is set and a new session is started.

Credit time

Subscriber can define available credit vouchers. User can buy those vouchers, customers can assign available credits to users. User credits are valid specific time. This means, when a credit is started, it must be used within a time specified. User can have active sessions only while he/she has valid credits. See the example below.


If a user must be allowed to use 2 hours of Internet access and he/she must use these 2 hours within one week, then the uptime-limit field must be set to 2h and the user must be assigned a credit with time equal to 1w (See character constants for more information about time limit constants).

Traffic amount

User has fields download-limit and upload-limit. To specify unlimited amount, leave blank the proper field. Limits are specified in bytes. For example, to allow download 1GB, download-limit field must have value of 1073741824 (1073741824 bytes = 1024 x 1024 x 1024 bytes = 1 gigabyte).

Rate limits

User has field rate-limit. This field is available straight in the console, but is divided in several fields in web-interface, to ease the input process. For more detailed description about the meaning of these fields see Mikrotik HotSpot User AAA documentation, HotSpot User Profiles, Property description, rate-limit.