You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Documentation

This document describes RouterOS, the operating system of MikroTik devices.

While the documentation is still being migrated, many additional articles are located in our old documentation portal..


[RouterOS] Pages Feed
Confluence Syndication Feed
RouterOS license keys

Page edited by Olga Ļ.

Overview

MikroTik hardware routers that run RouterOS come preinstalled with a RouterOS license, if you have purchased a RouterOS based device, nothing must be done regarding the license.

For X86 systems (i.e. PC devices), you need to obtain a license key.

The license key is a block of symbols that needs to be copied from your mikrotik.com account, or from the email you received in, and then it can be pasted into the router. You can paste the key anywhere in the terminal, or by clicking "Paste key" in WinBox License menu. A reboot is required for the key to take effect.

RouterOS licensing scheme is based on Software-ID / System-ID where:

  • RouterBOARD software-id is bound to storage media (HDD, NAND).
  • x86 software-id is bound to MBR
  • CHR system-id is bound to MBR and UUID

Before the license purchase it is recommended to check if the software ID does not change on reboot. (Software ID may change on defective HDD, on HDD where RAID controllers are used but not properly configured etc.)

Licensing information can be read from CLI system console:

[admin@RB1100] > /system license print 
    software-id: "43NU-NLT9"
         nlevel: 6
       features: 
[admin@RB1100] >

or from equivalent WinBoxWebFig menu.


License Levels

After installation RouterOS runs in trial mode. You have 24 hours to register for Level1 (Free demo) or purchase a Level 4,5 or 6 license and paste a valid key.

Level 3 is a wireless station (client or CPE) only license. For x86 PCs, Level3 is not available for purchase individually.

Level 2 was a transitional license from old legacy (pre 2.8) license format. These licenses are not available any more, if you have this kind of license, it will work, but to upgrade it - you will have to purchase a new license.

The difference between license levels is shown in the table below.

Level number0 (Trial mode)1 (Free Demo)3 (WISP CPE)4 (WISP)5 (WISP)6 (Controller)
Priceno keyregistration requirednot for sale$45$95$250
Wireless AP mode (PtMP)24h trial-noyesyesyes
PPPoE tunnels24h trial1200200500unlimited
PPTP tunnels24h trial1200200500unlimited
L2TP tunnels24h trial1200200500unlimited
OVPN tunnels24h trial1200200unlimitedunlimited
EoIP tunnels24h trial1unlimitedunlimitedunlimitedunlimited
VLAN interfaces24h trial1unlimitedunlimitedunlimitedunlimited
Queue rules24h trial1unlimitedunlimitedunlimitedunlimited
HotSpot active users24h trial11200500unlimited
User manager active sessions24h trial1102050Unlimited
Bonding interfaces24h trial1unlimitedunlimitedunlimitedunlimited
RADIUS24h trial-unlimitedunlimitedunlimitedunlimited


All Licenses:

  • never expire (a running and licensed router can be used indefinitely)
  • can use unlimited number of interfaces
  • are for one installation each
  • offer unlimited software upgrades (exception - demo license does not allow ROS version upgrade (started from 7.8))

CHR License Levels

License levels described until now do not apply to Cloud Hosted Routers (CHRs). CHR is a RouterOS version intended for running as a virtual machine. It has its own 4 license levels as well as trial where you can test any of the paid license levels for 60 days.

60-day free trial license is available for all paid license levels. To get the free trial license, you have to have an account on MikroTik.com as all license management is done there.

Perpetual is a lifetime license (buy once, use forever). It is possible to transfer a perpetual license to another CHR instance. A running CHR instance will indicate the time when it has to access the account server to renew it's license. If the CHR instance will not be able to renew the license it will behave as if the trial period has ran out and will not allow an upgrade of RouterOS to a newer version.

After licensing a running trial system, you must manually run the /system license renew command from the CHR to make it active. Otherwise the system will not know you have licensed it in your account. If you do not do this before the system deadline time, the trial will end and you will have to do a complete fresh CHR installation, request a new trial and then license it with the license you had obtained.

LicenseSpeed limitPriceDescription
Free1MbitFREEThe free license level allows CHR to run indefinitely. It is limited to 1Mbps upload per interface. All the rest of the features provided by CHR are available without restrictions. To use this, all you have to do is download disk image file from our download page and create a virtual guest.
P11Gbit$45P1 (perpetual-1) license level allows CHR to run indefinitely. It is limited to 1Gbps upload per interface. All the rest of the features provided by CHR are available without restrictions. It is possible to upgrade p1 to p10 or p-unlimited After the upgrade is purchased the former license will become available for later use on your account.
P1010Gbit$95P10 (perpetual-10) license level allows CHR to run indefinitely. It is limited to 10Gbps upload per interface. All the rest of the features provided by CHR are available without restrictions. It is possible to upgrade p10 to p-unlimited After the upgrade is purchased the former license will become available for later use on your account.
P-UnlimitedUnlimited

$250

The p-unlimited (perpetual-unlimited) license level allows CHR to run indefinitely. It is the highest tier license and it has no enforced limitations.
60-day Trial
FREE

In addition to the limited Free installation, you can also test the increased speed of P1/P10/PU licenses with a 60 trial.

You will have to have an account registered on MikroTik.com. Then you can request the desired license level for trial from your router that will assign your router ID to your account and enable a purchase of the license from your account. All the paid license equivalents are available for trial. A trial period is 60 days from the day of acquisition, after this time passes, your license menu will start to show "Limited upgrades", which means that RouterOS can no longer be upgraded.

Note that if you plan to purchase the selected license, you must do it before 60 days trial ends. If your trial has ended, and there are no purchases within 2 months, the device will no longer appear in your MikroTik account. You will have to make a new CHR installation to make a purchase within the required time frame.

To request a trial license, you must run the command "/system license renew" from the CHR device command line. You will be asked for the username and password of your mikrotik.com account.


Warning: If you plan to use multiple virtual systems of the same kind, it may be possible that the next machine has the same SystemID as the original one. This can happen on certain cloud providers, such as Linode. To avoid this, after your first boot, run the command "/system license generate-new-id" before you request a trial license. Note that this feature must be used only while CHR is running on free type of RouterOS license. If you have already obtained paid or trial license, do not use regenerate feature since you will not be able to update your current key any more

To use multiple virtual machines, download the disk image from our webpage, and make as many copies, as you need virtual machines. Then make new virtual machine system from each virtual disk image.

Make sure to make copies of the Disk Image before you run or register the downloaded file.


Replacement Key

It is a special key which is issued by the MikroTik support team if you accidentally lose the license on a x86 instance running RouterOS, and the MikroTik Support employee decides that it is not directly your fault. It costs 10$ and has the same features as the key that you lost.

Note that before issuing such key, MikroTik Support can ask you to prove that the old drive has failed, in some cases, this means sending us the dead drive.

Replacement key request

1) Go to your account management in mikrotik.com and fill the "support contact form" or write a direct e-mail to support@mikrotik.com

  • Please provide detailed information about why replacement key is required

2) Send required info to MikroTik support department.

3) Re-check your account after support staff has confirmed that replacement key has been added to your account. Select the section "Make a key from replacement key"

4) Select the appropriate license level on which you wish to perform the replacement

5) Enter the new "software-ID"

6) Proceed to checkout by pressing "Add license replacement to cart" and finish the payment

7) An e-mail will be sent to your profile containing the new license.

  • You can also find the newly generated key in the section "Search and view all keys" under the folder "Purchased YYYY" where "YYYY" is the current Year

We may issue only one replacement key per one original key, using replacement key procedure twice for one key will not be possible. In cases like this new key for this RouterOS device must be purchased.


Obtaining Licenses and Working With Them

Where can I buy a RouterOS license key?

MikroTik devices come preinstalled with a license and no purchase is needed.

To obtain a higher level license, or to obtain a license for a x86 PC installation, you must register an account on our webpage, and in there, use the option "Purchase a RouterOS license key".

If I have purchased my key elsewhere

You must contact the company who sold you the license, they will provide the support.

If I have a license and want to put it on another account?

You can give access to keys with the help of Virtual Folders

The only kind of licenses, that could be transferred to another Account is a prepaid key, which is purchased or is got from MUM. Prepaid keys got as a gift from the Training are not transferable.
To transfer purchased prepaid key navigate to "Transfer prepaid keys" in the section "ROUTEROS KEYS" on your MikroTik Account.

If I have lost a license on my device?

If for some reason you have lost license from your router, upgrade router to the latest RouterOS version available and use "Request license key" in your mikrotik.com account. Use soft-id and serial number available under System/License menu in RouterOS when requesting license. Apply received license or contact support@mikrotik.com if request feature do not work.

If the license was lost due to repairs and they were not done via the distributor under warranty, you will have to purchase a new RouterOS license for the full price!


Using the License

Can I Format or Re-Flash the drive?

Formatting, and Re-Imaging the drive with non-MikroTik tools (like DD and Fdisk) will destroy your license! Be very careful and contact MikroTik support before doing this. It is not recommended, as MikroTik support might deny your request for a replacement license. For this use MikroTik provided tools - Netinstall or CD-install that are freely available from our download page.

How many computers can I use the License on?

The RouterOS license can be used only in one system, at the same time. The License is bound to the HDD it is installed on, but you have the ability to move the HDD to another computer system. You cannot move the License to another HDD, neither can you format or overwrite the HDD with the RouterOS license. It will be erased from the drive, and you will have to get a new one. If you accidentally removed your license, contact the support team for help.

Can I temporary use the HDD for something else, other than RouterOS?

As stated above, no.

Can I move the license to another HDD ?

If your current HDD drive is destroyed, or can no longer be used, it is possible to transfer the license to another HDD. You will have to request a replacement key (see below) which will cost 10$

Must I type the whole key into the router?

No, simply copy it and paste in the menu System --> License,

Can I install another OS on my drive and then install RouterOS again later?

No, because if you use formatting, partitioning utilities or tools that do something to the MBR, you will lose the license and you will have to make a new one. This process is not free (see Replacement Key above)

I lost my RouterBOARD, can you give me the license to use on another system?

MikroTik hardware comes with an embedded license. You cannot move this license to a new system in any way, this includes any upgrades applied to the MikroTik router while it was still working.

Licenses Purchased from Resellers

The keys that you purchase from other vendors and resellers are not in your account. Your mikrotik.com account only contains licenses purchased from MikroTik directly. However, you can use the "Request key" link in your account, to get the key into your account for reference, or for some upgrades (if available).

I am not using the software, can you terminate my license?

The licenses are stand alone keys and MikroTik does not have any remote control over your devices. Therefore, we are unable to verify if you use your license or not. This is why MikroTik cannot terminate any issued licenses.

User

Page edited by Serhii T.

Summary

MikroTik RouterOS router user facility manages the users connecting the router from any of the Management tools. The users are authenticated using either a local database or a designated RADIUS server. Each user is assigned to a user group, which denotes the rights of this user. A group policy is a combination of individual policy items.

In case the user authentication is performed using RADIUS, the RADIUS client should be previously configured.

User Settings

The settings submenu allows to control the password complexity requirements of the router users. 

PropertyDescription
minimum-password-length (integer; 0..4294967295; Default: )Specifies the minimum character length of the user password
minimum-categories (integer; 0..4; Default: )

Specifies the complexity requirements of the password, with categories being uppercase, lowercase, digit, symbol. 


User Groups

The router user groups provide a convenient way to assign different permissions and access rights to different user classes. 

Properties

PropertyDescription
name (string; Default: )The name of the user group
policy (local | telnet | ssh | ftp | reboot | read | write | policy | test | winbox | password | web | sniff | sensitive | api | romon | dude | tikapp; Default: none)List of allowed policies:


Login policies:

  • local - policy that grants rights to log in locally via console
  • telnet - policy that grants rights to log in remotely via telnet
  • ssh - policy that grants rights to log in remotely via secure shell protocol
  • web - policy that grants rights to log in remotely via WebFig.
  • winbox - policy that grants rights to log in remotely via WinBox and bandwidth test authentication
  • password - policy that grants rights to change the password
  • api - grants rights to access router via API.
  • rest-api - grants rights to access the router via REST API.
  • ftp - policy that grants full rights to log in remotely via FTP.  Allows to read/write/erase files and to transfer files from/to the router. Should be used together with read/write policies.
  • romon - policy that grants rights to connect to the RoMon server.

Config Policies:

  • reboot - policy that allows rebooting the router
  • read - policy that grants read access to the router's configuration. All console commands that do not alter the router's configuration are allowed. Doesn't affect FTP
  • write - policy that grants write access to the router's configuration, except for user management. This policy does not allow to read the configuration, so make sure to enable read policy as well
  • policy - policy that grants user management rights. Should be used together with the write policy. Allows also to see global variables created by other users (requires also 'test' policy).
  • test - policy that grants rights to run ping, traceroute, bandwidth-test, wireless scan, snooper, fetch, email and other test commands
  • sensitive - grants rights to change "hide sensitive" option, if this policy is disabled sensitive information is not displayed.
  • sniff - policy that grants rights to use packet sniffer tool.
skin (name; Default: default)Used skin for WebFig

Default groups

There are three default system groups which cannot be deleted:

[admin@MikroTik] > /user group print 
0 name="read" policy=local,telnet,ssh,reboot,read,test,winbox,password,web,sniff,sensitive,api,romon,tikapp,!ftp,!write,!policy,!dude skin=default 

1 name="write" policy=local,telnet,ssh,reboot,read,write,test,winbox,password,web,sniff,sensitive,api,romon,tikapp,!ftp,!policy,!dude skin=default 

2 name="full" policy=local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,password,web,sniff,sensitive,api,romon,tikapp,!dude skin=default 

Please note, that even the "read" group includes sensitive, reboot, and other important policies, meaning that this group should not be given to untrusted users. For truly limited groups, make a custom group, defining specific policies. All groups have access to file operations. Exclamation sign '!' just before the policy item name means NOT.

Router Users

The router user database stores information such as username, password, allowed access addresses, and group about router management personnel. 

Properties

PropertyDescription
address (IP/mask | IPv6 prefix; Default: )Host or network address from which the user is allowed to log in
group (string; Default: )Name of the group the user belongs to
name (string; Default: )User name. Must start and end with an alphanumeric character but can include "_", ".", "#", "-", and "@" symbols. However the "*" symbol is prohibited in the user name.
password (string; Default: )User password. If not specified, it is left blank (hit [Enter] when logging in). It conforms to standard Unix characteristics of passwords and may contain letters, digits, "*" and "_" symbols.
last-logged-in (time and date; Default: "")Read-only field. Last time and date when a user logged in.

Actions

Actions for existing router user.

ActionDescription
passwordOption to change user password.
expire-passwordExpires user password, on next login, router will prompt to change password.

Notes

There is one predefined user with full access rights:

[admin@MikroTik] user> print
Flags: X - disabled
# NAME GROUP ADDRESS LAST-LOGGED-IN
0 ;;; system default user
admin full 0.0.0.0/0 dec/08/2010 16:19:24

There always should be at least one user with full access rights. If the user with full access rights is the only one, it cannot be removed.

Monitoring Active Users

/user active print

 The command shows the currently active users along with respective statistics information.

Properties

All properties are read-only.

PropertyDescription
address (IP/IPv6 address)Host IP/IPv6 address from which the user is accessing the router. 0.0.0.0 means that the user is logged in locally
group (string)A group that the user belongs to.
name (string)User name.
radius (true | false)Whether a user is authenticated by the RADIUS server.
via (local | telnet | ssh |winbox | api | web | tikapp | ftp | dude)User's access method
when (time)Time and date when the user logged in.

Remote AAA

Router user remote AAA enables router user authentication and accounting via a RADIUS server. The RADIUS user database is consulted only if the required username is not found in the local user database.

Properties

PropertyDescription
accounting (yes | no; Default: yes)
exclude-groups (list of group names; Default: )Exclude-groups consist of the groups that should not be allowed to be used for users authenticated by radius. If the radius server provides a group specified in this list, the default-group will be used instead.


This is to protect against privilege escalation when one user (without policy permission) can change the radius server list, set up its own radius server and

log in as admin.
default-group (string; Default: read)User group used by default for users authenticated via a RADIUS server.
interim-update (time; Default: 0s)Interim-Update time interval
use-radius (yes |no; Default: no)Enable user authentication via RADIUS

If you are using RADIUS, you need to have CHAP support enabled in the RADIUS server for WinBox to work

SSH Keys 

 This menu allows importing of private and public keys used for SSH authentication. 

By default, User is not allowed to log in via SSH by password if an SSH key for the user is added. For more details see the SSH page.

Public keys

This menu is used to import and list imported public keys. Public keys are used to approve another device's identity when logging into a router using an SSH key.

On public key import, is it possible to specify key-owner.

RSA and Ed25519 keys are supported in PEM, PKCS#8, or OpenSSH format.

PropertyDescription
user (string; Default: )username to which the SSH key is assigned.
key-owner (string)SSH key owner
public-key-file (string)file name in the router's root directory containing the public key.
key-type (read-only)key type
bits (read-only)key length

Private keys

This menu is used to import and list imported private keys. Private keys are used to approve the router's identity during login into another device using an SSH key.

On private key import, is it possible to specify key-owner.

RSA and Ed25519 keys are supported in PEM or PKCS#8 format.

PropertyDescription
user (string; Default: )username to which the SSH key is assigned.
key-owner (string)SSH key owner
private-key-file (string)file name in the router's root directory containing the private key.
passphrase (string)key file passphrase
key-type (read-only)key type
bits (read-only)key length


WiFi

Page edited by Guntis G.

Overview

The 'WiFi' configuration menu, introduced in RouterOS 7.13, is a RouterOS menu for managing Wi-Fi 5 wave2 and newer WiFi interfaces.

Devices with compatible radios also require either the 'wifi-qcom-ac' driver package (for 802.11ac chipsets) or the 'wifi-qcom'  driver package for 802.11ax and newer chipsets.

The configuration menu used to be called 'wifiwave2' in RouterOS versions before 7.13, where it was a part of the 'wifiwave2' software package.

WiFi Terminology

Before we move on let's familiarize ourselves with terms important for understanding the operation of the menu. These terms will be used throughout the article.

  • Profile - refers to the configuration preset created under one of this WiFi sub-menus: aaa, channel, security, datapath, or interworking
  • Configuration profile - configuration preset defined under /interface/wifi/configuration, it can reference various profiles.
  • Station - wireless client.

Basic Configuration

Basic password-protected AP

/interface/wifi
set wifi1 disabled=no configuration.country=Latvia configuration.ssid=MikroTik security.authentication-types=wpa2-psk,wpa3-psk security.passphrase=8-63_characters


Open AP with OWE transition mode

Opportunistic wireless encryption (OWE) allows the creation of wireless networks that do not require the knowledge of a password to connect, but still offer the benefits of traffic encryption and management frame protection. It is an improvement on regular open access points.

However, since a network cannot be simultaneously encrypted and unencrypted, 2 separate interface configurations are required to offer connectivity to older devices that do not support OWE and offer the benefits of OWE to devices that do.

This configuration is referred to as OWE transition mode.

/interface/wifi
add master-interface=wifi1 name=wifi1_owe configuration.ssid=MikroTik_OWE security.authentication-types=owe security.owe-transition-interface=wifi1 configuration.hide-ssid=yes
set wifi1 configuration.country=Latvia configuration.ssid=MikroTik security.authentication-types="" security.owe-transition-interface=wifi1_owe
enable wifi1,wifi1_owe

Client devices that support OWE will prefer the OWE interface. If you don't see any devices in your registration table that are associated with the regular open AP, you may want to move on from running a transition mode setup to a single OWE-encrypted interface.

Resetting configuration

WiFi interface configurations can be reset by using the 'reset' command.

/interface/wifi reset wifi1

Configuration profiles

One of the new WiFi additions is configuration profiles, you can create various presets, that can be assigned to interfaces as needed. Configuration settings for WiFi are grouped in profiles according to the parameter sections found at the end of this page - aaa, channel, configuration, datapath, interworking, and security, and can then be assigned to interfaces. Configuration profiles can include other profiles as well as separate parameters from other categories.

This optional flexibility is meant to allow each user to arrange their configuration in a way that makes the most sense for them, but it also means that each parameter may have different values assigned to it in different sections of the configuration.

The following priority determines, which value is used:

  1. Value in interface settings
  2. Value in a profile assigned to the interface
  3. Value in configuration profile assigned to interface
  4. Value in a profile assigned to the configuration profile (which in turn is assigned to the interface).

If you are at any point unsure of which parameter value will be used for an interface, consult the actual-configuration menu. For an example of configuration profile usage, see the following example.

Example for dual-band home AP
# Creating a security profile, which will be common for both interfaces
/interface wifi security
add name=common-auth authentication-types=wpa2-psk,wpa3-psk passphrase="diceware makes good passwords" wps=disable
# Creating a common configuration profile and linking the security profile to it
/interface wifi configuration
add name=common-conf ssid=MikroTik country=Latvia security=common-auth
# Creating separate channel configurations for each band
/interface wifi channel
add name=ch-2ghz frequency=2412,2432,2472 width=20mhz
add name=ch-5ghz frequency=5180,5260,5500 width=20/40/80mhz
# Assigning to each interface the common profile as well as band-specific channel profile
/interface wifi
set wifi1 channel=ch-2ghz configuration=common-conf disabled=no
set wifi2 channel=ch-5ghz configuration=common-conf disabled=no

/interface/wifi/actual-configuration print
 0 name="wifi1" mac-address=74:4D:28:94:22:9A arp-timeout=auto radio-mac=74:4D:28:94:22:9A
   configuration.ssid="MikroTik" .country=Latvia 
   security.authentication-types=wpa2-psk,wpa3-psk .passphrase="diceware makes good passwords" .wps=disable
   channel.frequency=2412,2432,2472 .width=20mhz

 1 name="wifi2" mac-address=74:4D:28:94:22:9B arp-timeout=auto radio-mac=74:4D:28:94:22:9B   
   configuration.ssid="MikroTik" .country=Latvia
   security.authentication-types=wpa2-psk,wpa3-psk .passphrase="diceware makes good passwords" .wps=disable
   channel.frequency=5180,5260,5500 .width=20/40/80mhz

Access List

The access list provides multiple ways of filtering and managing wireless connections.

RouterOS will check each new connection to see if its parameters match the parameters specified in any access list rule.

The rules are checked in the order they appear in the list. Only management actions specified in the first matching rule are applied to each connection.

Connections, which have been accepted by an access list rule, will be periodically checked, to see if they remain within the permitted time and signal-range. If they do not, they will be terminated.

Take care when writing access list rules which reject clients. After being repeatedly rejected by an AP, a client device may start avoiding it.

The access list has two kinds of parameters - filtering, and action. Filtering properties are only used for matching clients, to whom the access list rule should be applied to. Action parameters can change connection parameters for that specific client and potentially overriding its default connection parameters with ones specified in the access list rule.

MAC address authentication

Implemented through the query-radius action, MAC address authentication is a way to implement a centralized whitelist of client MAC addresses using a RADIUS server.

When a client device tries to associate with an AP, which is configured to perform MAC address authentication, the AP will send an access-request message to a RADIUS server with the device's MAC address as the user name and an empty password. If the RADIUS server answers with access-accept to such a request, the AP proceeds with whatever regular authentication procedure (passphrase or EAP authentication) is configured for the interface.

Access rule examples

Only accept connections to guest network from nearby devices during business hours

/interface/wifi/access-list/print detail
Flags: X - disabled 
 0   signal-range=-60..0 allow-signal-out-of-range=5m ssid-regexp="MikroTik Guest" time=7h-19h,mon,tue,wed,thu,fri action=accept

 1   ssid-regexp="MikroTik Guest" action=reject 

Reject connections from locally-administered ('anonymous'/'randomized') MAC addresses

/interface/wifi/access-list/print detail
Flags: X - disabled
 0   mac-address=02:00:00:00:00:00 mac-address-mask=02:00:00:00:00:00 action=reject

Assigning a different passphrase for a specific client can be useful, if you need to provide wireless access to a client, but don't want to share your wireless password, or don't want to create a separate SSID. When the matching client connects to this network, instead of using the password defined in the interface configuration, the access list will make that client use a different password. Just make sure that the specific client doesn't get matched by a more generic access list rule first.

/interface wifi access-list
add action=accept disabled=no mac-address=22:F9:70:E5:D2:8E interface=wifi1 passphrase=StrongPassword

Frequency scan

The '/interface/wifi/frequency-scan wifi1' command provides information about RF conditions on available channels that can be obtained by running the frequency-scan command. Used to approximate the spectrum usage, it can be useful to find less crowded frequencies.

Running a frequency scan will disconnect all connected clients, or if the interface is in station mode, it will disconnect from AP.

Scan command

The '/interface wifi scan' command will scan for access points and print out information about any APs it detects. It doesn't show the frequency usage, per channel, but it will reveal all access points that are transmitting. You can use the "connect" button, to initiate a connection to a specific AP.

The scan command takes all the same parameters as the frequency-scan command.

Sniffer

The sniffer command enables monitor mode on a wireless interface. This turns the interface into a passive receiver for all WiFi transmissions.
The command continuously prints out information on received packets and can save them locally to a pcap file or stream them using the TZSP protocol.

The sniffer will operate on whichever channel is configured for the chosen interface.

Spectral scan

The spectral scan can scan frequencies supported by your wifi interface, and plot them directly in the console. The spectral scan has been available since the 7.16beta1 version.

Spectral scan is supported only by the wifi-qcom driver, it is not supported by the wifi-qcom-ac driver.


/interface/wifi/spectral-scan <wifiinterface name> range=


Continuously monitors spectral data. This command uses the same data source as 'spectral-history', and shares many parameters.

To use spectral scan, you must use the "range=" attribute.

Each line displays one spectrogram bucket -- frequency, magnitude (dBm), peak, and a character graphic bar. A bar shows power value with ':' characters and average peak hold with '.' characters.

data - min/max/avg, by default average is used for data. The average should be used in most scenarios, but in some cases "min" can be useful to check if there are any frequencies that have a constant signal output on them. Max represents the strongest signal that was detected during the interval of the scan, similar to the peak.
duration - terminate command after a specified time. default is indefinite;
freeze-frame-interval - Time interval at which to update command output
interval - interval of how often to update the primary data values, not peak
peak-mode - avg/max/disabled - peak reflects the strongest signal over peak-hold-duration. By default "avg" is used, it is the average of max values over "peak-hold-duration", if "max" is used, then the highest value will be shown until the next "peak-hold-duration" update.
peak-hold-duration - changes the peak hold duration used by peak-mode, by default 5 seconds.
range - scan specific range, required;
resolution - frequency step for spectral scan
show-interference - yes/no

Possible types of classified interference:

  • Microwave oven (MWO)
  • Continuous Wave (CW)
  • WLAN (Wideband) (WIFI)
  • Cordless phone 2.4 (CORDLESS24)
  • Cordless phone 5 (CORDLESS5)
  • Bluetooth (BLUETOOTH)
  • Frequency hopping spread spectrum (FHSS)

Spectral history

/interface/wifi/spectral-history <wifi interface name> range=


Plots spectrogram. Power values that fall in different ranges are printed as different colored characters with the same foreground and background color, so it is possible to copy and paste the terminal output of this command.

data - min/max/avg, by default average is used for data. The average should be used in most scenarios, but in some cases "min" can be useful to check if there are any frequencies that have a constant signal output on them. Max will show the strongest signal that was detected, instead of the average signal.
interv - interval of how often to update the data values;
interval - interval at which spectrogram lines are printed;
duration - terminate command after a specified time. default is indefinite;
range - scan specific range, required;
resolution - frequency step;
show-interference - yes/no

Possible types of classified interference:

  • Microwave oven (O)
  • Continuous Wave (C)
  • WLAN (Wideband)  (W)
  • Cordless phone 2.4 (T)
  • Cordless phone 5 (T)
  • Bluetooth (BB)
  • Frequency hopping spread spectrum (F)

WPS

WPS client

The wps-client command enables obtaining authentication information from a WPS-enabled AP.

/interface/wifi/wps-client wifi1

WPS server

An AP can be made to accept WPS authentication by a client device for 2 minutes by running the following command.

/interface/wifi wps-push-button wifi1

Radios

Information about the capabilities of each radio can be gained by running the `/interface/wifi/radio print detail` command.  It can be useful to see what bands are supported by the interface and what channels can be selected. The country profile that is applied to the interface will influence the results.

interface/wifi/radio/print detail 
Flags: L - local 
 0 L radio-mac=48:A9:8A:0B:F7:4A phy-id=0 tx-chains=0,1 rx-chains=0,1 
     bands=5ghz-a:20mhz,5ghz-n:20mhz,20/40mhz,5ghz-ac:20mhz,20/40mhz,20/40/80mhz,5ghz-ax:20mhz,
      20/40mhz,20/40/80mhz 
     ciphers=tkip,ccmp,gcmp,ccmp-256,gcmp-256,cmac,gmac,cmac-256,gmac-256 countries=all 
     5g-channels=5180,5200,5220,5240,5260,5280,5300,5320,5500,5520,5540,5560,5580,5600,5620,5640,5660,
            5680,5700,5720,5745,5765,5785,5805,5825 
     max-vlans=128 max-interfaces=16 max-station-interfaces=3 max-peers=120 hw-type="QCA6018" 
     hw-caps=sniffer interface=wifi1 current-country=Latvia 
     current-channels=5180/a,5180/n,5180/n/Ce,5180/ac,5180/ac/Ce,5180/ac/Ceee,5180/ax,5180/ax/Ce,
                 5180/ax/Ceee,5200/a,5200/n,5200/n/eC,5200/ac,5200/ac/eC,5200/ac/eCee,5200/ax...
                 ...5680/n/eC,5680/ac,5680/ac/eC,5680/ax,5680/ax/eC,5700/a,5700/n,5700/ac,5700/ax 
     current-gopclasses=115,116,128,117,118,119,120,121,122,123 current-max-reg-power=30 

While Radio information gives us information about supported channel width, it is also possible to deduce this information from the product page, to do so you need to check the following parameters: number of chains, max data rate. Once you know these parameters, you need to check the modulation and coding scheme (MCS) table, for example, here: https://mcsindex.com/.

If we take hAP ax2, as an example, we can see that number of chains is 2, and the max data rate is 1200 - 1201 in the MCS table. In the MCS table we need to find entry for 2 spatial streams - chains, and the respective data rate, which in this case shows us that 80MHz is the maximum supported channel width.

Registration table

'/interface/wifi/registration-table/' displays a list of connected wireless clients and detailed information about them.

De-authentication

Wireless peers can be manually de-authenticated (forcing re-association) by removing them from the registration table.

/interface/wifi/registration-table remove [find where mac-address=02:01:02:03:04:05]

WiFi CAPsMAN

WiFi CAPsMAN allows applying wireless settings to multiple MikroTik WiFi AP devices from a central configuration interface.

More specifically, the Controlled Access Point system Manager (CAPsMAN) allows the centralization of wireless network management. When using the CAPsMAN feature, the network will consist of a number of 'Controlled Access Points' (CAP) that provide wireless connectivity and a 'system Manager' (CAPsMAN) that manages the configuration of the APs, it also takes care of client authentication.

WiFi CAPsMAN only passes wireless configuration to the CAP, all forwarding decisions are left to the CAP itself - there is no CAPsMAN forwarding mode.

Requirements:

  • Any RouterOS device, that supports the WiFi package, can be a controlled wireless access point (CAP) as long as it has at least a Level 4 RouterOS license.
  • WiFi CAPsMAN server can be installed on any RouterOS device that supports the WiFi package, even if the device itself does not have a wireless interface
  • Unlimited CAPs (access points) supported by CAPsMAN

WiFi CAPsMAN can only control WiFi interfaces, and WiFi CAPs can join only WiFi CAPsMAN, similarly, regular CAPsMAN only supports non-WiFi caps.

The CAPs don't send traffic usage information to CAPsMAN.

CAPsMAN - CAP simple configuration example:

CAPsMAN in WiFi uses the same menu as a regular WiFi interface, meaning when you pass configuration to CAPs, you have to use the same configuration, security, channel configuration, etc. as you would for regular WiFi interfaces.

You can configure sub-configuration menus, directly under "/interface/wifi/configuration" or reference previously created profiles in the main configuration profile

CAPsMAN:

#create a security profile
/interface wifi security
add authentication-types=wpa3-psk name=sec1 passphrase=HaveAg00dDay

#create configuraiton profiles to use for provisioning
/interface wifi configuration
add country=Latvia name=5ghz security=sec1 ssid=CAPsMAN_5
add name=2ghz security=sec1 ssid=CAPsMAN2
add country=Latvia name=5ghz_v security=sec1 ssid=CAPsMAN5_v

#configure provisioning rules, configure band matching as needed
/interface wifi provisioning
add action=create-dynamic-enabled master-configuration=5ghz slave-configurations=5ghz_v supported-bands=\
    5ghz-n
add action=create-dynamic-enabled master-configuration=2ghz supported-bands=2ghz-n

#enable CAPsMAN service
/interface wifi capsman
set ca-certificate=auto enabled=yes

CAP:

#enable CAP service, in this case CAPsMAN is on same LAN, but you can also specify "caps-man-addresses=x.x.x.x" here
/interface/wifi/cap set enabled=yes

#set configuration.manager= on the WiFi interface that should act as CAP
/interface/wifi/set wifi1,wifi2 configuration.manager=capsman-or-local

If the CAP is hAP ax2 or hAP ax3, it is strongly recommended to enable RSTP in the bridge configuration, on the CAP

configuration.manager should only be set on the CAP device itself, don't pass it to the CAP or configuration profile that you provision.

The interface that should act as CAP needs additional configuration under "interface/wifi/set wifiX configuration.manager="

CAPsMAN - CAP VLAN configuration example:

In this example, we will assign VLAN10 to our main SSID, and will add VLAN20 for the guest network, ether5 from CAPsMAN is connected to CAP.

CAPs using "wifi-qcom" package can get "vlan-id" via Datapath from CAPsMAN, CAPs using "wifi-qcom-ac" package will need to use the configuration provided at the end of this example.

CAPsMAN:

/interface bridge
add name=br vlan-filtering=yes
/interface vlan
add interface=br name=MAIN vlan-id=10
add interface=br name=GUEST vlan-id=20
/interface wifi datapath
add bridge=br name=MAIN vlan-id=10
add bridge=br name=GUEST vlan-id=20
/interface wifi security
add authentication-types=wpa2-psk,wpa3-psk ft=yes ft-over-ds=yes name=Security_MAIN passphrase=HaveAg00dDay
add authentication-types=wpa2-psk,wpa3-psk ft=yes ft-over-ds=yes name=Security_GUEST passphrase=HaveAg00dDay
/interface wifi configuration
add datapath=MAIN name=MAIN security=Security_MAIN ssid=MAIN_Network
add datapath=GUEST name=GUEST security=Security_GUEST ssid=GUEST_Network
/ip pool
add name=dhcp_pool0 ranges=192.168.1.2-192.168.1.254
add name=dhcp_pool1 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool2 ranges=192.168.20.2-192.168.20.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=yes interface=br name=dhcp1
add address-pool=dhcp_pool1 interface=MAIN name=dhcp2
add address-pool=dhcp_pool2 interface=GUEST name=dhcp3
/interface bridge port
add bridge=br interface=ether5 
add bridge=br interface=ether4 
add bridge=br interface=ether3 
add bridge=br interface=ether2 
/interface bridge vlan
add bridge=br tagged=br,ether5,ether4,ether3,ether2 vlan-ids=20
add bridge=br tagged=br,ether5,ether4,ether3,ether2 vlan-ids=10
/interface wifi capsman
set enabled=yes interfaces=br
/interface wifi provisioning
add action=create-dynamic-enabled master-configuration=MAIN slave-configurations=GUEST supported-bands=5ghz-ax
add action=create-dynamic-enabled master-configuration=MAIN slave-configurations=GUEST supported-bands=2ghz-ax
/ip address
add address=192.168.1.1/24 interface=br network=192.168.1.0
add address=192.168.10.1/24 interface=MAIN network=192.168.10.0
add address=192.168.20.1/24 interface=GUEST network=192.168.20.0
/ip dhcp-server network
add address=192.168.1.0/24 gateway=192.168.1.1
add address=192.168.10.0/24 gateway=192.168.10.1
add address=192.168.20.0/24 gateway=192.168.20.1
/system identity
set name=cAP_Controller

CAP using "wifi-qcom" package:

/interface bridge
add name=bridgeLocal
/interface wifi datapath
add bridge=bridgeLocal comment=defconf disabled=no name=capdp
/interface wifi
set [ find default-name=wifi1 ] configuration.manager=capsman datapath=capdp disabled=no
set [ find default-name=wifi2 ] configuration.manager=capsman datapath=capdp disabled=no
/interface bridge port
add bridge=bridgeLocal comment=defconf interface=ether1
add bridge=bridgeLocal comment=defconf interface=ether2
add bridge=bridgeLocal comment=defconf interface=ether3
add bridge=bridgeLocal comment=defconf interface=ether4
add bridge=bridgeLocal comment=defconf interface=ether5
/interface wifi cap
set discovery-interfaces=bridgeLocal enabled=yes slaves-datapath=capdp
/ip dhcp-client
add interface=bridgeLocal disabled=no

CAP using "wifi-qcom-ac" package:

/interface bridge
add name=bridgeLocal vlan-filtering=yes
/interface wifi
set [ find default-name=wifi1 ] configuration.manager=capsman disabled=no
set [ find default-name=wifi2 ] configuration.manager=capsman disabled=no
add disabled=no  master-interface=wifi1 name=wifi21
add disabled=no  master-interface=wifi2 name=wifi22
/interface bridge port
add bridge=bridgeLocal comment=defconf interface=ether1
add bridge=bridgeLocal comment=defconf interface=ether2
add bridge=bridgeLocal comment=defconf interface=ether3
add bridge=bridgeLocal comment=defconf interface=ether4
add bridge=bridgeLocal comment=defconf interface=ether5
add bridge=bridgeLocal interface=wifi1 pvid=10
add bridge=bridgeLocal interface=wifi21 pvid=20
add bridge=bridgeLocal interface=wifi2 pvid=10
add bridge=bridgeLocal interface=wifi22 pvid=20
/interface bridge vlan
add bridge=bridgeLocal tagged=ether1 untagged=wifi1,wifi2 vlan-ids=10
add bridge=bridgeLocal tagged=ether1 untagged=wifi21,wifi22 vlan-ids=20
/interface wifi cap
set discovery-interfaces=bridgeLocal enabled=yes slaves-static=yes

Additionally, the configuration below has to be added to the CAPsMAN configuration:

/interface wifi datapath
add bridge=br name=DP_AC
/interface wifi configuration
add datapath=DP_AC name=MAIN_AC security=Security_MAIN ssid=MAIN_Network
add datapath=DP_AC name=GUEST_AC security=Security_GUEST ssid=GUEST_Network
/interface wifi provisioning
add action=create-dynamic-enabled master-configuration=MAIN_AC slave-configurations=GUEST_AC supported-bands=5ghz-ac
add action=create-dynamic-enabled master-configuration=MAIN_AC slave-configurations=GUEST_AC supported-bands=2ghz-n

Passing datapaths "MAIN/GUEST" from the start of the example to "wifi-qcom-ac" CAP would be misconfiguration, make sure to use datapath without "vlan-id" specified to such devices.

Advanced examples

Enterprise wireless security with User Manager v5

Replacing 'wireless' package

Some MikroTik Wi-Fi 5 APs, which ship with their interfaces managed by the 'wireless' menu, can install the additional 'wifi-qcom-ac' package to make their interfaces compatible with the 'wifi' menu instead.

To do this, it is necessary to uninstall the 'wireless' package, then install 'wifi-qcom-ac'.

Compatibility

The wifi-qcom-ac package includes alternative drivers for IPQ4018/4019 and QCA9984 radios that make them compatible with the WiFi configuration menu. For possible, wifi-qcom-ac/wifi-qcom/wireless, package combinations, please see the package types section here.

As a rule of thumb, the package is compatible with 802.11ac products, which have an ARM CPU. It is NOT compatible with any of our 802.11ac products which have a MIPS CPU.

CompatibilityDevices
CompatibleAudience, Audience LTE kit, Chateau (all variants of D53), hAP ac^2, hAP ac^3, cAP ac, cAP XL ac, LDF 5 ac, LHG XL 5 ac, LHG XL 52 ac, NetMetal ac^2, mANTBox 52 15s, wAP ac (RBwAPG-5HacD2HnD), SXTsq 5 ac
IncompatibleRB4011iGS+5HacQ2HnD-IN (no support for the 2.4GHz interface), Cube 60Pro ac (no support for 60GHz interface), wAP ac (RBwAPG-5HacT2HnD) and all other devices with a MIPSBE CPU

Benefits

  • WPA3 authentication and OWE (opportunistic wireless encryption)
  • 802.11w standard management frame protection
  • 802.11r/k/v
  • MU-MIMO and beamforming
  • 400Mb/s maximum data rate in the 2.4GHz band for IPQ4019 interfaces

These benefits apply both to the wifi-qcom and wifi-qcom-ac packages.

Lost features

The following notable features are lost when running 802.11ac products with drivers that are compatible with the 'wifi' management interface

  • Nstreme and Nv2 wireless protocols
  • VLAN configuration in the wireless settings (Per-interface VLANs can be configured in bridge settings)
  • Compatibility with station-bridging as implemented in the 'wireless' package, station-bridge only works between the same type of drivers. Wifi to Wifi, and Wireless to Wireless.

Property Reference

AAA properties

Properties in this category configure an access point's interaction with AAA (RADIUS) servers.

Certain parameters in the table below take format-string as their value. In a format-string, certain characters are interpreted in the following way:

CharacterInterpretation
aHexadecimal character making up the MAC address of the client device in lowercase
AHexadecimal character making up the MAC address of the client device in upper case
iHexadecimal character making up the MAC address of the AP's interface in lowercase
I (capital 'i') Hexadecimal character making up the MAC address of the AP's interface in upper case
NThe entire name of the AP's interface (e.g. 'wifi1')
SThe entire SSID

All other characters are used without interpreting them in any way. For examples, see default values.

Property

Description

called-format (format-string)

Format for the value of the Called-Station-Id RADIUS attribute, in AP's messages to RADIUS servers. Default: II-II-II-II-II-II:S

calling-format (format-string)Format for the value of the Calling-Station-Id RADIUS attribute, in AP's messages to RADIUS servers. Default: AA-AA-AA-AA-AA-AA
interim-update (time interval)Interval at which to send interim updates about traffic accounting to the RADIUS server. Default: 5m
mac-caching (time interval | 'disabled')

Length of time to cache RADIUS server replies, when MAC address authentication is enabled.
This resolves issues with client device authentication timing out due to (comparatively high latency of RADIUS server replies.

Default value: disabled.

name (string)A unique name for the AAA profile. No default value.
nas-identifier (string) Value of the NAS-Identifier attribute, in AP's messages to RADIUS servers. Defaults to the host name of the device (/system/identity).
password-format (format-string)

Format for value to use in calculating the value of the User-Password attribute in AP's messages to RADIUS servers when performing MAC address authentication.

Default value: "" (an empty string).

username-format (format-string)

Format for the value of the User-Name attribute in APs messages to RADIUS servers when performing MAC address authentication.

Default value : AA:AA:AA:AA:AA:AA

Channel properties

Properties in this category specify the desired radio channel.

PropertyDescription
band (2ghz-g | 2ghz-n | 2ghz-ax | 5ghz-a | 5ghz-ac | 5ghz-an | 5ghz-ax)

Frequency band and wireless standard that will be used by the AP. Defaults to newest supported standard.
Note that band support is limited by radio capabilities.

frequency (list of integers or integer ranges)

For an interface in AP mode, specifies frequencies (in MHz) to consider when picking control channel center frequency.

For an interface in station mode, specifies frequencies on which to scan for APs.

Leave unset (default) to consider all frequencies supported by the radio and permitted by the applicable regulatory profille.

The parameter can contain 1 or more comma-separated values of integers or, optionally, ranges of integers denoted using the syntax RangeBeginning-RangeEnd:RangeStep

Examples of valid channel.frequency values:

  • 2412
  • 2412,2432,2472
  • 5180-5240:20,5500-5580:20
secondary-frequency (list of integers | 'disabled') 

Frequency (in MHz) to use for the center of the secondary part of a split 80+80MHz channel.

Only official 80MHz channels (5210, 5290, 5530, 5610, 5690, 5775) are supported.

Leave unset (default) for automatic selection of secondary channel frequency.

skip-dfs-channels  (10min-cac | all | disabled)

Whether to avoid using channels, on which channel availability check (listening for presence of radar signals) is required.

  • 10min-cac - interface will avoid using channels, on which 10 minute long CAC is required
  • all - interface will avoid using all channels, on which CAC is required
  • disabled (default) - interface may select any supported channel, regardless of CAC requirements
width ( 20mhz | 20/40mhz | 20/40mhz-Ce | 20/40mhz-eC | 20/40/80mhz | 20/40/80+80mhz20/40/80/160mhz)

Width of radio channel. Defaults to widest channel supported by the radio hardware.

reselect-interval (time interval)

Specifies when the interface should rescan channel availability and select the most appropriate one to use. Specifying intervall will allow the system to select this interval dynamically and randomly. This helps to avoid a situation when many APs at the same time scan network, select the same channel and prefer to use it at the same time.

Configuration properties

This section includes properties relating to the operation of the interface and the associated radio.

PropertyDescription

antenna-gain (integer 0..30)

Overrides the default antenna gain. The master interface of each radio sets the antenna gain for every interface which uses the same radio.

This setting cannot override the antenna gain to be lower than the minimum antenna gain of a radio.
No default value.

beacon-interval (time interval 100ms..1s)

Interval between beacon frames of an AP. Default: 100ms.

The 802.11 standard defines beacon interval in terms of time units (1 TU = 1.024 ms). The actual interval between beacons will be 1 TU for every 1 ms configured.

Every AP running on the same radio (i.e. a master AP and all its 'virtual'/'slave' APs) must use the same beacon interval.

chains (list of integer 0..7 )

Radio chains to use for receiving signals. Defaults to all chains available to the corresponding radio hardware.

country (name of a country)

Determines, which regulatory domain restrictions are applied to an interface. Defaults to "Latvia".

It is important to set this value correctly to comply with local regulations and ensure interoperability with other devices.

distance ()

Maximum link distance in kilometers, needs to be set for long-range outdoor links. The value should reflect the distance to the AP or station that is furthest from the device. Unconfigured value allows usage of 2 km links. 

distance is not used by the wifi-qcom-ac package. Setting distance above the actual needed value can have detrimental effects on throughput and latency.

dtim-period (integer 1..255)

Period at which to transmit multicast traffic, when there are client devices in power save mode connected to the AP. Expressed as a multiple of the beacon interval.

Higher values enable client devices to save more energy, but increase network latency.

Default: 1

hide-ssid (no | yes)

  • yes - AP does not include its SSID in beacon frames, and does not reply to probe requests that have broadcast SSID.

  • no - AP includes its SSID in the beacon frames, and replies to probe requests that have broadcast SSID.

Default: no

manager (capsman | capsman-or-local | local)

capsman - the interface will act as CAP only, this option should not be passed via provisioning rules to the CAP

capsman-or-local - the interface will get configuration via CAPsMAN or use its own, if /interface/wifi/cap is not enabled.

local - interface won't contact CAPsMAN in order to get configuration.

Default: local

mode (ap | station)

Interface operation mode

  • ap (default) - interface operates as an access point
  • station - interface acts as a client device, scanning for access points advertising the configured SSID
  • station-bridge - interface acts as a client device and enables support for a 4-address frame format, so that the interface can be used as a bridge port

The station-bridge mode, as implemented for 'wifi' interfaces, is incompatible with APs running the older 'wireless' package and vice versa.


multicast-enhance (enabled disabled)

With the multicast-enhance feature enabled, an AP will convert every multicast-addressed IP or IPv6 packet into multiple unicast-addressed frames for each connected station.
This may improve link throughput and reliability since, unlike multicast frames, unicasts are acknowledged by stations and transmitted using a higher data rate.

Default: disabled

qos-classifier (dscp-high-3-bits priority)
  • dscp-high-3-bits - interface will transmit data packets using a WMM priority equal to the value of the 3 most significant bits of the IP DSCP field
  • priority - interface will transmit data packets using a WMM priority equal to that set by IP firewall or bridge filter

Default: priority

802.11ac wireless chipsets do not support the dscp-high-3-bits classifier mode. For 802.11ac interfaces, please see DSCP from priority.


ssid (string)The name of the wireless network, aka the (E)SSID. No default value.
tx-chains (list of integer 0..7)Radio chains to use for transmitting signals. Defaults to all chains available to the corresponding radio hardware.
tx-power (integer 0..40)A limit on the transmit power (in dBm) of the interface. Can not be used to set power above limits imposed by the regulatory profile. Unset by default.

Datapath properties

Parameters relating to forwarding packets to and from wireless client devices.

PropertyDescription
bridge (bridge interface)Bridge interface to add interface to, as a bridge port.
Virtual ('slave') interfaces are by default added to the same bridge, if any, as the corresponding master interface. Master interfaces are not by default added to any bridge.
bridge-cost (integer)Bridge port cost to use when adding as bridge port. Default: 10
bridge-horizon (none | integer)Bridge horizon to use when adding as bridge port Default: none.
client-isolation  (no | yes)Determines whether client devices connecting to this interface are (by default) isolated from others or not.
This policy can be overridden on a per-client basis using access list rules, so a an AP can have a mixture of isolated and non-isolated clients.
Traffic from an isolated client will not be forwarded to other clients and unicast traffic from a non-isolated client will not be forwarded to an isolated one.
Default: no
interface-list (interface list)
List to which add the interface as a member. No default value.
vlan-id (none | integer 1..4095)

Default VLAN ID to assign to client devices connecting to this interface (only relevant to interfaces in AP mode).
When a client is assigned a VLAN ID, traffic coming from the client is automatically tagged with the ID and only packets tagged with with this ID are forwarded to the client.
Default: none

802.11ac chipsets do not support this type of VLAN tagging , but they can be configured as VLAN access ports in bridge settings.

Security Properties

Parameters relating to authentication.

PropertyDescription

authentication-types (list of wpa-psk, wpa2-psk, wpa-eap, wpa2-eap, wpa3-psk, owe, wpa3-eap, wpa3-eap-192)

Authentication types to enable on the interface.

The default value is an empty list (no authentication, an open network).

Configuring a passphrase adds to the default list the wpa2-psk authentication method (if the interface is an AP) or both wpa-psk and wpa2-psk (if the interface is a station).

Configuring an eap-username and an eap-password adds to the default list wpa-eap and wpa2-eap authentication methods.

connect-groupstring )

APs within the same connect group do not allow more than 1 client device with the same MAC address. This is to prevent malicious authorized users from intercepting traffic intended to other users ('MacStealer' attack) or performing a denial of service attack by spoofing the MAC address of a victim.

Handling of new connections with duplicate MAC addresses depends on the connect-priority of AP interfaces involved.

By default, all APs are assigned the same connect-group.

connect-priority (accept-priority/hold-priority (integers))

These parameters determine, how a connection is handled if the MAC address of the client device is the same as that of another active connection to another AP.
If (accept-priority of AP2) < (hold-priority of AP1), a connection to AP2 wil cause the client to be dropped from AP1.
If (accept-priority of AP2) = (hold-priority of AP1), a connection to AP2 will be allowed only if the MAC address can no longer be reached via AP1.
If (accept-priority of AP2) > (hold-priority of AP1), a connection to AP2 will not be accepted.

If omitted, hold-priority is the same as accept-priority.
By default, APs, which perform user authentication, have higher priority (lower integer value), than open APs.

dh-groups (list of 19, 20, 21)

Identifiers of elliptic curve cryptography groups to use in SAE (WPA3) authentication.

disable-pmkid (no | yes)For interfaces in AP mode, disables inclusion of a PMKID in EAPOL frames. Disabling PMKID can cause compatibility issues with client devices that make use of it.
  • yes - Do not include PMKID in EAPOL frames.
  • no (default) - include PMKID in EAPOL frames.
eap-accounting (no | yes)Send accounting information to RADIUS server for EAP-authenticated peers. Default: no.
Properties related to EAP, are only relevant to interfaces in station mode. APs delegate (passthrough) EAP authentication to the RADIUS server.
eap-anonymous-identity (string)Optional anonymous identity for EAP outer authentication. No default value.
eap-certificate-mode (dont-verify-certificate | no-certificates | verify-certificate | verify-certificate-with-crl)

Policy for handling the TLS certificate of the RADIUS server.

  • verify-certificate - require server to have a valid certificate. Check that it is signed by a trusted certificate authority.
  • dont-verify-certificate (default) - Do not perform any checks on the certificate.
  • no-certificates - Attempt to establish the TLS tunnel by performing anonymous Diffie-Hellman key exchange. To be used if the RADIUS server has no certificate at all.
  • verify-certificate-with-crl - Same as verify-certificate, but also checks if the certificate is valid by checking the Certificate Revocation List.
eap-methods (list of peap, tls, ttls)EAP methods to consider for authentication. Defaults to all supported methods.
eap-password (string)Password to use, when the chosen EAP method requires one. No default value.
eap-tls-certificate (certificate)Name or id of a certificate in the device's certificate store to use, when the chosen EAP authentication method requires one. No default value.
eap-username (string)Username to use when the chosen EAP method requires one. No default value.

Take care when configuring encryption ciphers.

All client devices MUST support the group encryption cipher used by the AP to connect, and some client devices (notably, Intel® 8260) will also fail to connect if the list of unicast ciphers includes any they don't support.

encryption (list of  ccmp, ccmp-256, gcmp, gcmp-256, tkip)

A list of ciphers to support for encrypting unicast traffic.

Defaults to ccmp.

Properties related to 802.11r fast BSS transition only apply to interfaces in AP mode. WiFi interfaces in station mode do not support 802.11r.

For a client device to successfully roam between 2 APs, the APs need to be managed by the same instance of RouterOS. For information on how to centrally manage multiple APs, see CAPsMAN

ft (no | yes)

Whether to enable 802.11r fast BSS transitions ( roaming). Default: no.

ft-mobility-domain (integer 0..65535

The fast BSS transition mobility domain ID. Default: 44484 (0xADC4).

ft-nas-identifier (string of 2..96 hex characters)

Fast BSS transition PMK-R0 key holder identifier. Default: MAC address of the interface.

ft-over-ds (no | yes

 Whether to enable fast BSS transitions over DS (distributed system). Default: no.

ft-preserve-vlanid (no | yes )
  • no - when a client connects to this AP via 802.11r fast BSS transition, it is assigned a VLAN ID according to the access and/or interface settings
  • yes (default) - when a client connects to this AP via 802.11r fast BSS transition, it retains the VLAN ID, which it was assigned during initial authentication

The default behavior is essential when relying on a RADIUS server to assign VLAN IDs to users, since a RADIUS server is only used for initial authentication.

ft-r0-key-lifetime (time interval 1s..6w3d12h15m)

Lifetime of the fast BSS transition PMK-R0 encryption key. Default: 600000s (~7 days)

ft-reassociation-deadline (time interval 0..70s

Fast BSS transition reassociation deadline. Default: 20s.

group-encryption (ccmp | ccmp-256 | gcmp | gcmp-256 | tkip)

Cipher to use for encrypting multicast traffic.

Defaults to ccmp.

group-key-update (time interval)

Interval at which the group temporal key (key for encrypting broadcast traffic) is renewed. Defaults to 24 hours.

management-encryption (cmac | cmac-256 | gmac | gmac-256)

Cipher to use for encrypting protected management frames. Defaults to cmac.

management-protection (allowed | disabled | required)

Whether to use 802.11w management frame protection. Incompatible with management frame protection in standard wireless package.

The default value depends on the value of the selected authentication type. WPA2 allows the use of management protection, WPA3 requires it.

owe-transition-interface (interface)

Name or internal id of an interface whose MAC address and SSID to advertise as the matching AP when running in OWE transition mode.

Required for setting up open APs that offer OWE, but also work with older devices that don't support the standard. See configuration example below.

passphrase (string of up to 63 characters)

The passphrase to use for PSK authentication types. Defaults to an empty string - "".

WPA-PSK and WPA2-PSK authentication requires a minimum of 8 chars, while WPA3-PSK does not have a minimum passphrase length.

sae-anti-clogging-threshold ('disabled' | integer)

Due to SAE (WPA3) associations being CPU resource intensive, overwhelming an AP with bogus authentication requests makes for a feasible denial-of-service attack.

This parameter provides a way to mitigate such attacks by specifying a threshold of in-progress SAE authentications, at which the AP will start requesting that client devices include a cookie bound to their MAC address in their authentication requests. It will then only process authentication requests that contain valid cookies.

Default: 5.

sae-max-failure-rate ('disabled' | integer)Rate of failed SAE (WPA3) associations per minute, at which the AP will stop processing new association requests. Default: 40.
sae-pwe (both | hash-to-element | hunting-and-pecking)Methods to support for deriving SAE password element. Default: both.
wps (disabled | push-button)
  • push-button (default) - AP will accept WPS authentication for 2 minutes after 'wps-push-button' command is called. Physical WPS button functionality not yet implemented.
  • disabled - AP will not accept WPS authentication

Steering properties

Properties in this category govern mechanisms for advertising potential roaming candidates to client devices.

PropertyDescription
neighbor-group (string

When sending neighbor reports and BSS transition management requests, an AP will list all other APs within its neighbor group as potential roaming candidates. 

By default, a dynamic neighbor group is created for each set of APs with the same SSID and authentication settings.
APs operating in the 5GHz band are indicated to be preferable to ones operating in the 2.4GHz band.

rrm (no | yes)Enables sending of 802.11k neighbor reports. Default: yes
wnm (no | yes)Enables sending of solicited 802.11v BSS transition management requests. Default: yes

Miscellaneous properties

PropertyDescription
arp (disabled | enabled | local-proxy-arp  | proxy-arp | reply-only)Address Resolution Protocol mode:
  • disabled - the interface will not use ARP
  • enabled - the interface will use ARP (default)
  • local-proxy-arp - the router performs proxy ARP on the interface and sends replies to the same interface
  • proxy-arp - the router performs proxy ARP on the interface and sends replies to other interfaces
  • reply-only - the interface will only reply to requests originated from matching IP address/MAC address combinations which are entered as static entries in the ARP table. No dynamic entries will be automatically stored in the ARP table. Therefore for communications to be successful, a valid static entry must already exist.
arp-timeout (time interval | 'auto')Determines how long a dynamically added ARP table entry is considered valid since the last packet was received from the respective IP address.
Value auto equals to the value of arp-timeout in /ip settings, which defaults to 30s.
disable-running-check (no | yes)
  • yes - interface's running property will be true whenever the interface is not disabled

  • no (default) - interface's running property will only be true when it has established a link to another device

disabled (no | yes) (X)

Hardware interfaces are disabled by default. Virtual interfaces are not.

mac-address (MAC)

MAC address (BSSID) to use for an interface.

Hardware interfaces default to the MAC address of the associated radio interface.

Default MAC addresses for virtual interfaces are generated by

  1. Taking the MAC address of the associated master interface

  2. Setting the second-least-significant bit of the first octet to 1, resulting in a locally administered MAC address

  3. If needed, increment the last octet of the address to ensure it doesn't overlap with the address of another interface on the device

mtu (integer [32..2290]; Default: 1500)

Layer 3 Maximum transmission unit.

l2mtu (integer [32..2290]; Default: 2290)

Layer 2 Maximum transmission unit. 

master-interface (interface)

Multiple interface configurations can be run simultaneously on every wireless radio.

Only one of them determines the radio's state (whether it is enabled, what frequency it's using, etc). This  'master' interface, is bound to a radio with the corresponding radio-mac.

To create additional ('virtual') interface configurations on a radio, they need to be bound to the corresponding master interface.

No default value.

name (string)

A name for the interface. Defaults to wifiN, where N is the lowest integer that has not yet been used for naming an interface.

Read-only properties

PropertyDescription
bound (boolean) (B)

True for master interfaces that are currently available for WiFi manager.

True for a virtual interface (configurations linked to a master interface) when both the interface itself and its master interface are not disabled and the master interface has a bound flag.

default-name (string)The default name for an interface.
inactive (boolean) (I)

False for interfaces in AP mode when they've selected a channel for operation (i.e. configuration has been successfully applied).

False for interfaces in station mode when they've connected to an AP (i.e. configuration has been successfully applied, and an AP with matching settings has been found).

True otherwise.

master (boolean) (M)

True for physical interfaces on the router itself or detected CAP if running as CAPsMAN.

False for virtual interfaces.

radio-mac (MAC)The MAC address of the associated radio.
running (boolean) (R)

True, when an interface has established a link to another device.

If disable-running-check is set to 'yes', true whenever the interface is not disabled.

Access List

Filtering parameters

ParameterDescription
interface (interface | interface-list | 'any')Match if connection takes place on the specified interface or interface belonging to a specified list. Default: any.
mac-address (MAC address)Match if the client device has the specified MAC address. No default value.
mac-address-mask (MAC address)

Modifies the mac-address parameter to match if it is equal to the result of performing bit-wise AND operation on the client MAC address and the given address mask.

Default: FF:FF:FF:FF:FF:FF (i.e. client's MAC address must match value of mac-address exactly)

signal-range (min..max)Match if the strength of the received signal from the client device is within the given range. Default: '-120..120'
ssid-regexp (regex)Match if the given regular expression matches the SSID.
time (start-end,days)Match during the specified time of day and (optionally) days of week. Default: 0s-1d


Action parameters

ParameterDescription
allow-signal-out-of-range (time period | 'always')

The length of time which a connected peer's signal strength is allowed to be outside the range required by the signal-range parameter, before it is disconnected.

If the value is set to 'always', peer signal strength is only checked during association.

Default: 0s.

action (accept | reject | query-radius)

Whether to authorize a connection

  • accept - connection is allowed
  • reject - connection is not allowed
  • query-radius -  connection is allowed if MAC address authentication of the client's MAC address succeeds

Default: accept

client-isolation (no | yes)

Whether to isolate the client from others connected to the same AP. No default value.

passphrase (string)Override the default passphrase with given value. No default value.
radius-accounting (no | yes)Override the default RADIUS accounting policy with given value. No default value.
vlan-id ( none | integer 1..4095 )Assign the given VLAN ID to matched clients. No default value.

Frequency scan

Information about RF conditions on available channels can be obtained by running the frequency-scan command.

Command parameters
ParameterDescription
duration (time interval)Length of time to perform the scan for before exiting. Useful for non-interactive use. Not set by default.
freeze-frame-interval (time interval)Time interval at which to update command output. Default: 1s.
frequency (list of frequencies/ranges)Frequencies to perform the scan on. See channel.frequency parameter syntax above for more detail. Defaults to all supported frequencies.
number (string)Either the name or internal id of the interface to perform the scan with. Required. Not set by default.
rounds (integer)Number of times to go through list of scannable frequencies before exiting. Useful for non-interactive use. Not set by default.
save-file (string)Name of file to save output to. Not set by default.


Output parameters
ParameterDescription
channel (integer)Frequency (in MHz) of the channel scanned.
networks (integer)

Number of access points detected on the channel.

load (integer)Percentage of time the channel was busy during the scan.
nf (integer)Noise floor (in dBm) of the channel.
max-signal (integer)Maximum signal strength (in dBm) of APs detected in the channel.
min-signal (integer)Minimum signal strength (in dBm) of APs detected in the channel.
primary (boolean) (P)Channel is in use as the primary (control) channel by an AP.
secondary (boolean) (S)Channel is in use as a secondary (extension) channel by an AP.

Flat-snoop

The '/interface wifi flat-snoop' is a tool for surveying APs and stations. Monitors frequency usage, and displays which devices occupy each frequency. Provides more detailed infromation regarding nearby APs than scan, and offers easy overview of frequency usage by station/AP count.

Output parameters
ParameterDescription
duration (time interval)Length of time to perform the scan before exiting. Useful for non-interactive use. Not set by default.
filter-type (bsss |frequency |stas)

bsss - list of active APs and their parameters.

frequency - list of station and AP count per scanned frequency

stas - a detailed list of stations on each scanned frequency

If filter-type is unspecified all types will be returned.

freeze-frame-interval (time interval)Time interval at which to update command output. Default: 1s.

Scan command

The '/interface wifi scan' command will scan for access points and print out information about any APs it detects.

The scan command takes all the same parameters as the frequency-scan command.

Output parameters
ParameterDescription
active (boolean) (A)This signifies that beacons from the AP have been received in the last 30 seconds.
address (MAC)The MAC address (BSSID) of the AP.
channel (string)The control channel frequency used by the AP, its supported wireless standards and control/extension channel layout.

security (string)

Authentication methods supported by the AP.

signal (integer)The signal strength of the AP's beacons (in dBm).
ssid (string)The extended service set identifier of the AP.
sta-count (integer)The number of client devices associated with the AP. Only available if the AP includes this information in its beacons.

Sniffer

Command parameters
ParameterDescription
duration (time interval)Automatically interrupt the sniffer after the specified time has passed. No default value.
filter (string)

A string that specifies a filter to apply to captured frames. Only frames matched by the filter expression will be displayed, saved or streamed.

This works similarly to filter strings in libpcap, for example.

The filter can match

  • Address fields (addr1, addr2, addr3)
  • Wireless frame type and subtype, including shortcuts such as 'beacon' (type == 0 && subtype == 8)
  • Flags (to-ds, from-ds, retry, power, protected)

A string can include the following operators:

  • == (exact match)
  • != (does not equal)
  • && (logical AND)
  • || (logical OR)
  • () (for grouping filter expressions)

number (interface)

Interface to use for sniffing.
pcap-file (string)Save captured frames to a file with the given name. No default value (captured frames are not saved to a file by default).
pcap-size-limit (integer)File size limit (in bytes) when storing captured frames locally.
When this limit has been reached, no new frames are added to the capture file. No default value.
stream-address (IP address)Stream captured packets via the TZSP protocol to the given address. No default value (captured packets are not streamed anywhere by default).
stream-rate (integer)Limit the rate (in packets per second) at which captured frames are streamed via TZSP.

WPS

interface/wifi/wps-client wifi

Command parameters
ParameterDescription
duration (time interval)Length of time after which the command will time out if no AP is found. Unlimited by default.
interval (time interval)Time interval at which to update command output. Default: 1s.
mac-address (MAC)Only attempt connecting to AP with the specified MAC (BSSID). Not set by default.
number (string)Name or internal id of the interface with which to attempt a connection. Not set by default.
ssid (string)Only attempt to connect to APs with the specified SSID. Not set by default.

Radios

Information about the capabilities of each radio can be gained by running the `/interface/wifi/radio print detail` command.

PropertyDescription
2g-channels (list of integers)Frequencies supported in the 2.4GHz band.
5g-channels (list of integers)Frequencies supported in the 5GHz band.
bands (list of strings)Supported frequency bands, wireless standards, and channel widths.
ciphers (list of strings)Supported encryption ciphers.
countries (list of strings)Regulatory domains supported by the interface.
hw-caps (list of strings)Additional supported features (e.g. sniffer, qos-classifier-dscp).
hw-type (string)Radio hardware model number.
max-interfaces (integer)Maximum number of logical interfaces.
max-peers (integer)Maximum number of associated peers (connected stations).
max-station-interfaces (integer)Maximum number of logical interfaces in station mode.
max-vlans (integer)Maximum number of different per-user VLANs.
min-antenna-gain (integer)Minimum antenna gain permitted for the interface.
phy-id (string)

A unique identifier.

radio-mac (MAC)MAC address of the radio interface. Can be used to match radios to interface configurations.
rx-chains (list of integers)IDs for radio chains available for receiving radio signals.
tx-chains (list of integers)IDs for radio chains available for transmitting radio signals.

Registration table

The registration table contains read-only information about associated wireless devices.

ParameterDescription
authorized (boolean) (A)True when the peer has successfully authenticated.
bytes (list of integers)Number of bytes in packets transmitted to a peer and received from it.
interface (string)Name of the interface, which was used to associate with the peer.
mac-address (MAC)The MAC address of the peer.
packets (list of integers)Number of packets transmitted to a peer and received from it.
rx-rate (string)Bitrate of received transmissions from peer.
signal (integer)

Strength of signal received from the peer (in dBm).

tx-rate (string)Bitrate used for transmitting to the peer.
uptime (time interval)Time since association.

CAPsMAN Global Configuration

Menu: /interface/wifi/capsman

PropertyDescription
ca-certificate (auto | certificate name )Device CA certificate, CAPsMAN server requires a certificate, certificate on CAP is optional.
certificate (auto | certificate name | none; Default: none)Device certificate
enabled (no | yes)

Disable or enable CAPsMAN functionality

package-path (string |; Default: )

Folder location for the RouterOS packages. For example, use "/upgrade" to specify the upgrade folder from the files section. If an empty string is set, CAPsMAN can use built-in RouterOS packages, note that in this case only CAPs with the same architecture as CAPsMAN will be upgraded.

require-peer-certificate (yes | no; Default: no)

Require all connecting CAPs to have a valid certificate

upgrade-policy (none | require-same-version | suggest-same-upgrade; Default: none)

Upgrade policy options

  • none - do not perform upgrade
  • require-same-version - CAPsMAN suggests to upgrade the CAP RouterOS version and, if it fails it will not provision the CAP. (Manual provision is still possible)
  • suggest-same-version - CAPsMAN suggests to upgrade the CAP RouterOS version and if it fails it will still be provisioned
interfaces (all | interface name | none; Default: all)Interfaces on which CAPsMAN will listen for layer 2 CAP connections

CAPsMAN Provisioning

Provisioning rules for matching radios are configured in /interface/wifi/provisioning/ menu:

PropertyDescription
action (create-disabled | create-enabled | create-dynamic-enabled | none; Default: none)Action to take if rule matches are specified by the following settings:
  • create-disabled - create disabled static interfaces for radio. I.e., the interfaces will be bound to the radio, but the radio will not be operational until the interface is manually enabled;
  • create-enabled - create enabled static interfaces. I.e., the interfaces will be bound to the radio and the radio will be operational;
  • create-dynamic-enabled - create enabled dynamic interfaces. I.e., the interfaces will be bound to the radio, and the radio will be operational;
  • none - do nothing, leaves radio in the non-provisioned state;
comment (string; Default: )Short description of the Provisioning rule
common-name-regexp (string; Default: )Regular expression to match radios by common name. Each CAP's common name identifier can be found under "/interface/wifi/radio" as value "REMOTE-CAP-NAME"
supported-bands (2ghz-ax | 2ghz-g | 2ghz-n | 5ghz-a | 5ghz-ac | 5ghz-ax | 5ghz-n; Default: )Match radios by supported wireless modes. 
identity-regexp (string; Default: )Regular expression to match radios by router identity
address-ranges (IpAddressRange[,IpAddressRanges] max 100x; Default: "")Match CAPs with IPs within the configured address range. Will only work for CAPs that joined CAPsMAN using IP, not MAC address.
master-configuration (string; Default: )If action specifies to create interfaces, then a new master interface with its configuration set to this configuration profile will be created
name-format (string)

Base string to use when constructing names of provisioned interfaces. Each new interface will be created by taking the base string and appending a number to the end of it, a number will only be appended if the string is not unique.

If included in the string, the character sequence %I will be replaced by the system identity of the cAP, %C will be replaced with the cAP's TLS certificate's Common Name, %R, or %r for lowercase, will be replaced with the CAP's radio MAC

Default: "cap-wifi"

radio-mac (MAC address)MAC address of radio to be matched. No default value.
slave-configurations (string; Default: )

If the action specifies to create interfaces, then a new slave interface for each configuration profile in this list is created.

disabled (yes | no; Default: no

Specifies if the provision rule is disabled.

CAP configuration

Menu: /interface/wifi/cap

PropertyDescription
caps-man-addresses (list of IP addresses; Default: empty)List of Manager IP addresses that CAP will attempt to contact during discovery
caps-man-names ()An ordered list of CAPs Manager names that the CAP will connect to, if empty - CAP does not check Manager name
discovery-interfaces (list of interfaces;)List of interfaces over which CAP should attempt to discover Manager

lock-to-caps-man (no | yes; Default: no)

Sets, if CAP should lock to the first CAPsMAN it connects to

slaves-static ()

Creates Static Virtual Interfaces, allows the possibility to assign IP configuration to those interfaces. MAC address is used to remember each static-interface when applying the configuration from the CAPsMAN.

caps-man-certificate-common-names ()

List of Manager certificate CommonNames that CAP will connect to, if empty - CAP does not check Manager certificate CommonName
certificate ()Certificate to use for authenticating
enabled (yes | no; Default: no)Disable or enable the CAP feature
current-caps-man-address ()Shows currently used CAPsMAN address (available since 7.15)
current-caps-man-identity ()Shows currently used CAPsMAN identity (available since 7.15)
slaves-datapath ()


L3 Hardware Offloading

Page edited by Ričards I.

Introduction

Layer 3 Hardware Offloading (L3HW, otherwise known as IP switching or HW routing) allows to offload some router features onto the switch chip. This allows reaching wire speeds when routing packets, which would simply not be possible with the CPU. 

Switch Configuration

To enable Layer 3 Hardware Offloading, set l3-hw-offloading=yes for the switch:

/interface/ethernet/switch set 0 l3-hw-offloading=yes

Switch Port Configuration

Layer 3 Hardware Offloading can be configured for each physical switch port. For example:

/interface/ethernet/switch/port set sfp-sfpplus1 l3-hw-offloading=yes

Note that l3hw settings for switch and ports are different:

  • Setting l3-hw-offloading=no for the switch completely disables offloading - all packets will be routed by CPU.
  • However, setting l3-hw-offloading=no for a switch port only disables hardware routing from/to this particular port. Moreover, the port can still participate in Fastrack connection offloading. 

To enable full hardware routing, enable l3hw on all switch ports:

/interface/ethernet/switch set 0 l3-hw-offloading=yes
/interface/ethernet/switch/port set [find] l3-hw-offloading=yes

To make all packets go through the CPU first, and offload only the Fasttrack connections, disable l3hw on all ports but keep it enabled on the switch chip itself:

/interface/ethernet/switch set 0 l3-hw-offloading=yes
/interface/ethernet/switch/port set [find] l3-hw-offloading=no

Packets get routed by the hardware only if both source and destination ports have l3-hw-offloading=yes. If at least one of them has l3-hw-offloading=no, packets will go through the CPU/Firewall while offloading only the Fasttrack connections.

The next example enables hardware routing on all ports but the upstream port (sfp-sfpplus16). Packets going to/from sfp-sfpplus16 will enter the CPU and, therefore, subject to Firewall/NAT processing.

/interface/ethernet/switch set 0 l3-hw-offloading=yes
/interface/ethernet/switch/port set [find] l3-hw-offloading=yes
/interface/ethernet/switch/port set sfp-sfpplus16 l3-hw-offloading=no

The existing connections may be unaffected by the l3-hw-offloading setting change.

L3HW Settings

Basic Settings

The L3HW Settings menu has been introduced in RouterOS version 7.6.

Sub-menu: /interface ethernet switch l3hw-settings

Property

Description

autorestart (yes | no; Default: no)Automatically restarts the l3hw driver in case of an error. Otherwise, if an error occurs, l3-hw-offloading gets disabled, and the error code is displayed in the switch settings and #monitor. Autorestart does not work for system failures, such as OOM (Out Of Memory).
fasttrack-hw (yes | no; Default: yes (if supported))Enables or disables FastTrack HW Offloading. Keep it enabled unless HW TCAM memory reservation is required, e.g., for dynamic switch ACL rules creation. Not all switch chips support FastTrack HW Offloading (see hw-supports-fasttrack).
ipv6-hw (yes | no; Default: no)Enables or disables IPv6 Hardware Offloading. Since IPv6 routes occupy a lot of HW memory, enable it only if IPv6 traffic speed is significant enough to benefit from hardware routing.
icmp-reply-on-error (yes | no; Default: yes)Since the hardware cannot send ICMP messages, the packet must be redirected to the CPU to send an ICMP reply in case of an error (e.g., "Time Exceeded", "Fragmentation required", etc.). Enabling icmp-reply-on-error helps with network diagnostics but may open potential vulnerabilities for DDoS attacks. Disabling icmp-reply-on-error silently drops the packets on the hardware level in case of an error.

Read-Only Properties

Property

Description

hw-supports-fasttrack (yes | no)Indicates if the hardware (switch chip) supports FastTrack HW Offloading.

Advanced Settings

This menu allows tweaking l3hw settings for specific use cases.

It is NOT recommended to change the advanced L3HW settings unless instructed by MikroTik Support or MikroTik Certified Routing Engineer. Applying incorrect settings may break the L3HW operation.

Sub-menu: /interface ethernet switch l3hw-settings advanced

Property

Description

route-queue-limit-high (number; Default: 256)

The switch driver stops route indexing when route-queue-size (see #monitor) exceeds this value. Lowering this value leads to faster route processing but increases the lag between a route's appearance in RouterOS and hardware memory.

Setting route-queue-limit-high=0 disables route indexing when there are any routes in the processing queue -  the most efficient CPU usage but the longest delay before hardware offloading. Useful when there are static routes only. Not recommended together with routing protocols (such as BGP or OSPF) when there are frequent routing table changes.

route-queue-limit-low (number; Default: 0)

Re-enable route indexing when route-queue-size drops down to this value. Must not exceed the high limit.

Setting route-queue-limit-low=0 tells the switch driver to process all pending routes before the next hw-offloading attempt. While this is the desired behavior, it may completely block the hw-offloading under a constant BGP feed.

shwp-reset-counter  (number; Default: 128)

Reset the Shortest HW Prefix (see ipv4-shortest-hw-prefix / ipv6-shortest-hw-prefix in #monitor) and try the full route table offloading after this amount of changes in the routing table. At a partial offload, when the entire routing table does not fit into the hardware memory and shorter prefixes are redirected to the CPU, there is no need to try offloading route prefixes shorter than SHWP since those will get redirected to the CPU anyway, theoretically. However, significant changes to the routing table may lead to a different index layout and, therefore, a different amount of routes that can be hw-offloaded. That's why it is recommended to do the full table re-indexing occasionally.

Lowering this value may allow more routes to be hw-offloaded but increases CPU usage and vice-versa. Setting shwp-reset-counter=0 always does full re-indexing after each routing table change.

This setting is used only during Partial Offloading and has no effect when ipv4-shortest-hw-prefix=0 (and ipv6, respectively).

partial-offload-chunk (number; Default: 1024, min: 16)

The minimum number of routes for incremental adding in Partial Offloading. Depending on the switch chip model, routes are offloaded either as-is (each routing entry in RouterOS corresponds to an entry in the hardware memory) or getting indexed, and the index entries are the ones that are written into the hardware memory. This setting is used only for the latter during Partial Offloading.

Depending on index fragmentation, a single IPv4 route addition can occupy from -3 to +6 LPM blocks of HW memory (some route addition may lower the amount of required HW memory thanks to index defragmentation). Hence, it is impossible to predict the exact number of routes that may fit in the hardware memory. The switch driver uses a binary split algorithm to find the maximum number of routes that fit in the hardware.

Let's imagine 128k routes, all of them not fitting into the hardware memory. The algorithm halves the number and tries offloading 64k routes. Let's say offloading succeeded. In the next iteration, the algorithm picks 96k, let's say it fails; then 80k - fails again, 72k - succeeds, 76k, etc. until the difference between succeeded and failed numbers drops below the partial-offload-chunk value.

Lowering the partial-offload-chunk value increases the number of hw-offloaded routes but also raises CPU usage and vice-versa.

route-index-delay-min (time; Default: 1s)

The minimum delay between route processing and its offloading. The delay allows processing more routes together and offloading them at once, saving CPU usage. It also makes offloading the entire routing table faster by reducing the per-route processing work. On the other hand, it slows down the offloading of an individual route.

If an additional route is received during the delay, the latter resets to the route-index-delay-min value. Adding more and more routes within the delay keeps resetting the timer until the route-index-delay-max is reached.

route-index-delay-max (time; Default: 10s)

The maximum delay between route processing and its offloading. When the maximum delay is reached, the processed routes get offloaded despite more routes pending. However, route-queue-limit-high has higher priority than this, meaning that the indexing/offloading gets paused anyway when a certain queue size is reached.

neigh-keepalive-interval (time; Default: 15s, min: 5s)

Neighbor (host) keepalive interval. When a host (IP neighbor) gets hw-offloaded, all traffic from/to it is routed by the switch chip, and RouterOS may think the neighbor is inactive and delete it. To prevent that, the switch driver must keep the offloaded neighbors alive by sending periodical refreshes to RouterOS.

neigh-discovery-interval (time; Default: 1m37s, min: 30s)

Unfortunately, switch chips do not provide per-neighbor stats. Hence, the only way to check if the offloaded host is still active is by sending occasional ARP (IPv4) / Neighbor Discovery (IPv6) requests to the connected network. Increasing the value lowers the broadcast traffic but may leave inactive hosts in hardware memory for longer.

Neighbor discovery is triggered within the neighbor keepalive work. Hence, the discovery time is rounded up to the next keepalive session. Choose a value for neigh-discovery-interval not dividable by neigh-keepalive-interval to send ARP/ND requests in various sessions, preventing broadcast bursts.

neigh-discovery-burst-limit (number; Default: 64)

The maximum number of ARP/ND requests that can be sent at once.

neigh-discovery-burst-delay (time; Default: 300ms, min: 10ms)

The delay between ARP/ND subsequent bursts if the number of requests exceeds neigh-discovery-burst-limit.


Some settings only apply to certain switch models.

Monitor

The L3HW Monitor feature has been introduced in RouterOS version 7.10. It allows monitoring of switch chip and driver stats related to L3HW. 

/interface/ethernet/switch/l3hw-settings/monitor
        ipv4-routes-total: 99363
           ipv4-routes-hw: 61250
          ipv4-routes-cpu: 38112
  ipv4-shortest-hw-prefix: 24
               ipv4-hosts: 87
        ipv6-routes-total: 15
           ipv6-routes-hw: 11
          ipv6-routes-cpu: 4
  ipv6-shortest-hw-prefix: 0
               ipv6-hosts: 7
         route-queue-size: 118
     fasttrack-ipv4-conns: 2031
   fasttrack-hw-min-speed: 0
              nexthop-cap: 8192
            nexthop-usage: 93

Stats

Property

Description

ipv4-routes-totalThe total number of IPv4 routes handled by the switch driver.
ipv4-routes-hwThe number of hardware-offloaded IPv4 routes (a.k.a. hardware routes)
ipv4-routes-cpuThe number of IPv4 routes redirected to the CPU (a.k.a. software routes)
ipv4-shortest-hw-prefixShortest Hardware Prefix (SHWP) for IPv4. If the entire IPv4 routing table does not fit into the hardware memory, partial offloading is applied, where the longest prefixes are hw-offloaded while the shorter ones are redirected to the CPU. This field shows the shortest route prefix (/x) that is offloaded to the hardware memory. All prefixes shorter than this are processed by the CPU. "ipv4-shortest-hw-prefix=0" means the entire IPv4 routing table is offloaded to the hardware memory.
ipv4-hostsThe number of hardware-offloaded IPv4 hosts (/32 routes)
ipv6-routes-total 1The total number of IPv6 routes handled by the switch driver.
ipv6-routes-hw 1The number of hardware-offloaded IPv6 routes (a.k.a. hardware routes)
ipv6-routes-cpu 1The number of IPv6 routes redirected to the CPU (a.k.a. software routes)
ipv6-shortest-hw-prefix 1Shortest Hardware Prefix (SHWP) for IPv6. If the entire IPv6 routing table does not fit into the hardware memory, partial offloading is applied, where the longest prefixes are hw-offloaded while the shorter ones are redirected to the CPU. This field shows the shortest route prefix (/x) that is offloaded to the hardware memory. All prefixes shorter than this are processed by the CPU. "ipv6-shortest-hw-prefix=0" means the entire IPv6 routing table is offloaded to the hardware memory.
ipv6-hosts 1The number of hardware-offloaded IPv6 hosts (/128 routes)
route-queue-sizeThe number of routes in the queue for processing by the switch chip driver. Under normal working conditions, this field is 0, meaning that all routes are processed by the driver.
fasttrack-ipv4-conns 2The number of hardware-offloaded FastTrack connections.
fasttrack-hw-min-speed 2When the hardware memory for storing FastTrack is full, this field shows the minimum speed (in bytes per second) of a hw-offloaded FastTrack connection. Slower connections are routed by the CPU.

1 IPv6 stats appear only when IPv6 hardware routing is enabled (ipv6-hw=yes)

2 FastTrack stats appear only when hardware offloading of FastTrack connections is enabled (fasttrack-hw=yes)

Advanced Monitor

An enhanced version of Monitor with extra telemetry data for advanced users. Advanced Monitor contains all data from the basic monitor plus the fields listed below.

/interface/ethernet/switch/l3hw-settings/advanced> monitor once
        ipv4-routes-total: 29968
           ipv4-routes-hw: 29957
          ipv4-routes-cpu: 11
  ipv4-shortest-hw-prefix: 0
               ipv4-hosts: 3
        ipv6-routes-total: 4
           ipv6-routes-hw: 0
          ipv6-routes-cpu: 4
  ipv6-shortest-hw-prefix: 0
               ipv6-hosts: 0
         route-queue-size: 0
         route-queue-rate: 0
       route-process-rate: 0
     fasttrack-ipv4-conns: 0
     fasttrack-queue-size: 0
     fasttrack-queue-rate: 0
   fasttrack-process-rate: 0
   fasttrack-hw-min-speed: 0
   fasttrack-hw-offloaded: 0
    fasttrack-hw-unloaded: 0
                  lpm-cap: 54560
                lpm-usage: 31931
             lpm-bank-cap: 2728
           lpm-bank-usage: 46,0,0,0,2589,2591,1983,0,2728,2728,2728,2728,2728,2728,2728,2728,2728,170,0,0
                  pbr-cap: 8192
                pbr-usage: 0
             pbr-lpm-bank: 3
                nat-usage: 0
              nexthop-cap: 8192
            nexthop-usage: 85

Stats

Property

Description

route-queue-rateThe rate at which routes are added to the queue for the switch driver processing. In other words, the growth rate of route-queue-size (routes per second)
route-process-rateThe rate at which previously queued routes are processed by the switch driver. In other words, the shrink rate of route-queue-size (routes per second)
fasttrack-queue-sizeThe number of FastTrack connections in the queue for processing by the switch chip driver.
fasttrack-queue-rateThe rate at which FastTrack connections are added to the queue for the switch driver processing. In other words, the growth rate of fasttrack-queue-size (connections per second)
fasttrack-process-rateThe rate at which previously queued FastTrack connections are processed by the switch driver. In other words, the shrink rate of fasttrack-queue-size (connections per second)
fasttrack-hw-offloadedThe number of FastTrack connections offloaded to the hardware. The counter resets every second (or every monitor interval).
fasttrack-hw-unloadedThe number of FastTrack connections unloaded from the hardware (redirected to software routing). The counter resets every second (or every monitor interval).
lpm-capThe size of the LPM hardware table (LPM = Longest Prefix Match). LPM stores route indexes for hardware routing. Not every switch chip model uses LPM. Others use TCAM.
lpm-usageThe number of used LPM blocks. lpm-usage / lpm-cap = usage percentage.
lpm-bank-capLPM memory is organized in banks - special memory units. The bank size depends on the switch chip model. This value shows the size of a single bank (in LPM blocks). lpm-cap / lpm-bank-cap = the number of banks (usually, 20).
lpm-bank-usagePer-bank LPM usage (in LPM blocks)
pbr-capThe size of the Policy-Based Routing (PBR) hardware table. PBR is used for NAT offloading of FastTrack connections.
pbr-usageThe number of used PBR entries. pbr-usage / pbr-cap = usage percentage.
pbr-lpm-bankPBR shares LPM memory banks with routing tables. This value shows the LPM bank index shared with PBR (0 = the first bank).
nat-usageThe number of used NAT hardware entries (for FastTrack connections).

Interface Lists

It is impossible to use interface lists directly to control l3-hw-offloading because an interface list may contain virtual interfaces (such as VLAN) while the l3-hw-offloading setting must be applied to physical switch ports only. For example, if there are two VLAN interfaces (vlan20 and vlan30) running on the same switch port (trunk port), it is impossible to enable hardware routing on vlan20 but keep it disabled on vlan30.

However, an interface list may be used as a port selector. The following example demonstrates how to enable hardware routing on LAN ports (ports that belong to the "LAN" interface list) and disable it on WAN ports:

:foreach i in=[/interface/list/member/find where list=LAN] do={
    /interface/ethernet/switch/port set [/interface/list/member/get $i interface] l3-hw-offloading=yes
}

:foreach i in=[/interface/list/member/find where list=WAN] do={
    /interface/ethernet/switch/port set [/interface/list/member/get $i interface] l3-hw-offloading=no
}

Please take into account that since interface lists are not directly used in hardware routing control., modifying the interface list also does not automatically reflect in l3hw changes. For instance, adding a switch port to the "LAN" interface list does not automatically enable l3-hw-offloading on it. The user has to rerun the above script to apply the changes.

MTU

The hardware supports up to 8 MTU profiles, meaning that the user can set up to 8 different MTU values for interfaces: the default 1500 + seven custom ones.

It is recommended to disable l3-hw-offloading while changing the MTU/L2MTU values on the interfaces.
MTU Change Example
/interface/ethernet/switch set 0 l3-hw-offloading=no
/interface set sfp-sfpplus1 mtu=9000 l2mtu=9022
/interface set sfp-sfpplus2 mtu=9000 l2mtu=9022
/interface set sfp-sfpplus3 mtu=10000 l2mtu=10022
/interface/ethernet/switch set 0 l3-hw-offloading=yes

Layer 2 Dependency

Layer 3 hardware processing lies on top of Layer 2 hardware processing. Therefore, L3HW offloading requires L2HW offloading on the underlying interfaces. The latter is enabled by default, but there are some exceptions. For example, CRS3xx devices support only one hardware bridge. If there are multiple bridges, others are processed by the CPU and are not subject to L3HW. 

Another example is ACL rules. If a rule redirects traffic to the CPU for software processing, then hardware routing (L3HW) is not triggered:

ACL rule to disable hardware processing on a specific port
/interface/ethernet/switch/rule/add switch=switch1 ports=ether1 redirect-to-cpu=yes
It is recommended to turn off L3HW offloading during L2 configuration.

To make sure that Layer 3 is in sync with Layer 2 on both the software and hardware sides, we recommend disabling L3HW while configuring Layer 2 features. The recommendation applies to the following configuration:

  • adding/removing/enabling/disabling bridge;
  • adding/removing switch ports to/from the bridge;
  • bonding switch ports / removing bond;
  • changing VLAN settings;
  • changing MTU/L2MTU on switch ports;
  • changing ethernet (MAC) addresses.

In short, disable l3-hw-offloading while making changes under /interface/bridge/ and /interface/vlan/:

Layer 2 Configuration Template
/interface/ethernet/switch set 0 l3-hw-offloading=no

/interface/bridge
# put bridge configuration changes here

/interface/vlan
# define/change VLAN interfaces

/interface/ethernet/switch set 0 l3-hw-offloading=yes

MAC telnet and RoMON

There is a limitation for MAC telnet and RoMON when L3HW offloading is enabled on 98DX8xxx, 98DX4xxx, or 98DX325x switch chips. Packets from these protocols are dropped and do not reach the CPU, thus access to the device will fail.

If MAC telnet or RoMON are desired in combination with L3HW, certain ACL rules can be created to force these packets to the CPU.

For example, if MAC telnet access on sfp-sfpplus1 and sfp-sfpplus2 is needed, you will need to add this ACL rule. It is possible to select even more interfaces with the ports setting.

/interface ethernet switch rule
add dst-port=20561 ports=sfp-sfpplus1,sfp-sfpplus2 protocol=udp redirect-to-cpu=yes switch=switch1

For example, if RoMON access on sfp-sfpplus2 is needed, you will need to add this ACL rule.

/interface ethernet switch rule
add mac-protocol=0x88BF ports=sfp-sfpplus2 redirect-to-cpu=yes switch=switch1

Inter-VLAN Routing

Since L3HW depends on L2HW, and L2HW is the one that does VLAN processing, Inter-VLAN hardware routing requires a hardware bridge underneath. Even if a particular VLAN has only one tagged port member, the latter must be a bridge member. Do not assign a VLAN interface directly on a switch port! Otherwise, L3HW offloading fails and the traffic will get processed by the CPU:

/interface/vlan add interface=ether2 name=vlan20 vlan-id=20

Assign the VLAN interface to the bridge instead. This way, VLAN configuration gets offloaded to the hardware, and, with L3HW enabled, the traffic is subject to inter-VLAN hardware routing.

VLAN Configuration Example
/interface/ethernet/switch set 0 l3-hw-offloading=no
/interface/bridge/port add bridge=bridge interface=ether2
/interface/bridge/vlan add bridge=bridge tagged=bridge,ether2 vlan-ids=20
/interface/vlan add interface=bridge name=vlan20 vlan-id=20
/ip/address add address=192.0.2.1/24 interface=vlan20
/interface/bridge set bridge vlan-filtering=yes
/interface/ethernet/switch set 0 l3-hw-offloading=yes
For Inter-VLAN routing, the bridge interface must be a tagged member of every routable /interface/bridge/vlan/ entry.

L3HW MAC Address Range Limitation (DX2000/DX3000 series only)

Marvell Prestera DX2000 and DX3000 switch chips have a hardware limitation that allows configuring only the last (least significant) octet of the MAC address for each interface. The other five (most significant) octets are configured globally and, therefore, must be equal for all interfaces (switch ports, bridge, VLANs). In other words, the MAC addresses must be in the format "XX:XX:XX:XX:XX:??", where:

  • "XX:XX:XX:XX:XX" part is common for all interfaces.
  • "??" is a variable part.

This requirement applies only to Layer 3 (routing). Layer 2 (bridging) does not use the switch's ethernet addresses. Moreover, it does not apply to bridge ports because they use the bridge's MAC address.

The requirement for common five octets applies to:

  • Standalone switch ports (not bridge members) with hardware routing enabled (l3-hw-offloading=yes).
  • Bridge itself.
  • VLAN interfaces (those that use the bridge's MAC address by default).

Route Configuration

Suppressing HW Offload

By default, all the routes are participating to be hardware candidate routes. To further fine-tune which traffic to offload, there is an option for each route to disable/enable suppress-hw-offload

For example, if we know that the majority of traffic flows to the network where servers are located, we can enable offloading only to that specific destination:

/ip/route set [find where static && dst-address!="192.168.3.0/24"] suppress-hw-offload=yes

Now only the route to 192.168.3.0/24 has H-flag, indicating that it will be the only one eligible to be selected for HW offloading:

[admin@MikroTik] > /ip/route print where static
Flags: A - ACTIVE; s - STATIC, y - COPY; H - HW-OFFLOADED
Columns: DST-ADDRESS, GATEWAY, DISTANCE
#     DST-ADDRESS       GATEWAY         D
0 As  0.0.0.0/0         172.16.2.1      1
1 As  10.0.0.0/8        10.155.121.254  1
2 AsH 192.168.3.0/24    172.16.2.1      1

H-flag does not indicate that the route is actually HW offloaded, it indicates only that the route can be selected to be HW offloaded.

Routing Filters

For dynamic routing protocols like OSFP and BGP, it is possible to suppress HW offloading using routing filters. For example, to suppress HW offloading on all OSFP instance routes, use "suppress-hw-offload yes" property:

/routing/ospf/instance
set [find name=instance1] in-filter-chain=ospf-input
/routing/filter/rule
add chain="ospf-input" rule="set suppress-hw-offload yes; accept"

Offloading Fasttrack Connections

Firewall filter rules have hw-offload option for Fasttrack, allowing fine-tuning connection offloading. Since the hardware memory for Fasttrack connections is very limited, we can choose what type of connections to offload and, therefore, benefit from near-the-wire-speed traffic. The next example offloads only TCP connections while UDP packets are routed via the CPU and do not occupy HW memory:

/ip/firewall/filter
add action=fasttrack-connection chain=forward connection-state=established,related hw-offload=yes protocol=tcp
add action=fasttrack-connection chain=forward connection-state=established,related hw-offload=no
add action=accept chain=forward connection-state=established,related

Stateless Hardware Firewall

While connection tracking and stateful firewalling can be performed only by the CPU, the hardware can perform stateless firewalling via switch rules (ACL). The next example prevents (on a hardware level) accessing a MySQL server from the ether1, and redirects to the CPU/Firewall packets from ether2 and ether3:

/interface ethernet switch rule
add switch=switch1 dst-address=10.0.1.2/32 dst-port=3306 ports=ether1 new-dst-ports=""
add switch=switch1 dst-address=10.0.1.2/32 dst-port=3306 ports=ether2,ether3 redirect-to-cpu=yes

Switch Rules (ACL) vs. Fasttrack HW Offloading

Some firewall rules may be implemented both via switch rules (ACL) and CPU Firewall Filter + Fasttrack HW Offloading. Both options grant near-the-wire-speed performance. So the question is which one to use?

First, not all devices support Fasttrack HW Offloading, and without HW offloading, Firewall Filter uses only software routing, which is dramatically slower than its hardware counterpart. Second, even if Fasttrack HW Offloading is an option, a rule of thumb is:

Always use Switch Rules (ACL), if possible.

Switch rules share the hardware memory with Fastrack connections. However, hardware resources are allocated for each Fasttrack connection while a single ACL rule can match multiple connections. For example, if you have a guest WiFi network connected to sfp-sfpplus1 VLAN 10 and you don't want it to access your internal network, simply create an ACL rule:

/interface/ethernet/switch/rule
add switch=switch1 ports=sfp-sfpplus1 vlan-id=10 dst-address=10.0.0.0/8 new-dst-ports=""

The matched packets will be dropped on the hardware level. It is much better than letting all guest packets to the CPU for Firewall filtering.

Of course, ACL rules cannot match everything. For instance, ACL rules cannot filter connection states: accept established, drop others. That is where Fasttrack HW Offloading gets into action - redirect the packets to the CPU by default for firewall filtering, then offload the established Fasttrack connections. However, disabling l3-hw-offloading for the entire switch, port is not the only option.

Define ACL rules with redirect-to-cpu=yes instead of setting l3-hw-offloading=no of the switch port for narrowing down the traffic that goes to the CPU.

Configuration Examples

Inter-VLAN Routing with Upstream Port Behind Firewall/NAT

This example demonstrates how to benefit from near-to-wire-speed inter-VLAN routing while keeping Firewall and NAT running on the upstream port. Moreover, Fasttrack connections to the upstream port get offloaded to hardware as well, boosting the traffic speed close to wire-level. Inter-VLAN traffic is fully routed by the hardware, not entering the CPU/Firewall, and, therefore, not occupying the hardware memory of Fasttrack connections.

We use the CRS317-1G-16S+ model with the following setup:

  • sfp1-sfp4 - bridged ports, VLAN ID 20, untagged
  • sfp5-sfp8 - bridged ports, VLAN ID 30, untagged
  • sfp16 - the upstream port
  • ether1 - management port


Setup interface lists for easy access:

Interface Lists
/interface list
add name=LAN
add name=WAN
add name=MGMT 

/interface list member
add interface=sfp-sfpplus1 list=LAN
add interface=sfp-sfpplus2 list=LAN
add interface=sfp-sfpplus3 list=LAN
add interface=sfp-sfpplus4 list=LAN
add interface=sfp-sfpplus5 list=LAN
add interface=sfp-sfpplus6 list=LAN
add interface=sfp-sfpplus7 list=LAN
add interface=sfp-sfpplus8 list=LAN
add interface=sfp-sfpplus16 list=WAN
add interface=ether1 list=MGMT 
Bridge Setup
/interface bridge
add name=bridge vlan-filtering=yes

/interface bridge port
add bridge=bridge interface=sfp-sfpplus1 pvid=20
add bridge=bridge interface=sfp-sfpplus2 pvid=20
add bridge=bridge interface=sfp-sfpplus3 pvid=20
add bridge=bridge interface=sfp-sfpplus4 pvid=20
add bridge=bridge interface=sfp-sfpplus5 pvid=30
add bridge=bridge interface=sfp-sfpplus6 pvid=30
add bridge=bridge interface=sfp-sfpplus7 pvid=30
add bridge=bridge interface=sfp-sfpplus8 pvid=30

/interface bridge vlan
add bridge=bridge tagged=bridge untagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=20
add bridge=bridge tagged=bridge untagged=sfp-sfpplus5,sfp-sfpplus6,sfp-sfpplus7,sfp-sfpplus8 vlan-ids=30

Routing requires dedicated VLAN interfaces. For standard L2 VLAN bridging (without inter-VLAN routing), the next step can be omitted.

VLAN Interface Setup for Routing
/interface vlan
add interface=bridge name=vlan20 vlan-id=20
add interface=bridge name=vlan30 vlan-id=30

/ip address
add address=192.168.20.17/24 interface=vlan20 network=192.168.20.0
add address=192.168.30.17/24 interface=vlan30 network=192.168.30.0

Configure management and upstream ports, a basic firewall, NAT, and enable hardware offloading of Fasttrack connections:

Firewall Setup
/ip address
add address=192.168.88.1/24 interface=ether1
add address=10.0.0.17/24 interface=sfp-sfpplus16

/ip route
add gateway=10.0.0.1

/ip firewall filter
add action=fasttrack-connection chain=forward connection-state=established,related hw-offload=yes
add action=accept chain=forward connection-state=established,related

/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN

At this moment, all routing still is performed by the CPU. Enable hardware routing on the switch chip:

Enable Layer 3 Hardware Offloading
# Enable full hardware routing on LAN ports
:foreach i in=[/interface/list/member/find where list=LAN] do={ 
    /interface/ethernet/switch/port set [/interface/list/member/get $i interface] l3-hw-offloading=yes 
} 

# Disable full hardware routing on WAN or Management ports
:foreach i in=[/interface/list/member/find where list=WAN or list=MGMT] do={ 
    /interface/ethernet/switch/port set [/interface/list/member/get $i interface] l3-hw-offloading=no 
}

# Activate Layer 3 Hardware Offloading on the switch chip
/interface/ethernet/switch/set 0 l3-hw-offloading=yes

Results:

  • Within the same VLAN (e.g., sfp1-sfp4), traffic is forwarded by the hardware on Layer 2 (L2HW).
  • Inter-VLAN traffic (e.g. sfp1-sfp5) is routed by the hardware on Layer 3 (L3HW).
  • Traffic from/to the WAN port gets processed by the CPU/Firewall first. Then Fasttrack connections get offloaded to the hardware (Hardware-Accelerated L4 Stateful Firewall). NAT applies both on CPU- and HW-processed packets.
  • Traffic to the management port is protected by the Firewall.

Typical Misconfiguration

Below are typical user errors in configuring Layer 3 Hardware Offloading.

VLAN interface on a switch port or bond

/interface/vlan
add name=vlan10 vlan-id=10 interface=sfp-sfpplus1
add name=vlan20 vlan-id=20 interface=bond1

VLAN interface must be set on the bridge due to Layer 2 Dependency. Otherwise, L3HW will not work. The correct configuration is:

/interface/bridge/port
add bridge=bridge1 interface=sfp-sfpplus1 frame-types=admit-only-vlan-tagged
add bridge=bridge1 interface=bond1 frame-types=admit-only-vlan-tagged
 
/interface/bridge/vlan
add bridge=bridge1 tagged=bridge1,sfp-sfpplus1 vlan-ids=10
add bridge=bridge1 tagged=bridge1,bond1 vlan-ids=20
 
/interface/vlan
add name=vlan10 vlan-id=10 interface=bridge1
add name=vlan20 vlan-id=20 interface=bridge1

Not adding the bridge interface to /interface/bridge/vlan/

For Inter-VLAN routing, the bridge interface itself needs to be added to the tagged members of the given VLANs. In the next example, Inter-VLAN routing works between VLAN 10 and 11, but packets are NOT routed to VLAN 20. 

/interface bridge vlan
add bridge=bridge1 vlan-ids=10 tagged=bridge1,sfp-sfpplus1
add bridge=bridge1 vlan-ids=11 tagged=bridge1 untagged=sfp-sfpplus2,sfp-sfpplus3 
add bridge=bridge1 vlan-ids=20 tagged=sfp-sfpplus1 untagged=sfp-sfpplus4,sfp-sfpplus5

The above example does not always mean an error. Sometimes, you may want the device to act as a simple L2 switch in some/all VLANs. Just make sure you set such behavior on purpose, not due to a mistake.

Creating multiple bridges

The devices support only one hardware bridge. If there are multiple bridges created, only one gets hardware offloading. While for L2 that means software forwarding for other bridges, in the case of L3HW, multiple bridges may lead to undefined behavior.

Instead of creating multiple bridges, create one and segregate L2 networks with VLAN filtering.

Using ports that do not belong to the switch

Some devices have two switch chips or the management port directly connected to the CPU. For example, CRS312-4C+8XG has an ether9 port connected to a separate switch chip. Trying to add this port to a bridge or involve it in the L3HW setup leads to unexpected results. Leave the management port for management!

[admin@crs312] /interface/ethernet/switch> print
Columns: NAME, TYPE, L3-HW-OFFLOADING
# NAME     TYPE              L3-HW-OFFLOADING
0 switch1  Marvell-98DX8212  yes            
1 switch2  Atheros-8227      no   
           
[admin@crs312] /interface/ethernet/switch> port print
Columns: NAME, SWITCH, L3-HW-OFFLOADING, STORM-RATE
 # NAME         SWITCH   L3-HW-OFFLOADING  STORM-RATE
 0 ether9       switch2                             
 1 ether1       switch1  yes                      100
 2 ether2       switch1  yes                      100
 3 ether3       switch1  yes                      100
 4 ether4       switch1  yes                      100
 5 ether5       switch1  yes                      100
 6 ether6       switch1  yes                      100
 7 ether7       switch1  yes                      100
 8 ether8       switch1  yes                      100
 9 combo1       switch1  yes                      100
10 combo2       switch1  yes                      100
11 combo3       switch1  yes                      100
12 combo4       switch1  yes                      100
13 switch1-cpu  switch1                           100
14 switch2-cpu  switch2

Relying on Fasttrack HW Offloading too much

Since Fasttrack HW Offloading offers near-the-wire-speed performance at zero configuration overhead, the users are tempted to use it as the default solution. However, the number of HW Fasttrack connections is very limited, leaving the other traffic for the CPU. Try using the hardware routing as much as possible, reduce the CPU traffic to the minimum via switch ACL rules, and then fine-tune which Fasttrack connections to offload with firewall filter rules.

Trying to offload slow-path connections

Using certain configurations (e.g. enabling bridge "use-ip-firewall" setting, creating bridge nat/filter rules) or running specific features like sniffer or torch can disable RouterOS FastPath, which will affect the ability to properly FastTrack and HW offload connections. If HW offloaded Fasttrack is required, make sure that there are no settings that disable the FastPath and verify that connections are getting the "H" flag or use the L3HW monitor command to see the amount of HW offloaded connections.

L3HW Feature Support

  • HW - the feature is supported and offloaded to the hardware.
  • CPU - the feature is supported but performed by software (CPU)
  • N/A - the feature is not available together with L3HW. Layer 3 hardware offloading must be completely disabled (switch l3-hw-offloading=no) to make this feature work.
  • FW - the feature requires l3-hw-offloading=no for a given switch port. On the switch level, l3-hw-offloading=yes.


FeatureSupportCommentsRelease
IPv4 Unicast RoutingHW
7.1
IPv6 Unicast RoutingHW
/interface/ethernet/switch/l3hw-settings/set ipv6-hw=yes
7.6
IPv4 Multicast RoutingCPU

IPv6 Multicast RoutingCPU

ECMPHWMultipath routing7.1
BlackholesHW
/ip/route add dst-address=10.0.99.0/24 blackhole
7.1
gateway=<interface_name>CPU/HW
/ip/route add dst-address=10.0.0.0/24 gateway=ether1 

This works only for directly connected networks. Since HW does not know how to send ARP requests,
CPU sends an ARP request and waits for a reply to find out the DST MAC address on the first received packet of the connection that matches a DST IP address.
After DST MAC is determined, HW entry is added and all further packets will be processed by the switch chip.

7.1
BRIDGEHWIP Routing from/to hardware-offloaded bridge interface.7.1
VLANHWRouting between VLAN interfaces that are created on hardware-offloaded bridge interface with vlan-filtering.7.1
BondingHW
/interface/bonding

 Only 802.3ad and balance-xor bonding modes are hardware offloaded.

7.1
IPv4 FirewallFWUsers must choose either HW-accelerated routing or firewall.
Firewall rules get processed by the CPU. Fasttrack connections get offloaded to HW.
7.1
IPv4 NATFWNAT rules applied to the offloaded Fasttrack connections get processed by HW too.7.1
MLAGN/A
 
VRFN/AOnly the main routing table gets offloaded. If VRF is used together with L3HW and packets arrive on a switch port with l3-hw-offloading=yes, packets can be incorrectly routed through the main routing table. To avoid this, disable L3HW on needed switch ports or use ACL rules to redirect specific traffic to the CPU.
VRRPN/A

Controller Bridge and Port ExtenderN/A

VXLANCPU

MTUHWThe hardware supports up to 8 MTU profiles.7.1
QinQ and tag-stackingCPUStacked VLAN interfaces will lose HW offloading, while other VLANs created directly on the bridge interface can still use HW offloading.  

Only the devices listed in the table below support L3 HW Offloading.

L3HW Device Support

Only the devices listed in the table below support L3 HW Offloading.

CRS3xx: Switch DX3000 and DX2000 Series

The devices below are based on Marvell 98DX224S, 98DX226S, or 98DX3236 switch chip models.

Below are some important features that these devices are missing when compared to other switch models:

  • Fasttrack and NAT connection offloading;
  • per-VLAN packet and byte counters.

The 98DX3255 and 98DX3257 models are exceptions, which have a feature set of the DX8000 rather than the DX3000 series.

ModelSwitch ChipReleaseIPv4 Route Prefixes1IPv6 Route Prefixes2NexthopsECMP paths per prefix3
CRS305-1G-4S+98DX32367.11331233284K8
CRS310-1G-5S-4S+98DX226S7.11331233284K8
CRS310-8G+2S+98DX226S7.11331233284K8
CRS318-1Fi-15Fr-2S98DX224S7.11331233284K8
CRS318-16P-2S+98DX226S7.11331233284K8
CRS326-24G-2S+98DX32367.11331233284K8
CRS328-24P-4S+98DX32367.11331233284K8
CRS328-4C-20S-4S+98DX32367.11331233284K8

1 Since the total amount of routes that can be offloaded is limited, prefixes with higher netmask are preferred to be forwarded by hardware (e.g., /32, /30, /29, etc.), any other prefixes that do not fit in the HW table will be processed by the CPU. Directly connected hosts are offloaded as /32 (IPv4) or /128 (IPv6) route prefixes. The number of hosts is also limited by max-neighbor-entries in IP Settings / IPv6 Settings.

2 IPv4 and IPv6 routing tables share the same hardware memory.

3 If a route has more paths than the hardware ECMP limit (X), only the first X paths get offloaded.

CRS3xx, CRS5xx: Switch DX8000 and DX4000 Series

The devices below are based on Marvell 98DX8xxx, 98DX4xxx switch chips, or 98DX325x model.

ModelSwitch ChipReleaseIPv4 Routes 1IPv4 Hosts 7IPv6 Routes8IPv6 Hosts7NexthopsFasttrack connections 2,3,4NAT entries 2,5 
CRS317-1G-16S+98DX82167.1120K - 240K64K30K - 40K32K8K4.5K4K
CRS309-1G-8S+98DX82087.116K - 36K16K4K - 6K8K8K4.5K3.9K
CRS312-4C+8XG98DX82127.116K - 36K16K4K - 6K8K8K2.25K2.25K
CRS326-24S+2Q+98DX83327.116K - 36K16K4K - 6K8K8K2.25K2.25K
CRS326-4C+20G+2Q+98DX83327.116K - 36K16K4K - 6K8K8K2.25K2.25K
CRS354-48G-4S+2Q+, CRS354-48P-4S+2Q+98DX3257 67.116K - 36K16K4K - 6K8K8K2.25K2.25K
CRS504-4XQ98DX43107.160K - 120K64K15K - 20K32K8K4.5K4K
CRS510-8XS-2XQ98DX43107.360K - 120K64K15K - 20K32K8K4.5K4K
CRS518-16XS-2XQ98DX85257.360K - 120K64K15K - 20K32K8K4.5K4K

1 Depends on the complexity of the routing table. Whole-byte IP prefixes (/8, /16, /24, etc.) occupy less HW space than others (e.g., /22). Starting with RouterOS v7.3, when the Routing HW table gets full, only routes with longer subnet prefixes are offloaded (/30, /29, /28, etc.) while the CPU processes the shorter prefixes. In RouterOS v7.2 and before, Routing HW memory overflow led to undefined behavior. Users can fine-tune what routes to offload via routing filters (for dynamic routes) or suppressing hardware offload of static routes. IPv4 and IPv6 routing tables share the same hardware memory.

2 When the HW limit of Fasttrack or NAT entries is reached, other connections will fall back to the CPU. MikroTik's smart connection offload algorithm ensures that the connections with the most traffic are offloaded to the hardware.

3 Fasttrack connections share the same HW memory with ACL rules. Depending on the complexity, one ACL rule may occupy the memory of 3-6 Fasttrack connections.

4 MPLS shares the HW memory with Fasttrack connections. Moreover, enabling MPLS requires the allocation of the entire memory region, which could otherwise store up to 768 (0.75K) Fasttrack connections. The same applies to the Bridge Port Extender. However, MPLS and BPE may use the same memory region, so enabling them both doesn't double the limitation of Fasttrack connections.

5 If a Fasttrack connection requires Network Address Translation, a hardware NAT entry is created. The hardware supports both SRCNAT and DSTNAT.

6 The switch chip has a feature set of the DX8000 series.

7 DX4000/DX8000 switch chips store directly connected hosts, IPv4 /32, and IPv6 /128 route entries in the FDB table rather than the routing table. The HW memory is shared between regular FDB L2 entries (MAC), IPv4, and IPv6 addresses. The number of hosts is also limited by max-neighbor-entries in IP Settings / IPv6 Settings.

8 IPv4 and IPv6 routing tables share the same hardware memory.

CCR2000

ModelSwitch ChipReleaseIPv4 RoutesIPv4 HostsIPv6 RoutesIPv6 HostsNexthopsFasttrack connectionsNAT entries
CCR2116-12G-4S+98DX3255 17.116K - 36K16K4K - 6K8K8K2.25K2.25K
CCR2216-1G-12XS-2XQ98DX85257.160K - 120K64K15K - 20K32K8k4.5K4K

1 The switch chip has a feature set of the DX8000 series.

Branding

Page edited by Matīss O.

RouterOS allows slight system customization with the help of a branding package (modify default configuration, LCD logo, WebFig homepage, etc.).

This is a special system package, which you can generate from within your mikrotik.com account, in the account section "Branding maker". The resulting file will have a .dpk extension and can be installed by all the same means as an .npk package.

To install the package on a router, branding package has to upload to it and then a router has to reboot, Netinstall tool can be used for the same effect.

The generated package can be installed in any RouterOS version.

Note that specific branding features are available starting from specific RouterOS versions.

Options

Options that can be configured using a branding package:

  • Router name - branding package name, device identity and platform name in RouterOS, can only be one word, don't use spaces or special characters;
  • Company URL - value that appears in the console when you connect to RouterOS device;
  • Manual URL - documentation link, which can be opened in WebFig;
  • ASCII Logo - a text logo that is shown when logging into the command line interface, i.e. Telnet, SSH, WinBox Terminal. A logo can be created in the branding maker or copied from any other plaintext editor. A logo height cannot be larger than 8 lines, width is not limited, but note that in a narrow terminal window a logo might be distorted.
  • Hide "Mikrotik" from SNMP information - MikroTik name will be hidden in SNMP information;
  • Do not run script on install - do not run Default configuration script on branding package install;
  • Hide Default configuration prompt - hide Default configuration prompt after configuration reset (available starting from RouterOS 7.15)
  • Hide default caps-mode-script - hide default caps-mode-script (available starting from RouterOS 7.15)

Custom files

A custom files like custom default configuration, skins, WebFig login page, etc., can be added in branding package.

  • WebFig login page -  customized a default RouterOS information page, which shows up when accessing the router IP address. When making the HTML file, you can use these variables:
    • %version% will change to the router's current version;
    • %host% will change to the router's IP address.

The file must be named "index2.html". Make sure you use properly nested HTML to make your page compatible with all browsers.

To use percent sign as text or formatting value in "index2.html", double % must be used, example - width: 70%%

You can also upload images or JavaScript files, they must reference to the same path as the index file, no custom folder names can be used.
To overwrite MikroTik logo in WebFig login page, upload your custom logo - a logo
should be named "mikrotik_logo.png";

  • WebFig logo  - Router WEB page (configuration page) logo;
  • \hotspot -  Hotspot login page logo, the file must be named "logobottom.png";
  • \skins - a skin file with name your_file_name.json. To apply a particular skin to a specific user group, you don't need to log into the router to do that. You can do it with branding by uploading a Default configuration file;
  • Default configuration - a RouterOS default configuration file that will override RouterOS default configuration. This configuration will be kept even after RouterOS reset. It is possible to reapply the factory passwords by utilizing the read-only variables $defconfPassword and $defconfWifiPassword (access to factory passwords is available starting RouterOS 7.10);
  • LCD logo - LCD logo will be displayed on devices equipped with LCD screen. A Logo size cannot be larger than 160px width and 72px height. CCR1xxx series has white (0xffffff) background, 2011 series have black (0x000000) background;

  • Custom files - custom files will be simply copied into a folder named "branding" and will be accessible from within RouterOS.
  • CAPs mode script - a RouterOS CAPs mode script that will override RouterOS default CAPs mode script. It is possible to reapply the factory passwords by utilizing the read-only variables $defconfPassword and $defconfWifiPassword (available starting from RouterOS 7.15).

If a Default configuration or CAPs mode script execution takes more than 2 minutes, a script will fail, and LOG will contain "runtime limit exceeded" or in rare cases "std failure: timeout" error.




W60G

Page edited by Antons B.

Summary

Packages: system,wireless

802.11ad implementation capable of providing Gigabit Ethernet speeds over wireless network.

Extend your Gigabit network over a transparent AES encrypted wireless 60GHz link without usual wired or wireless network problems.

General interface properties

Sub-menu: /interface w60g


Wireless Wire kit devices comes in pre-configured, connected pairs. Manual configuration is optional




PropertyDescription
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) Read more >>
arp-timeout (auto | integer; Default: auto)ARP timeout is time how long ARP record is kept in ARP table after no packets are received from IP. Value auto equals to the value of arp-timeout in /ip settings, default is 30s
comment (string; Default: )Short description of the interface
disabled (yes | no; Default: yes)Whether interface is disabled
frequency (58320 | 60480 | 62640 | 64800 | 66000 | auto; Default: auto)Frequency used in communication (Only active on bridge device)
isolate-stations (yes | no; Default: yes)Don't allow communication between connected clients (from RouterOS 6.41)
l2mtu (integer [0..7882]; Default: 1600)Layer2 Maximum transmission unit
mac-address (MAC; Default: )MAC address of the radio interface
mdmg-fix (yes | no; Default: no)Experimental feature working only on wAP60Gx3 devices, providing better point to multi point stability in some cases
mode (ap-bridge | bridge | sniff | station-bridge; Default: bridge)Operation mode
mtu (integer [32..8192]; Default: 1500)Layer3 Maximum transmission unit
name (string; Default: wlan60-1)Name of the interface
password (string; Default: randomly generated)Password used for AES encryption
put-stations-in-bridge (; Default: )Put newly created station device interfaces in this bridge
region (asia | australia | canada | china | eu | japan | no-region-set | usa; Default: no-region-set)Parameter to limit frequency use
scan-list (58320,60480,62640,64800,66000; Default: 58320,60480,62640,64800)Scan list to limit connectivity over frequencies in station mode
ssid (string (0..32 chars); Default: value of System Identity)SSID (service set identifier) is a name that identifies wireless network
tx-sector (integer [0..63] | auto; Default: auto)Disables beamforming and locks to selected radiation pattern


Sub-menu: /interface w60g print stats

Provides more detailed information about Beamforming occurrences and some debug information:

/interface w60g print stats name: wlan60-1 
beamforming-event: 310
tx-io-msdu: 0
tx-sw-msdu: 154 663
tx-fw-msdu: 102
tx-ppdu: 220 147
tx-ppdu-from-q: 40 327
tx-mpdu-new: 154 663
tx-mpdu-total: 184 759
tx-mpdu-retry: 30 096
rx-ppdu: 166 636
rx-mpdu-crc-err: 4 817
rx-mpdu-crc-ok: 285 649

Station interface properties

ap-bridge device requires License level 4 (click for more information)  to support more than one connected client


Connected clients are treated as individual interfaces, after successful connection new station interface is created.

After update default configuration still works - newly created station interface is moved to default bridge.

Sub-menu: /interface w60g station

PropertyDescription
parent (string; Default: wlan60-*)Parent interface name
put-in-bridge (none | parent | bridge-name; Default: parent)Add station device interface to specific bridge
remote-address (MAC; Default: matches bridge interface MAC)MAC address of bridge interface, station is connecting to

Scan

/interface w60g scan wlan60-1

Scan command searches for and displays available AP(s) in the frequency range supported by the W60G interface.

Using scan command the interface operation is disabled (wireless link is disconnected during the scan operation)

Currently it is impossible to do background scans.

Monitor

/interface w60g monitor wlan60-1 
connected: yes frequency: 58320
remote-address: 04:D6:AA:AA:AA:AA
mcs: 8
phy-rate: 2.3Gbps
signal: 80 rssi: -68
tx-sector: 28
tx-sector-info: center
distance: 160.9m

Monitor shows current state of active connection. Distance measurement tool provides very precise distance measurements. "tx-sector-info" (feature in testing stage) provides information from currently used beamforming pattern and shows direction to center - theoretical highest power output point.

Align

/interface w60g align wlan60-1 
connected: yes
frequency: 58320
remote-address: 04:D6:AA:AA:AA:AB
tx-mcs: 6
tx-phy-rate: 1540.0Mbps
signal: 70
rssi: -62
10s-average-rssi: -63.1
tx-sector: 62
tx-sector-info: left 19 degrees, up 26.6 degrees
rx-sector: 96
distance: 220.88m
tx-packet-error-rate: 5%


In align mode frames between two devices are exchanged more rapidly and information about signal quality is displayed more often. Use "rssi", "10s-average-rssi" and "tx-sector-info" (available from 6.44beta39) values for more precise link alignment. When devices enter align mode - link is lost for a few seconds.

Sniff

Sniff mode allows to capture nearby 802.11ad frames. To use sniff mode same frequency needs to be used and interface operational mode needs to be set to sniff:

/interface w60g set wlan60-1 mode=sniff

Now this interface can be used in Tools/Packet Sniffer for packet capture. Sniffer mode can't be used together with regular interface working modes.

Point to Multi Point setup example

All MikroTik devices can be interconnected. There are three different versions of wAP60G devices currently available:

  • Wireless Wire kit
  • wAP 60G
  • SXTsq60 Lite60
  • wAP 60G AP

And

  • Wireless Wire Dish

Hardware wise wAP devices are identical, but there are some software limitations -

wAP 60G AP is designed for Access Point usage in PtMP (Point to Multi Point) setups, but can be also used as PtP (Point to Point) or as Station device. It's already equipped with level4 license for more than one connected client support More about Licenses

Wireless Wire kit, Wireless Wire Dish, SXTsq Lite60 and wAP60G devices comes with level3 license. Wireless wire dish should be only used as Client device due to it's narrow radiation pattern.

License upgrade is needed to unlock more than one simultaneously connected client in Access Point mode, but devices can connect to Access Points as regular Station devices.



Before configuration, make sure devices are running latest software versions: How to upgrade


Minimal configuration for transparent wireless link is matching SSID, correct mode (bridge || station-bridge) and Wireless and Ethernet interfaces put in same bridge.

In current example we will look at usage case where wAP60G AP is used as Access Point, wAP60G and Wireless Wire kit devices are used as Station devices, forming 4 unit network.


It's recommended to change default IP addresses to avoid connection issues to the devices



wAP60G AP units come pre-configured with WISP Bridge default configuration

SSID and bridge between Wireless and Ethernet interfaces is already configured. It's recommended to set up Wireless password and change SSID. If device has been reset, you can also set correct mode and enable interface.

One liner that does all previously mentioned steps:

/interface w60g set wlan60-1 password="put_your_safe_password_here" ssid="put_your_new_ssid_here" disabled=no mode=ap-bridge

Wireless Wire and wAP60G units come pre-configured with PTP Bridge default configuration.

Wireless Wire devices have already randomly generated matching SSID and Wireless password.

Bridge device (Bridge or Access point device with one connected client support) needs Wireless mode change to station-bridge.

One liner that can be used to set devices in client mode:

/interface w60g set wlan60-1 password="put_your_safe_password_here" ssid="put_your_new_ssid_here" disabled=no mode=station-bridge

If configuration is done from empty configuration (reset without default configuration) -

new bridge needs to be created containing Wireless and Ethernet interfaces and IP address for easy access should be added.

{ /interface bridge 
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=wlan60-1
/ip address add address=192.168.88.1/24 interface=bridge1
}

For Access Point add this line to ensure all connected stations will be put in same bridge.

/interface w60g set wlan60-1 put-stations-in-bridge=bridge1

After successful connection for each Client device new entry will appear on Access Point device under:

/interface w60g station print
Flags: X - disabled, R - running 

0 name="wlan60-station-1" parent=wlan60-1 remote-address=AA:AA:AA:AA:AA:AA mtu=1500 mac-address=AA:AA:AA:AA:AA:AB arp=enabled arp-timeout=auto put-in-bridge=parent

0 name="wlan60-station-2" parent=wlan60-1 remote-address=AA:AA:AA:AA:AB:AA mtu=1500 mac-address=AA:AA:AA:AA:AA:AC arp=enabled arp-timeout=auto put-in-bridge=parent

0 name="wlan60-station-3" parent=wlan60-1 remote-address=AA:AA:AA:AA:AC:AA mtu=1500 mac-address=AA:AA:AA:AA:AA:AD arp=enabled arp-timeout=auto put-in-bridge=parent

0 name="wlan60-station-4" parent=wlan60-1 remote-address=AA:AA:AA:AA:AD:AA mtu=1500 mac-address=AA:AA:AA:AA:AA:AE arp=enabled arp-timeout=auto put-in-bridge=parent

For each client separate settings can be applied (queues, VLANS, Firewall rules, etc) providing more flexibility in configuration.

To limit client-client communication in same bridge isolate-stations option can be used on Access Point device:

/interface w60g set wlan60-1 isolate-stations=yes

Point to Point GUI configuration example

Point to Point GUI configuration example

Troubleshooting and Recommendations


MikroTik 60GHz solutions functionality includes support for for ATPC (Adaptive Transmit Power Control)

Physical Properties

Atmospheric attenuation for the wireless frequencies used in 802.11ad standard is very high, this should be taken in account before deploying links.

The Wireless Wire kit have been tested in distances up to 200 meters.

Wireless Wire dish kit is tested at distances up to 2500 meters For stability and full speed availability this kit is recommended for distances up to 1500 meters.

wAP60G devices are equipped with phase array 60° beamforming antennas, that can help signal find the way around objects in short distances but it's still vital to keep the line of sight clear on higher distances.

LHG60G device single radiation pattern is less than 1 degree (both Horizontal and Vertical), All patterns combined provide close to 3 degree coverage in both Horizontal and Vertical planes, best one for each situation is calculated by using beamforming algorithm. Beam width and direction depends on used predefined calibrated sector.

Device RF characteristics

60 GHz devices

DeviceWidth of single antenna pattern and full span in degreesEIRPTx-powerCenter sectors*
wAP 60G15-20 degrees single pattern and full span 60 degrees over horizontal and 30 degrees vertical plane< 40 dBm
27,28,35,36
wAP 60G AP15-20 degrees single pattern and full span 60 degrees over horizontal and 30 degrees vertical plane< 40 dBm
27,28,35,36
Wireless Wire15-20 degrees single pattern and full span 60 degrees over horizontal and 30 degrees vertical plane< 40 dBm
27,28,35,36
wAP 60Gx3 AP15-20 degrees single pattern and full span 180 degrees over horizontal and 30 degrees vertical plane< 40 dBm
27,28,35,36
SXTsq Lite 6015-20 degrees single pattern and full span 60 degrees over horizontal and 30 degrees vertical plane< 40 dBm
27,28,35,36
Cube Lite 604-8 degrees single pattern and full span 12 degrees over horizontal and 12 degrees vertical plane< 40 dBm< 10 dBm27,28,35,36
Cube 60G ac4-8 degrees single pattern and full span 12 degrees over horizontal and 12 degrees vertical plane< 40 dBm< 10 dBm27,28,35,36
Cube 60Pro ac 4-8 degrees single pattern and full span 11 degrees over horizontal and 11 degrees vertical plane< 40 dBm< 10 dBm27,28,35,36
CubeSA 60Pro ac15 degrees single pattern and full span 60 degrees over horizontal and 30 degrees vertical plane< 40 dBm< 10 dBm27,28,35,36
LHG Lite 60< 1 degree single pattern and full span 3 degrees over horizontal and 3 degrees vertical plane< 55 dBm< 10 dBm27,28,35,36
LHG 60G< 1 degree single pattern and full span 3 degrees over horizontal and 3 degrees vertical plane< 55 dBm< 10 dBm27,28,35,36
Wireless Wire Dish< 1 degree single pattern and full span 3 degrees over horizontal and 3 degrees vertical plane< 55 dBm< 10 dBm27,28,35,36
Wireless Wire nRAY< 1 degree single pattern and full span 3 degrees over horizontal and 3 degrees vertical plane< 55 dBm or <40 dBm with EU region< 10 dBm31

*center sector is calibrated center of beamforming array

Regions

MikroTik 802.11ad devices support frequency range: 57240 MHz - 67080 MHz, frequency and channel use can be limited if "region" parameter is used.

Regionlower frequencyupper frequencyusable channels
USA57.24 GHz70.20 GHz1, 2, 3, 4, 5, 6
Canada57.24 GHz63.72 GHz1, 2, 3
Asia57.24 GHz63.72 GHz1, 2, 3
EU57.24 GHz65.88 GHz1, 2, 3, 4
Japan57.24 GHz65.88 GHz1, 2, 3, 4
Australia57.24 GHz65.88 GHz1, 2, 3, 4
China59.40 GHz63.72 GHz2, 3

Connection issues

In order to connect devices they need to be in direct visibility, "scan-list" on client device needs to include "frequency" used on AP device. LHG60 devices require very precise alignment in order to get best performance in higher distances.

SNMP OIDs for monitoring

From RouterOS>=6.42rc6 SNMP support for W60G interface monitoring is added

For main interfaces:
1.3.6.1.4.1.14988.1.1.1.8.1.2.1  integer  Mode
1.3.6.1.4.1.14988.1.1.1.8.1.3.1  string   SSID
1.3.6.1.4.1.14988.1.1.1.8.1.4.1  integer  Connected status
1.3.6.1.4.1.14988.1.1.1.8.1.5.1  string   Remote MAC
1.3.6.1.4.1.14988.1.1.1.8.1.6.1  integer  Frequency
1.3.6.1.4.1.14988.1.1.1.8.1.7.1  integer  MCS
1.3.6.1.4.1.14988.1.1.1.8.1.8.1  integer  Signal quality
1.3.6.1.4.1.14988.1.1.1.8.1.9.1  integer  tx-sector
1.3.6.1.4.1.14988.1.1.1.8.1.11.1 string   Sector info
1.3.6.1.4.1.14988.1.1.1.8.1.12.1 integer  RSSI
1.3.6.1.4.1.14988.1.1.1.8.1.13.1 gauge32  PHY rate

station interfaces will be numbered under different table:

1.3.6.1.4.1.14988.1.1.1.9.1.2.(interfaceID) = integer Connected status
1.3.6.1.4.1.14988.1.1.1.9.1.3.(interfaceID) = Hex-STRING mac-address
1.3.6.1.4.1.14988.1.1.1.9.1.4.(interfaceID) = INTEGER: MCS 
1.3.6.1.4.1.14988.1.1.1.9.1.5.(interfaceID) = INTEGER: Signal Quality Index
1.3.6.1.4.1.14988.1.1.1.9.1.6.(interfaceID) = INTEGER: tx-sector
1.3.6.1.4.1.14988.1.1.1.9.1.8.(interfaceID) = Gauge32: data-rate [Mbps]
1.3.6.1.4.1.14988.1.1.1.9.1.9.(interfaceID) = INTEGER: RSSI
1.3.6.1.4.1.14988.1.1.1.9.1.10.(interfaceID) = INTEGER: distance [cm]

InterfaceID is added from 3 and increases by +1 for each connected station. More information about SNMP functionality and MIB files can be found in SNMP manual

Configuration Reset For Wireless Wire kits

Reset button has same functionality as on other devices, explained in detail here

5 second button hold on startup (USR LED light starts flashing) - resets to password protected state.

10 second button hold on startup (USR LED turns solid after flashing) - completely removes configuration.



After complete removal of configuration, only mac-telnet  connection may be established


Disks

Page edited by Antons B.

Summary

Sub-menu: /disk

This menu will list all attached storage devices, presuming that they are supported and in working condition. This is especially useful for RouterBOARD devices with SD/CF/USB/SATA/NVMe slots and x86 systems with additional dedicated storage drives - as the built-in storage is quite small, an external drive comes in very handy when you want a big User Manager database, proxy cache or possibly SMB shares on your router.

You can add as many external or secondary drives as you want, and select any number of them for each of the mentioned feature usages. For example, User Manager could be used on 3 disks, one of them would be the active database, and the rest would be backups. You can then add a fourth disk, copy the active data to it - unmount - unplug it - and move to another server, to keep using the actual database. This means migration and backup are made easy!

Disks carry names where they are physically connected.

ROSE-storage - package adds additional enterprise data center functionality to RouterOS.
Current manual page does not include additional features included in
ROSE-storage package.

Properties

PropertyDescription
eject-drive ()Safely unmounts (ejects) drive of your selection by using "slot" that is assigned to it. After issuing this command it can be removed from host device.
format-drive ()Command to initiate disk formatting process. Contains additional properties of its own. Such as "file-system" and "label".
  • select disk (slot) that should be formatted
  • file-system ('exfat', 'ext4', 'fat32' or 'wipe') - Format disk with type ExFAT, FAT32 or EXT4 or securely wipe all data
  • label 
  • mbr-partition-table - make mbr partition table
reset-counters
Resets disk (slot) statistics
monitor-traffic
Check real time disk performance and health stats
test

allows performing performance tests of selected device (Available from RouterOS 7.16)

  • disk - device or devices for test
  • direction - ('read','write') 
  • duration - (int) 
  • pattern - ('random', 'sequential')
  • thread-count - (int)
  • block-size - size of block to be used for testing
  • type - ('device', 'filesystem')

Flags

PropertyDescription
X - disabled

Disabled device

E - empty

Empty slot

B - BLOCK-DEVICE

The "B - BLOCK-DEVICE"- Flag means that this device works using blocks for input/output operations. In the context of RouterOS, its distinction is crucial, as it helps determine whether a device is functioning as a data carrier or simply providing information about the disk layout structure. This difference becomes important when considering the extender with the device behind it. If a device is marked with the letter "B", this indicates its ability to be used as storage or memory. In contrast, devices that do not have a "B" mark are designed primarily to understand the structure of the disk.

This allows to quickly recognize the presence of a PCIe or SAS expander, as well as detect the presence of drives in the first expander. In addition, it allows you to estimate the speed of the connection to which each device is connected.

However, the most notable benefit of the "B" flag is its ability to instantly indicate whether a device can be formatted or used for RAID purposes.

M - mountedMounted partition
F - formattingThe device is currently in the formatting process
p - partitionThe device has a partition
f - raid-member-failedThese options are used with the ROSE package.
r - raid-member
c - encrypted
g - guid-partition-table
t - nvme-tcp-export
i - iscsi-export
s - smb-export
n - nfs-export
O - tcg-opal-self-encryption-enabled
o - tcg-opal-self-encryption-supported

Settings

Property
Description
auto-smb-sharing (yes | no; Default: no)Enables dynamic SMB shares when new disk/partition item is added in "/disk"
auto-smb-user (list of strings; Default: ) Default value for smb-sharing/smb-user setting, when new disk/partition item is added in "/disk"
auto-media-share (yes | no; Default: no)Enables media dynamically when new disk/partition item is added in "/disk"
auto-media-interface (list of strings; Default: )Interface that will be used in dynamic instance for ip/media when new disk/partition item is added in "/disk"

Notes

With "auto-smb-sharing=yes" and "/ip smb share enabled=auto" SMB server gets enabled when a storage device is physically plugged in

Examples

Formatting attached storage unit - Simple

1. Disk is attached, and already mounted automatically by the system.

[admin@MikroTik] > disk print
Flags: B - BLOCK-DEVICE; M, F - FORMATTING
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
#    SLOT  MODEL           SERIAL            INTERFACE                  SIZE           FREE  FS
0 BM usb1  USB Flash Disk  FBA0911260071572  USB 2.00 480Mbps  2 004 877 312  1 921 835 008  ext4
[admin@MikroTik] > /file print
 # NAME                        TYPE          SIZE CREATION-TIME
 0 skins                       directory          jan/01/1970 03:00:01
 1 pub                         directory          feb/04/1970 21:31:40
 2 usb1                        disk               mar/07/2022 14:05:16

2. Formatting the disk, in either of two supported file-systems (ext4 or fat32). 

[admin@MikroTik] > /disk format-drive usb1 file-system=ext4 mbr-partition-table=no
  formatted: 100%

3. It's done! Drive is formatted and should be automatically mounted after formatting process is finished. 

Formatting attached storage unit - Detailed

Let us presume that you have added a storage device to your device that is running RouterOS. System will try to automatically mount it and in such case if storage is formatted in a supported file-system and partition record, it will be found in "/files" menu moments after you plugged it in to the host device.

If not, here is what you have to do.

1. Do a quick print of disk menu, to make sure that router sees the attached storage.

[admin@MikroTik] > disk print
Flags: B - BLOCK-DEVICE; M, F - FORMATTING
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
#    SLOT  MODEL           SERIAL            INTERFACE                  SIZE           FREE  FS
0 BM usb1  USB Flash Disk  FBA0911260071572  USB 2.00 480Mbps  2 004 877 312  1 921 835 008  ext4

We can here see that system sees one storage drive and also that it is formatted with a known file-system type.

When running file menu print-out we also see that is mounted. 

[admin@MikroTik] > file print
 # NAME     TYPE    SIZE CREATION-TIME
 0 usb1     disk         mar/07/2022 14:05:16
 1 skins    directory    jan/01/1970 03:00:01
 2 pub      directory    feb/04/1970 21:31:40


2. To formatting drive - we issue command with previously know id or name(slot) and with desired file-system (ext4 or fat32), we can also assign label to device as I did in this example and make mbr partition table

[admin@MikroTik] > /disk format-drive usb1 file-system=ext4 label=usb-flash mbr-partition-table=yes
  formatted: 100%

Note: In printout, you can see that there is a progress percentage counter in formatting process. For larger storage drives, it might take longer for this process to finish, so be patient.

If multiple GPT partitions are needed format drive without partition table and add them manually:

[admin@MikroTik] > /disk format-drive usb1 file-system=ext4 label=usb-flash mbr-partition-table=no
  formatted: 100%
[admin@MikroTik] > /disk add type=partition parent=usb1 partition-size=200M
[admin@MikroTik] > /disk add type=partition parent=usb1 partition-size=500M
[admin@MikroTik] > /disk add type=partition parent=usb1 slot=usb1-last-partition

Note: Slot (partition or disk name) is assumed automatically, but can be overwritten by using slot parameter.
If partition size is not used all available space will be used from last partition.
To offset partition start "partition-offset" parameter can be used.

Web-Proxy cache configuration example

Enter proxy cache path under IP -> Proxy menu and web proxy store is automatically created in files menu. If a non-existent directory path is used, an additional sub-directory is also created automatically. 

[admin@MikroTik] >  /ip proxy set cache-path=usb1/cache-n-db/proxy/

...

[admin@MikroTik] >  /file print
 # NAME                                              TYPE                             SIZE CREATION-TIME       
 0 skins                                             directory                             mar/02/2015 18:56:23
 1 sys-note.txt                                      .txt file                        23   jul/03/2015 11:40:48
 2 usb1                                             disk                                  jul/03/2015 11:35:05
 3 usb1/lost+found                                  directory                             jul/03/2015 11:34:56
 4 usb1/cache-n-db                                  directory                             jul/03/2015 11:41:54
 4 usb1/cache-n-db/proxy                            web-proxy store                       jul/03/2015 11:42:09

Log on disk configuration example

When configuring logging on disk make sure that you create directories in which you want to store the log files manually, as non-existent directories will NOT be automatically created in this case. 

[admin@MikroTik] >  /system logging action set disk disk-file-name=/disk1/log

...

[admin@MikroTik] >  /file print where name~"disk1/log"
 # NAME                                              TYPE                             SIZE CREATION-TIME       
 0 disk1/log                                        directory                             jul/03/2015 12:44:09
 1 disk1/log/syslog.0.txt                           .txt file                         160 jul/03/2015 12:44:11

Note: Logging topics such as firewall, web-proxy and some other topics that tend to save a large amount or rapid printing of logs on system NAND disk might cause it to wear out faster, so using some attached storage or remote logging is recommended in this case or save data in RAM folder

Allocate RAM to folder

It is possible to add folders linked to RAM. Folders will be emptied on reboot or power loss.
RAM will be filled up to tmpfs-max-size and if this variable in not provided - up to 1/2 from available RAM.

[admin@MikroTik] >  /disk add type=tmpfs tmpfs-max-size=100M
[admin@MikroTik] > file print 
Columns: NAME, TYPE, SIZE, CREATION-TIME
#  NAME            TYPE       SIZE             CREATION-TIME       
0  tmp1             disk     100 003 840        dec/12/2022 11:01:48

Test disk performance


Disk performance tests may slowly degrade disk health

On write tests all files and file systems on disks will be destroyed


Starting from 7.16 to run disk performance tests. Disks has to be disabled or without mountable file system (unformatted).
Check available disks, if disk is already mounted - disable it.

[admin@MikroTik] > disk print
Flags: B - BLOCK-DEVICE; M - MOUNTED
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
#    SLOT  MODEL             SERIAL         INTERFACE                    SIZE            FREE  FS
0 BM usb1  JMicron External  DD56419883891  USB 3.10 5000Mbps  64 023 257 088  62 692 188 160  ext4

[admin@MikroTik] > disk disable usb1

[admin@MikroTik] > disk test disk=usb2 pattern=sequential  type=device thread-count=4 block-size=4K direction=write
Columns: SEQ, RATE, IOPS, DISK, TYPE, PATTERN, DIR, BSIZE, THREADS
SEQ  RATE          IOPS  DISK  TYPE    PATTERN     DIR    BSIZE  THREADS
0    1622.5Mbps  49 516  usb2  device  sequential  write   4096        4
1    26.2Mbps       800  usb2  device  sequential  write   4096        4
2    33.0Mbps     1 008  usb2  device  sequential  write   4096        4
3    11.7Mbps       360  usb2  device  sequential  write   4096        4
4    28.5Mbps       872  usb2  device  sequential  write   4096        4
5    34.6Mbps     1 056  usb2  device  sequential  write   4096        4
6    33.8Mbps     1 032  usb2  device  sequential  write   4096        4
TOT  255.7Mbps    7 806  usb2  device  sequential  write   4096        4



Scripting

Page edited by Matīss O.

Scripting language manual

This manual provides an introduction to RouterOS's built-in powerful scripting language.

Scripting host provides a way to automate some router maintenance tasks by means of executing user-defined scripts bounded to some event occurrence.

Scripts can be stored in the Script repository or can be written directly to the console. The events used to trigger script execution include, but are not limited to the System Scheduler, the Traffic Monitoring Tool, and the Netwatch Tool generated events.

If you are already familiar with scripting in RouterOS, you might want to see our Tips & Tricks.

Line structure

The RouterOS script is divided into a number of command lines. Command lines are executed one by one until the end of the script or until a runtime error occurs.

Command-line

The RouterOS console uses the following command syntax:

[prefix] [path] command [uparam] [param=[value]] .. [param=[value]]

  • [prefix] - ":" or "/" character which indicates if a command is ICE or path. It may not be required.
  • [path] - relative path to the desired menu level. It may not be required.
  • command - one of the commands available at the specified menu level.
  • [uparam] - unnamed parameter, must be specified if the command requires it.
  • [params] - a sequence of named parameters followed by respective values

The end of the command line is represented by the token “;” or NEWLINE. Sometimes “;” or NEWLINE is not required to end the command line.

Single command inside (), [] or {} does not require any end-of-command character. The end of the command is determined by the content of the whole script

:if ( true ) do={ :put "lala" }

Each command line inside another command line starts and ends with square brackets "[ ]" (command concatenation).

:put [/ip route get [find gateway=1.1.1.1]]; 

Notice that the code above contains three command lines:

  • :put
  • /ip route get
  • find gateway=1.1.1.1

Command-line can be constructed from more than one physical line by following line joining rules.

Physical Line

A physical line is a sequence of characters terminated by an end-of-line (EOL) sequence. Any of the standard platform line termination sequences can be used:

  • Unix – ASCII LF;
  • Windows – ASCII CR LF;
  • mac – ASCII CR;

Standard C conventions for newline characters can be used ( the \n character).

Comments

The following rules apply to a comment:

  • A comment starts with a hash character (#) and ends at the end of the physical line.
  • RouterOS does not support multiline comments.
  • If a # character appears inside the string it is not considered a comment.
Example
# this is a comment 
# next line comment
:global a; # another valid comment

:global myStr "part of the string # is not a comment"

Line joining

Two or more physical lines may be joined into logical lines using the backslash character (\).

The following rules apply to using backslash as a line-joining tool:

  • A line ending in a backslash cannot carry a comment.
  • A backslash does not continue a comment.
  • A backslash does not continue a token except for string literals.
  • A backslash is illegal elsewhere on a line outside a string literal.
Example
:if ($a = true \
	and $b=false) do={ :put "$a $b"; } 
:if ($a = true \ # bad comment 
	and $b=false) do={ :put "$a $b"; }
# comment \
	continued - invalid (syntax error)

Whitespace between tokens

Whitespace can be used to separate tokens. Whitespace is necessary between two tokens only if their concatenation could be interpreted as a different token. Example:

{  
	:local a true; :local b false;
# whitespace is not required 
	:put (a&&b); 
# whitespace is required  
	:put (a and b); 
}

Whitespace characters are not allowed

  • between '<parameter>='
  • between 'from=' 'to=' 'step=' 'in=' 'do=' 'else='

Example:

#incorrect: 
:for i from = 1 to = 2 do = { :put $i } 
#correct syntax: 
:for i from=1 to=2 do={ :put $i } 
:for i from= 1 to= 2 do={ :put $i } 

#incorrect 
/ip route add gateway = 3.3.3.3 
#correct 
/ip route add gateway=3.3.3.3
Scopes

Variables can be used only in certain regions of the script called scopes. These regions determine the visibility of the variable. There are two types of scopes - global and local. A variable declared within a block is accessible only within that block and blocks enclosed by it, and only after the point of declaration.

Global scope

Global scope or root scope is the default scope of the script. It is created automatically and can not be turned off.

Local scope

User can define their own groups to block access to certain variables, these scopes are called local scopes. Each local scope is enclosed in curly braces ("{ }").

{  
	:local a 3;
	{  
		:local b 4;  
		:put ($a+$b); 
	} #line below will show variable b in light red color since it is not defined in scope  
	:put ($a+$b); 
}

In the code above variable, b has local scope and will not be accessible after a closing curly brace.

Each line written in the terminal is treated as local scope

So for example, the defined local variable will not be visible in the next command line and will generate a syntax error

[admin@MikroTik] > :local myVar a;
[admin@MikroTik] > :put $myVar
syntax error (line 1 column 7)
Do not define global variables inside local scopes.

Note that even variable can be defined as global, it will be available only from its scope unless it is not referenced to be visible outside of the scope.

{  
	:local a 3; 
	{  
		:global b 4; 
	}  
	:put ($a+$b); 
}

The code above will output 3, because outside of the scope b is not visible. 

The following code will fix the problem and will output 7:

{  
	:local a 3; 
	{  
		:global b 4; 
	}
	:global b;  
	:put ($a+$b); 
}


Keywords

The following words are keywords and cannot be used as variable and function names:

and       or       in

Delimiters

The following tokens serve as delimiters in the grammar:

()  []  {}  :   ;   $   / 

Data types

RouterOS scripting language has the following data types:

TypeDescription
num (number)- 64bit signed integer, possible hexadecimal input;
bool (boolean)- values can bee true or false;
str (string)- character sequence;
ip- IP address;
ip-prefix- IP prefix;
ip6- IPv6 address
ip6-prefix- IPv6 prefix
id (internal ID)- hexadecimal value prefixed by '*' sign. Each menu item has an assigned unique number - internal ID;
time- date and time value;
array- sequence of values organized in an array;
nil- default variable type if no value is assigned;

Constant Escape Sequences

Following escape sequences can be used to define certain special characters within a string:

\"Insert double quote
\\Insert backslash
\nInsert newline
\rInsert carriage return
\tInsert horizontal tab
\$Output $ character. Otherwise, $ is used to link the variable.
\?Output ? character. Otherwise ? is used to print "help" in the console. Removed since v7.1rc2
\_- space
\a- BEL (0x07)
\b- backspace (0x08)
\f- form feed (0xFF)
\vInsert vertical tab
\xxA print character from hex value. Hex numbers should use capital letters.
Example
:put "\48\45\4C\4C\4F\r\nThis\r\nis\r\na\r\ntest";

which will show on the display
HELLO
This
is
a
test

Operators

Arithmetic Operators

Usual arithmetic operators are supported in the RouterOS scripting language

OperatorDescriptionExample
"+"binary addition:put (3+4);
"-"binary subtraction:put (1-6);
"*"binary multiplication:put (4*5);
"/"binary division:put (10 / 2); :put ((10)/2)
"%"modulo operation:put (5 % 3);
"-"unary negation{ :local a 1; :put (-a); }

Note: for the division to work you have to use braces or spaces around the dividend so it is not mistaken as an IP address

Relational Operators

OperatorDescriptionExample
"<"less:put (3<4);
">"greater:put (3>4);
"="equal:put (2=2);
"<="less or equal
">="greater or equal
"!="not equal

Logical Operators

OperatorDescriptionExample
“!”logical NOT:put (!true);
“&&”, “and”logical AND:put (true&&true)
“||”, “or”logical OR:put (true||false);
“in”
:put (1.1.1.1/32 in 1.0.0.0/8);

Bitwise Operators

Bitwise operators are working on number, IP, and IPv6 address data types.

OperatorDescriptionExample
“~”bit inversion:put (~0.0.0.0)
:put (~::ffff)
“|”bitwise OR. Performs logical OR operation on each pair of corresponding bits. In each pair the result is “1” if one of the bits or both bits is “1”, otherwise the result is “0”.:put (192.168.88.0|0.0.0.255)
:put (2001::1|::ffff)
“^”bitwise XOR. The same as OR, but the result in each position is “1” if two bits are not equal, and “0” if the bits are equal.:put (1.1.1.1^255.255.0.0)
:put (2001::ffff:1^::ffff:0)
“&”bitwise AND. In each pair, the result is “1” if the first and second bit is “1”. Otherwise, the result is “0”.:put (192.168.88.77&255.255.255.0)
:put (2001::1111&ffff::)
“<<”left shift by a given amount of bits, not supported for IPv6 address data type:put (192.168.88.77<<8)
“>>”right shift by a given amount of bits, not supported for IPv6 address data type:put (192.168.88.77>>24)

Calculate the subnet address from the given IP and CIDR Netmask using the "&" operator:

{ 
:local IP 192.168.88.77; 
:local CIDRnetmask 255.255.255.0; 
:put ($IP&$CIDRnetmask); 
}

Get the last 8 bits from the given IP addresses:

 :put (192.168.88.77&0.0.0.255);

Use the "|" operator and inverted CIDR mask to calculate the broadcast address:

{ 
:local IP 192.168.88.77; 
:local Network 192.168.88.0; 
:local CIDRnetmask 255.255.255.0; 
:local InvertedCIDR (~$CIDRnetmask); 
:put ($Network|$InvertedCIDR) 
}

Concatenation Operators

OperatorDescriptionExample
"."concatenates two strings:put ("concatenate" . " " . "string");
","concatenates two arrays or adds an element to the array:put ({1;2;3} , 5 );

It is possible to add variable values to strings without a concatenation operator:

:global myVar "world"; 

:put ("Hello " . $myVar); 
# next line does the same as above 
:put "Hello $myVar";

By using $[] and $() in the string it is possible to add expressions inside strings:

:local a 5; 
:local b 6; 
:put " 5x6 = $($a * $b)"; 

:put " We have $[ :len [/ip route find] ] routes";

Other Operators


OperatorDescriptionExample
“[]”command substitution. Can contain only a single command line:put [ :len "my test string"; ];
“()”subexpression or grouping operator:put ( "value is " . (4+5));
“$”substitution operator:global a 5; :put $a;
“~”the binary operator that matches value against POSIX extended regular expressionPrint all routes whose gateway ends with 202
/ip route print where gateway~"^[0-9 \\.]*202\$"
“->”Get an array element by key
[admin@x86] >:global aaa {a=1;b=2}
[admin@x86] > :put ($aaa->"a")
1
[admin@x86] > :put ($aaa->"b")
2

Variables

The scripting language has two types of variables:

  • global - accessible from all scripts created by the current user, defined by global keyword;
  • local - accessible only within the current scope, defined by local keyword.

There can be undefined variables. When a variable is undefined, the parser will try to look for variables set, for example, by DHCP lease-script or Hotspot on-login

Every variable, except for built-in RouterOS variables, must be declared before usage by local or global keywords. Undefined variables will be marked as undefined and will result in a compilation error. Example:

# following code will result in compilation error, because myVar is used without declaration 
:set myVar "my value"; 
:put $myVar

Correct code:

:local myVar; 
:set myVar "my value"; 
:put $myVar;

The exception is when using variables set, for example, by DHCP lease-script

/system script 
add name=myLeaseScript policy=\ 
	ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \ 
	source=":log info \$leaseActIP\r\ 
	\n:log info \$leaseActMAC\r\ 
	\n:log info \$leaseServerName\r\ 
	\n:log info \$leaseBound" 

/ip dhcp-server set myServer lease-script=myLeaseScript

Valid characters in variable names are letters and digits. If the variable name contains any other character, then the variable name should be put in double quotes. Example:

#valid variable name 
:local myVar; 
#invalid variable name 
:local my-var; 
#valid because double quoted 
:global "my-var";

If a variable is initially defined without value then the variable data type is set to nil, otherwise, a data type is determined automatically by the scripting engine. Sometimes conversion from one data type to another is required. It can be achieved using data conversion commands. Example:

#convert string to array 
:local myStr "1,2,3,4,5"; 
:put [:typeof $myStr]; 
:local myArr [:toarray $myStr]; 
:put [:typeof $myArr]

Variable names are case-sensitive.

:local myVar "hello" 
# following line will generate error, because variable myVAr is not defined 
:put $myVAr 
# correct code 
:put $myVar

Set command without value will un-define the variable (remove from environment, new in v6.2)

#remove variable from environment 
:global myVar "myValue" 
:set myVar;

Use quotes on the full variable name when the name of the variable contains operators. Example:

:local "my-Var";
:set "my-Var" "my value";
:put $"my-Var";

Reserved variable names

All built-in RouterOS properties are reserved variables. Variables that will be defined the same as the RouterOS built-in properties can cause errors. To avoid such errors, use custom designations.

For example, the following script will not work:

{ 
:local type "ether1"; 
/interface print where name=$type; 
}

But will work with different defined variables:

 { 
:local customname "ether1"; 
/interface print where name=$customname; 
}

Commands

Global commands

Every global command should start with the ":" token, otherwise, it will be treated as a variable.

CommandSyntaxDescriptionExample
/
go to the root menu
..
go back by one menu level
?
list all available menu commands and brief descriptions
global:global <var> [<value>]define a global variable:global myVar "something"; :put $myVar;
local:local <var> [<value>]define the local variable{ :local myLocalVar "I am local"; :put $myVar; }
beep:beep <freq> <length>beep built-in speaker
convert:convert from=[arg] to=[arg]

Converts specified value from one format to another. By default uses an automatically parsed value, if the "from" format is not specified (for example, "001" becomes "1", "10.1" becomes "10.0.0.1", etc.).

from specifies the format of the value - base32, base64, hex, raw, rot13, url.

to specifies the format of the output value - base32, base64, hex, raw, rot13, url.

transform to transform values - lc (transforms value to be in lowercases), uc (uppercases), lcfirst (first value to lowercase), ucfirst (first value to uppercase)

:put [:convert 001 to=hex ]

31

:put [:convert [/ip dhcp-client/option/get hostname raw-value] from=hex to=raw ]

MikroTik

:put [convert transform=lc "AAA"]         

aaa

delay:delay <time>do nothing for a given period of time
environment:environment print <start>print initialized variable information:global myVar true; :environment print;
error:error <output>Generate console error and stop executing the script
execute:execute <expression>

Execute the script in the background. The result can be written in the file by setting a "file" parameter or printed to the CLI by setting "as-string".

When using the "as-string" parameter executed script is blocked (not executed in the background).

Executed script can not be larger than 64kB

{
:local j [:execute {/interface print follow where [:log info ~Sname~]}];
:delay 10s;
:do { /system script job remove $j } on-error={}
}
find:find <arg> <arg> <start>return position of a substring or array element:put [:find "abc" "a" -1];
jobname
:jobnamereturn current script name
Limit script execution to single instance
:if ([/system script job print count-only as-value where script=[:jobname] ] > 1) do={
  :error "script instance already running"
  }


len:len <expression>return string length or array element count:put [:len "length=8"];
log:log <topic> <message>write a message to the system log. Available topics are "debug, error, info and warning":log info "Hello from script";
onerror:onerror <var_name> in={<command>} do={<expression>}

The command used to catch errors and get error details. The do={...} block is executed, when in={...} block has an error,  and error details are written in <var_name> variable. 

Parameter order is important. The "error" parameter must be set before "do" block, otherwise do block will not see the local variable. 


:onerror can return false (if there is no error) and true (if there is an error) values, so it can be used in :if condition statement scripts.

:onerror errorName in={ :error "failure" } do={ :put "Critical $errorName" }
parse:parse <expression>parse the string and return parsed console commands. Can be used as a function.:global myFunc [:parse ":put hello!"];
$myFunc;
pick:pick <var> <start>[<count>]

return range of elements or substring. If the count is not specified, will return only one element from an array.

  • var - value to pick elements from
  • start - element to start picking from (the first element index is 0)
  • count - number of elements to pick starting from the first element with index=0


[admin@MikroTik] > :put [:pick "abcde" 1 3]
bc


put:put <expression>put the supplied argument into the console:put "Hello world"
resolve:resolve <arg>return the IP address of the given DNS name:put [:resolve "www.mikrotik.com"];
retry:retry command=<expr> delay=[num] max=[num] on-error=<expr>Try to execute the given command "max" amount of times with a given "delay" between tries. On failure, execute the expression given in the "on-error" block

:retry command={abc} delay=1 max=2 on-error={:put "got error"}
got error

:retry command={abc} delay=1 max=2 on-error={:put "got error"}
got error
typeof:typeof <var>the return data type of variable:put [:typeof 4];
rndnum:rndnum from=[num] to=[num]random number generator:put [:rndnum from=1 to=99];
rndstr:rndstr from=[str] length=[num]

Random string generator.

from specifies characters to construct the string from and defaults to all ASCII letters and numerals.
length specifies the length of the string to create and defaults to 16.

:put [:rndnum from="abcdef%^&" length=33];



set:set <var> [<value>]assign value to a declared variable.:global a; :set a true;
serialize:serialize [<value>] to=[arg]

Serialize specified value/array to JSON or dsv (delimeter separated values) format.

to specifies the format - json, dsv

delimeter sets the "separator".

oder specifies the order for variables.

options specifies additional options - json.pretty (makes the JSON output more visually appealing), dsv.wrap-strings (wraps string values inside quatation marks), dsv.ignore-size (if array values have different sizes, e.g. a=(1,2);b=(3,4);c=(5,6,7),this option will work around array size mismatch error and set "empty" values in those slots).


:put [:serialize value=a,b,c to=json]                 
["a","b","c"]

:local test {a=(1,2,3);b=(4,5,6);c=(7,"text",9)}; :put [ :serialize to=dsv delimiter=";" value=$test order=("c","a","b") ]     
c;a;b
7;1;4
text;2;5
9;3;6


deserialize:deserialize [<value>] from=[arg]

Deserialize specified value/array from JSON or dsv (delimeter separated values) format.

from specifies the format - json, dsv

See "serialize" above for more parameters.

:put [:deserialize from=json value="[\"a\",\"b\",\"c\"]"]
a;b;c
time:time <expression>return interval of time needed to execute the command:put [:time {:for i from=1 to=10 do={ :delay 100ms }}];
timestamp:timestampreturns the time since epoch, where epoch is January 1, 1970 (Thursday), not counting leap seconds
[admin@MikroTik] > :put [:timestamp]
2735w21:41:43.481891543
or
[admin@MikroTik] > :put [:timestamp]
2735w1d21:41:43.481891543
with the day offset
toarray:toarray <var>convert a variable to the array
tobool:tobool <var>convert a variable to boolean
toid:toid <var>convert a variable to internal ID
toip:toip <var>convert a variable to IP address
toip6:toip6 <var>convert a variable to IPv6 address
tonum:tonum <var>convert a variable to an integer
tostr:tostr <var>convert a variable to a string
totime:totime <var>convert a variable to time

Menu specific commands

Common commands

The following commands are available from most sub-menus:

CommandSyntaxDescription
addadd <param>=<value>..<param>=<value>add new item
removeremove <id>remove selected item
enableenable <id>enable selected item
disabledisable <id>disable selected item
setset <id> <param>=<value>..<param>=<value>change selected items parameter, more than one parameter can be specified at the time. The parameter can be unset by specifying '!' before the parameter.

Example:
/ip firewall filter add chain=blah action=accept protocol=tcp port=123 nth=4,2
print
set 0 !port chain=blah2 !nth protocol=udp

getget <id> <param>=<value>get the selected item's parameter value
printprint <param><param>=[<value>]print menu items. Output depends on the print parameters specified. The most common print parameters are described here
exportexport [file=<value>]export configuration from the current menu and its sub-menus (if present). If the file parameter is specified output will be written to the file with the extension '.rsc', otherwise the output will be printed to the console. Exported commands can be imported by import command
editedit <id> <param>edit selected items property in the built-in text editor
findfind <expression>Returns list of internal numbers for items that are matched by given expression. For example:  :put [/interface find name~"ether"]
import

The import command is available from the root menu and is used to import configuration from files created by an export command or written manually by hand.

Starting from 7.16.x version, its possible to catch syntax errors:

[admin@admin] > do { import test.rsc } on-error={ :put "Failure" }  
Failure

New parameter onerror can be used:

[admin@admin] > onerror e in={ import test.rsc } do={ :put "Failure - $e" }       
Failure - Script Error: bad command name this (line 1 column 1)

In addition, the import command has new options in verbose mode - the dry-run parameter is specially designed for debugging and can find multiple errors without changing the configuration.

[admin@admin] > import test.rsc verbose=yes dry-run 
#line 1
this
bad command name this (line 1 column 1)
...
Script Error: found 5 error(s) in import file
print parameters

Several parameters are available for print command:

ParameterDescriptionExample
append

as-valueprint output as an array of parameters and its values:put [/ip address print as-value]
briefprint brief description
detailprint detailed description, the output is not as readable as brief output but may be useful to view all parameters
count-onlyprint only count of menu items
fileprint output to a file
followprint all current entries and track new entries until ctrl-c is pressed, very useful when viewing log entries/log print follow
follow-onlyprint and track only new entries until ctrl-c is pressed, very useful when viewing log entries/log print follow-only
fromprint parameters only from specified item/user print from=admin
intervalcontinuously print output in a selected time interval, useful to track down changes where follow is not acceptable/interface print interval=2
terseshow details in a compact and machine-friendly format
value-listshow values single per line (good for parsing purposes)
without-pagingIf the output does not fit in the console screen then do not stop, print all information in one piece
whereexpressions followed by where parameters can be used to filter outmatched entries/ip route print where interface="ether1"

More than one parameter can be specified at a time, for example, /ip route print count-only interval=1 where interface="ether1"

Loops and conditional statements

Loops

CommandSyntaxDescription
do..while:do { <commands> } while=( <conditions> ); :while ( <conditions> ) do={ <commands> };execute commands until a given condition is met.
for:for <var> from=<int> to=<int> step=<int> do={ <commands> }execute commands over a given number of iterations
foreach:foreach <var> in=<array> do={ <commands> };execute commands for each element in a list

Conditional statement

CommandSyntaxDescription
if:if (<condition>) do={<commands>} else={<commands>} <expression>If a given condition is true then execute commands in the do block, otherwise execute commands in the else block if specified.

Example:

{  
	:local myBool true;  
	:if ($myBool = false) do={ :put "value is false" } else={ :put "value is true" } 
}

Functions

Scripting language does not allow you to create functions directly, however, you could use :parse command as a workaround.

Starting from v6.2 new syntax is added to easier define such functions and even pass parameters. It is also possible to return function value with :return command.

See examples below:

#define function and run it
:global myFunc do={:put "hello from function"}
$myFunc

output:
hello from function

#pass arguments to the function
:global myFunc do={:put "arg a=$a"; :put "arg '1'=$1"} 
$myFunc a="this is arg a value" "this is arg1 value"

output:
arg a=this is arg a value
arg '1'=this is arg1 value

Notice that there are two ways how to pass arguments:

  • pass arg with a specific name ("a" in our example)
  • pass value without arg name, in such case arg "1", "2" .. "n" is used.

Return example

:global myFunc do={ :return ($a + $b)} 
:put [$myFunc a=6 b=2] 

output: 
8

You can even clone an existing script from the script environment and use it as a function.

#add script
/system script add name=myScript source=":put \"Hello $myVar !\""

:global myFunc [:parse [/system script get myScript source]]
$myFunc myVar=world

output:
Hello world !
If the function contains a defined global variable that names match the name of the passed parameter, then the globally defined variable is ignored, for compatibility with scripts written for older versions. This feature can change in future versions. Avoid using parameters with the same name as global variables.

For example:

:global my2 "123" 

:global myFunc do={ :global my2; :put $my2; :set my2 "lala"; :put $my2 } 
$myFunc my2=1234 
:put "global value $my2"

The output will be:

1234
lala
global value 123

Nested function example

Note: to call another function its name needs to be declared (the same as for variables)

:global funcA do={ :return 5 } 
:global funcB do={  
	:global funcA;  
	:return ([$funcA] + 4) 
} 
:put [$funcB] 

Output: 
9

Catch run-time errors

Starting from v6.2 scripting has the ability to catch run-time errors.

For example, the [code]:reslove[/code] command if failed will throw an error and break the script.

[admin@MikroTik] > { :put [:resolve www.example.com]; :put "lala";}
failure: dns name does not exist

Now we want to catch this error and proceed with our script:

:do {  
	:put [:resolve www.example.com]; 
} on-error={ :put "resolver failed"}; 
:put "lala" 

output: 

resolver failed 
lala

Operations with Arrays

Warning: Key name in the array contains any character other than a lowercase character, it should be put in quotes

For example:

[admin@ce0] > {:local a { "aX"=1 ; ay=2 }; :put ($a->"aX")} 
1

Loop through keys and values

"foreach" command can be used to loop through keys and elements:

[admin@ce0] > :foreach k,v in={2; "aX"=1 ; y=2; 5} do={:put ("$k=$v")} 

0=2 
1=5 
aX=1 
y=2

If the "foreach" command is used with one argument, then the element value will be returned:

[admin@ce0] > :foreach k in={2; "aX"=1 ; y=2; 5} do={:put ("$k")} 

2 
5 
1 
2

Note: If the array element has a key then these elements are sorted in alphabetical order, elements without keys are moved before elements with keys and their order is not changed (see example above).

Change the value of a single array element

[admin@MikroTik] > :global a {x=1; y=2}
[admin@MikroTik] > :set ($a->"x") 5 
[admin@MikroTik] > :environment print 
a={x=5; y=2}

Script repository

Sub-menu level: /system script

Contains all user-created scripts. Scripts can be executed in several different ways:

  • on event - scripts are executed automatically on some facility events ( scheduler, netwatch, VRRP)
  • by another script - running script within the script is allowed
  • manually - from console executingrun command or in winbox

Note: Only scripts (including schedulers, netwatch, etc) with equal or higher permission rights can execute other scripts.

PropertyDescription
comment (string; Default: )Descriptive comment for the script
dont-require-permissions (yes | no; Default: no)Bypass permissions check when the script is being executed, useful when scripts are being executed from services that have limited permissions, such as Netwatch
name (string; Default: "Script[num]")name of the script
policy (string; Default: ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon)list of applicable policies:
  • ftp - can log on remotely via FTP and send and retrieve files from the router
  • password - change passwords
  • policy - manage user policies, add and remove user
  • read - can retrieve the configuration
  • reboot - can reboot the router
  • sensitive - allows changing "hide sensitive" parameter
  • sniff - can run sniffer, torch, etc
  • test - can run ping, traceroute, bandwidth test
  • write - can change the configuration

Read more detailed policy descriptions here

source (string;)Script source code

Read-only status properties:

PropertyDescription
last-started (date)Date and time when the script was last invoked.
owner (string)The user who created the script
run-count (integer)Counter that counts how many times the script has been executed

Menu specific commands

CommandDescription
run (run [id|name])

Execute the specified script by ID or name using user permissions.

use-script-permissions

Additional parameter to execute script using script permissions.

Environment

Sub-menu level:

  • /system script environment
  • /environment

Contains all user-defined variables and their assigned values.

[admin@MikroTik] > :global example;
[admin@MikroTik] > :set example 123
[admin@MikroTik] > /environment print  
"example"=123


Read-only status properties:

PropertyDescription
name (string)Variable name
user (string)The user who defined variable
value ()The value assigned to a variable

Job

Sub-menu level: /system script job

Contains a list of all currently running scripts.
Read-only status properties:

PropertyDescription
owner (string)The user who is running the script
policy (array)List of all policies applied to the script
started (date)Local date and time when the script was started

See also

Peripherals

Page edited by Artis Bernāts

This article describes supported add-on peripherals for RouterBOARD hardware devices.

Cellular modems

RouterOS v7 supported cellular modems:

  • MikroTik modems
  • 3rd party modems supported by device class/type:
    • MBIM class USB interface 
    • USB-CDC class USB interface
    • RNDIS type USB interface
  • 3rd party modem with added support, see modem table below

Please note:

  • not all modems are listed in the supported modem table, some may work because modem manufacturers re-use the same hardware IDs and vice versa
  • customized, localized and locked units may have compatibility issues
  • 3rd party modem may require a modem configuration adjustment before it can be used with RouterOS
  • mini-PCIe modems with USB3.0 interface installed in mini-PCIe PCIe/USB2.0 enabled slot USB speed must be limited to USB2.0 speed or mini-PCIe shared PCIe/USB3.0 pins isolated. See the picture below table

Cellular modems

Modelvendor-iddevice-idTested RouterOS versionCommentsFormat
Alcatel IK40

v6.41RC11LTE interface, Modem can be configured only through modems configuration WEB page.USB
Alcatel IK41

v6.48Config-less LTE interfaceUSB
Android usb tethering interface

v6.7Some settings are ignored.USB
AnyData ADU-E630WH

v6( aka "USB Wireless HSDPA/UMTS 2.1GHz GSM/GPRS/EGPRS 900/17000MHz/CDMA 1x EVDO Rev.A")USB
Anteniti 3372h-153

7.12
USB
BandRich C501

v5.25 and v6.0
USB
Cinterion LTE Modem0x1e2d0x0061v7.14 and higherLTE interface, Some settings are ignored. Not full SMS functionality.MiniPCI-e
D-link DWM-1570x20010x7d02v6.xxWorks! Data Channel: 2, Info Channel: 3,Modem Init: AT+CFUN=1, vendor-id="0x2001" device-id="0x7d02" Some info from modem: > H/W Ver.: B1, F/W Ver.: 2.0.1eu, revision: +CGMR: MOLY.WR8.W1231.DC.WG.MP.V3, 2013/04/09 02:08 Different HW revisions might not work with RouterOSUSB
D-link DWM-222

v6.38

Multiple modem versions with same marketing name exist, only H/W ver: A1 supported as config-less LTE interface

USB
Dell DW5821e

v7.4beta4 and higherMBIM driver. Revision: T77W968.F1.0.0.5.2.VZ.013 044 M.2
Dell DW5821e-eSIM0x413c0x81e07.11 and higherMBIM driver. FW: T77W968.F1.0.0.5.2.GC.013. "at-chat" support addedM.2
DELL T99W1750x05c60x90d57.16 and higherMBIM driver. FW: T99W175.F0.1.0.0.9.GC.004. "at-chat" support addedM.2
Dell Wireless 5530 HSPA

v6.1 and higherData channel 0, Info channel 0, init: AT+CFUN=1 (needs manualy change profile by command AT*ENAP=1,1)MiniPCI-e
Ericsson F5521gw

v6.x and higher
MiniPCI-e
Fibocom FM150-AE/FM150-NA0x2cb70x0111v7.1beta5MBIM driver. Revision: 89603.1000.00.01.01.03M.2
Fibocom NL-952-EAU

v7.1beta5MBIM driver. Revision: 19600.7000.00.04.01.05M.2
Marvell PXA1802 based modems0x12860x4e31v7.2.2
mini-PCIe
Huawei E153

v6.31< and higher
USB
Huawei E171

v6.xxWorks! ppp interface, vendorid=0x12d1 deviceid=0x140cUSB
Huawei e3131

v6.xx and higherppp interfaceUSB
Huawei E3372h, E5576h, E8372h0x12d10x14dbv6.8

Config-less LTE interface for modems with vendor-id="0x12d1" device-id="0x14db"

Models with suffixes -320 and -608 will not work with RouterOS v6, please use v7 instead

Models with suffixes -325 works only with arm cpu

USB
Huawei E3276-150

v6.xxppp interfaceUSB
Huawei E3351

v6.24 and higher
USB
Huawei E3531

v6.24 or 6.40RC25There are different versions of this modem E3531-6 works from version 6.40RC25 as ppp, mbim supported only from RouterOS V7USB
Huawei e398

v6.xx and higherppp interfaceUSB
Huawei E5377

v6.36.1MIFI unit. No serial support, but works with IP on LTE interfaceUSB
Huawei E5673s-609

v6.xxLTE interfaceUSB
Huawei K5160

v6.37

v7.0beta6

v6 and v7 - config-less LTE interface 

v7 - by default will try to use modem in MBIM mode

USB
Huawei K5161

v6.47Config-less LTE interfaceUSB
Huawei ME909s-120

v6.28Recommended modem firmware version 11.617.24.00.00
To reduce LTE interface IP subnet mask to /32 configure modem with at-chat command:
/interface lte at-chat [find] input="AT^CUSTFEATURE=3,1"
MiniPCI-e
Huawei ME909u-521

v6.11
MiniPCI-e
Huawei MU609

v6.11
MiniPCI-e

Huawei MU709s-2



v6.28
MiniPCI-e

Huawei MS2372h-517



v7.12beta3ppp/serial interfaceUSB
Jaton MT421e

v6.40RC32LTE interface with Ethernet emulation (no configuration possible), LTE supported bands 42/43MiniPCI-e
Netgear Unite Explore 815S

v6.41MIFI unit. No serial support, but works with IP on LTE interface.USB
Novatel USB730L

v6.41RC6LTE interfaceUSB
Olivetti Olicard 500

v6.41RC11ppp interfaceUSB
Quectel EC20/EC21

v6.xxppp interface, there is page in wiki about Quectel: articleMiniPCI-e
Quectel BG770x2c7c0x0700v6.47Serial/PPP interface, single AT/modem channelOEM module
Quectel BG95-M3

v6.47

Serial/PPP interface, single AT/modem channel

Will not work in wAP R ac boards.

mini-PCIe
Quectel BG96

v6.45Serial/PPP interface, 2x AT/modem channelsmini-PCIe
Quectel EC25-EU0x2c7c0x0125v6.42

ppp/LTE interface, there is page in wiki about Quectel ppp mode: article

RouterOS v6  CDC-ECM mode - LTE interface receive address in modems internal network.

RouterOS v7 MBIM mode -  LTE interface uses APN IP address.

MiniPCI-e
Quectel EG25-G0x2c7c0x01256.48.3

RouterOS v6  CDC-ECM mode - LTE interface receive address in modems internal network.

RouterOS v7 MBIM mode -  LTE interface uses APN IP address.

In some boards may be required to disable SIM hot plug detection:

/interface lte set [find] modem-init="AT+QSIMDET=0,1"
MiniPCI-e
Quectel EM12-G0x2c7c0x0512v7.1beta5MBIM driverm.2
Quectel EP06

v6.42ppp/LTE interface, there is page in wiki about Quectel: articleMiniPCI-e
Quectel RM500Q-GL0x2c7c0x0800v7.1beta6MBIM driverm.2
Quectel RM500Q-AE0x2c7c0x0800v7.1beta6MBIM driverm.2
Quectel RM502Q-AE0x2c7c0x0800v7.1beta5MBIM driverm.2
Quectel RM510Q-GL0x2c7c0x08007.9MBIM driverm.2
Quectel UC15

v6.xxWorks, ppp interfaceMiniPCI-e
Quectel UC20

v6.xxWorks, ppp interfaceMiniPCI-e
R11e-4G0x2cd20x0003v6.42LTE interface. Supports multiple APN passthrough.MiniPCI-e
R11e-LTE60x2cd20x0004v6.39.2LTE interface. Supports multiple APN passthrough.MiniPCI-e
R11e-LTE0x2cd20x0001v6.39.2LTE interface. Supports multiple APN passthrough.MiniPCI-e
Sierra Netgear AirCard 320U

6.41Customer tested the modem with firmware 03.05.23USB
Sierra wireless MC73xx

v6.xx(ppp) v7.xx (LTE)Works! PPP interface. And starting with v7.xx it will support LTE interface with modem switched to expose the MBIM interface. MC7304 tested with firmware SWI9X15C_05.05.67.00MiniPCI-e
Sierra Wireless MC7430

v6.xx and higherData channel 2, Info channel 2, Modem init: AT+CGATT=0, Dial-command: AT+CGATT=1;D*99#, also needs 3.0 pins isolated (PINS:23,25,27,31,33)MiniPCI-e
Sierra Wireless MC74xx

v7.1

Basic functionality support for modems with MBIM interface/USB composition

mini-PCIe
Sierra Wireless MC7455

v7.3beta37

MBIM mode with extended support for USB compositions:

  • 1009 - diag,modem,mbim
  • 100D - diag,nmea,modem,mbim
mini-PCIe
Sierra Wireless MC7710/MC7700/MC7750

v5.25, v6.0 and 6.40RC43If modem uses firmware 3.5 it should be upgraded to 3.5.23.2 firmware release in order to work in RouterOS correctly again.MiniPCI-e
SIMcom SIM5360

v6.xxWorks! Using PPP interface, vendor-id="0x05c6" device-id="0x9000"MiniPCI-e / USB w/ converter
SIMcom SIM71000x1e0e0x9001v6.xx(ppp) v7.xx (LTE)Works! PPP interface. And starting with v7.xx it will support LTE interface. MiniPCI-e / USB w/ converter
SIMCom SIM8202G-M.2

v7.11MBIM driver supported: AT+CUSBCFG=usbid,1e0e,901em.2
SXT LTE

v6LTE interface. Old version of SXT LTEBuilt-in
Tele2.ru LTE-D402

v6.47Config-less LTE interface
Telecom NZ T-Stick ZTE MF-181

v6.0rc13Data Channel=2, Info Channel=2, APN internet.telecom.co.nz, PHONE=*99#. Tested ok for both data and SMS on CCR1016-12GUSB
Telit FN980m

v7.5AT#USBCFG=2 m.2
Telit LE9100x1bc70x1201v6.xxppp interfaceMiniPCI-e
Telit LE910C1

v6.46Non-configurable from RouterOSMiniPCI-e
Telit LM940

v6.44LTE interface in some cases needs 3.0 pins isolated (PINS:23,25,27,29,31,33)MiniPCI-e
Telit LM960

v6.46LTE interface in some cases needs 3.0 pins isolated (PINS:23,25,27,29,31,33)MiniPCI-e
TPS (Turning Point Solution) GCT450

v6.48Config-less LTE interfaceMiniPCI-e
Vodafone (Huawei) K4203

v7.xxNot supported in ROS v6, but as this modem supports MBIM drivers support will be possible in ROS v7.USB
Vodafone K4201-Z

v6.8Some settings are ignored. LTE interface.USB
Vodafone K4305

v6.7Some settings are ignored.USB
Vodafone K5160

v6.37Some settings are ignored.USB
Yota LU150

v5.22 and v6.4Some settings are ignored. USB
Yota wifi modem

v6.7Some settings are ignored. USB
Yota WLTUBA-107

v6.0Some settings are ignored. USB
ZTE 821D

v6.xSet Info channel = 1, Data channel = 3, Dial command=ATDTUSB
ZTE AC5730

v6.x
USB
ZTE ME3630-E

v6.40RC26ppp and LTE interfaceMiniPCI-e
ZTE MF110

v6.28 and higherSet info channel = 2, data channel = 2, Dial command=ATM1L3DTUSB
ZTE MF823

v6.8Some settings are ignored. For some devices it's needed to enter in FACTORY mode to change operating state.USB
ZTE MF825A

v6.xxSome settings are ignored.USB
ZTE MF827

v6.8Some settings are ignored.USB
ZTE MF832S

v7.10Config-less support, may require to set some settings using at-chat or modem init stringUSB
ZTE MF90

v6.44beta32 and higherLTE interfaceUSB

Not all modems are listed. Localized and locked units may have compatibility issues. All modems using MBIM driver should work by default on RouterOS v7.


For some modems with USB3.0 support in some cases USB3.0 pins need to be isolated to ensure correct initialization:

SFP modules

BrandModelRateConnector/Cable typeWavelengthTested withWorks / Doesn't
MikroTikS-85DLC05D1,25GDual LC, MM850nm*Check: SFP/SFP+ compatibility reference tableNatively supported
MikroTikS-31DLC20D1,25GDual LC, SM1310nm*Check: SFP/SFP+ compatibility reference tableNatively supported
MikroTikS-35LC20D1,25GBiDi LC, SMTx:1310nm/Rx:1550nm*Check: SFP/SFP+ compatibility reference tableNatively supported
MikroTikS-53LC20D1,25GBiDi LC, SMTx:1550nm/Rx:1310nm*Check: SFP/SFP+ compatibility reference tableNatively supported
MikroTikS-RJ011000/100/10RJ45, Cat5/Cat6N/A*Check: SFP/SFP+ compatibility reference tableNatively supported
AxiomAXG916321000BASE-LXDual LC1310nmCRS125-24G-1S-RMWorks!
FinisarFCLF-8521-310/100/1000RJ45, Cat6N/ARB2011LS-INWorks!
FinisarFCLF-8521-3-MD10/100/1000RJ45, Cat6N/ARB2011LS-INWorks!
FinisarFTRJ8519P1BNL-B110/100/1000 1.25 Gb/s 1000Base-SX EthernetDual LC, MM850nmRB2011LS-INWorks!
FinisarFTLF8519P2BNL10/100/1000 1.25 Gb/s 1000Base-SX EthernetDual LC, MM850nmRB2011LS-INWorks!
FinisarFTRJ1319P1BTL1.25Gb/s 1000Base-LX EthernetDual LC, SM1310nmCCR1009-8G-1S-1S+ and CCR1009-7G-1C-1S+Works!
UnicaSFP-1.25G-T1000MRJ45, Cat6N/ARB2011LS-INWorks!
DellFTLX8571D3BCL1,25GDual LC, MM850nmRB2011LS-INWorks!
UnicaGP-3124-L2CD-C1,25GDual LC, MM1310nmRB2011LS-INWorks!
CiscoGLC-T1.25GRJ45, Cat6N/ARB2011LS-INWorks!
CiscoGLC-SX-MM1000BASE-SX SFP transceiver module for MMF, 1.25GDual LC, MM850nmRB2011LS-INWorks!
CiscoSFP-GE-L1000BASE-LX/LH SFP transceiver module for SMF, 1.25GDual LC, SM1300nmVarious MT hardwareWorks!
6COM6C-SFP-T10/100/1000RJ45, Cat6N/ARB2011LS-INWorks!
6COM6C-WDM-0210BSD1,25GBiDi SC, SMTx:1550nm/Rx:1310nmRB2011LS-INWorks!
6COM6C-WDM-0210ASD1,25GBiDi SC, SMTx:1310nm/Rx:1550nmRB2011LS-INWorks!
6COM6C-SFP-0310D1,25GDual LC, MM1310nmRB2011LS-INWorks!
6COM6C-SFP-0301D1,25GDual LC, MM850nmRB2011LS-INWorks!
IngellenINSP-T(10/100/1000)10/100/1000RJ45, Cat6N/ARB2011LS-INWorks!
IngellenINSPL-53-BX1,25GBiDi LC, MM1550/1310RB2011LS-INWorks!
IngellenINSPL-35-BX1,25GBiDi LC, MM1310/1550RB2011LS-INWorks!
IngellenINSP-LX-SM1,25GDual LC, SM1310nmRB2011LS-INWorks!
IngellenINSP-SX-MM1,25GDual LC, MM850nmRB2011LS-INWorks!
AXCENAXGT-R1T4-05I110/100/1000RJ45, Cat6N/ARB2011LS-INWorks!
AXCENAXGD-37А4-05311,25GBiDi LC, MMTx:1550nm/Rx:1310nmRB2011LS-INWorks!
AXCENAXGD-16А4-05311,25GBiDi LC, MMTx:1310nm/Rx:1550nmRB2011LS-INWorks!
AXCENAXGD-1354-05311,25GDual LC, MM1310nmRB2011LS-INWorks!
AXCENAXGD-5854-05111,25GDual LC, MM850nmRB2011LS-INWorks!
TP-LinkTL-SM311LS1,25GDual LC, SM1310nmRB2011LS-INWorks!
TP-LinkTL-SM311LM1,25GDual LC, MM850nmCCR1036 12G-4SWorks!
OPTICOPTIC-SFP-3524S-02-SC1,25GBiDi SC, SMTx:1310nm/Rx:1550nmRB2011UAS-RM, RB260GSWorks!
OPTICOPTIC-SFP-5324S-02-SC1,25GBiDi SC, SMTx:1550nm/Rx:1310nmRB2011UAS-RM, RB260GSWorks!
OPTICOPTIC-SFP-S1203-L3302-LC1,25GBiDi LC, SMTx:1310nm/Rx:1550nmRB2011UAS-RM, RB260GSWorks!
OPTICOPTIC-SFP-S1205-L3302-LC1,25GBiDi LC, SMTx:1550nm/Rx:1310nmRB2011UAS-RM, RB260GSWorks!
ROBOFiberSFP-7120-551,25GDual LC, SM1550nmCCR1036-12G-4S, RB2011Works!
ROBOFiberSFP-7120-WA1,25GBiDi LC, MMTx:1490nm/Rx:1550nmCCR, RB2011Works!
ROBOFiberSFP-7120-WB1,25GBiDi LC, MMTx:1550nm/Rx:1490nmCCR, RB2011Works!
EnguitySFP-3647603KM.b1310 XT1,25GBiDi LC, SMTx:1310nm/Rx:1550nmCCR, RB2011, RB260GSWorks!
EnguitySFP-3647603KM.b1550 XT1,25GBiDi LC, SMTx:1550nm/Rx:1310nmCCR, RB2011, RB260GSWorks!
EnguitySFP-3647610KM.b1490 XT1,25GBiDi LC, SMTx:1490nm/Rx:1550nmCCR, RB2011, RB260GSWorks!
EnguitySFP-3647610KM.b1550 XT1,25GBiDi LC, SMTx:1550nm/Rx:1490nmCCR, RB2011, RB260GSWorks!
AdvOptics MSAGLC-SX-MM1,25GBiDi LC, MMTx:1310nm/Rx:1310nmCCR, RB2011, RB260GSWorks!
AdvOptics MSAGLC-ZX-SM1,25GBiDi LC, SMTx:1310nm/Rx:1310nmCCR, RB2011, RB260GSWorks!
ProlineGLC-BX-D20-PRO1,25GBiDi LC, SMTx:1490nm/Rx:1310nmCRS125Works!
ProlineGLC-BX-D40-PRO1,25GBiDi LC, SMTx:1310nm/Rx:1490nmCRS125Works!
Foundry NetworksE1MG-BXU-AC1,25GBiDi LC, SMTx:1310nm/Rx:1490nmRB3011UiAS, hAP acWorks!
AvagoSFBR-5799APZ1,25GDual LC, MM850nmCRS326, CRS112Works in 1Gbps mode!
EltexNTU-SFP-1001,25GSCN/ARB4011iGS+Works!

SFP+ modules

BrandModelDistanceRateConnector/Cable typeWavelengthTested withWorks / Doesn't
MikroTikS+85DLC03D300m10GDual LC, MM850nmAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+31DLC10D10km10GDual LC, SM1310nmAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+23LC10D10km10GBiDi LC, SMTx:1270nm/Rx:1330nmAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+32LC10D10km10GBiDi LC, SMTx:1330nm/Rx:1270nmAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+DA00011m10GTwinax CopperN/AAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+DA00033m10GTwinax CopperN/AAll MikroTik products with SFP/SFP+ interfacesNatively supported
MikroTikS+RJ10various, depending on link rate. Check brochure for more details10G/5G/2.5G/1G/100M/10MRJ45 - Cat5E/Cat6/Cat7N/AAll MikroTik products with SFP+ interfacesNatively supported
AtopAPSP55B30CDL4040km10GDual LC, SM1550nmCRS series, CCR series devices with SFP+ interfacesDoes NOT work!
CiscoSFP-10G-LR10km10GDual LC, SM1310nmRB2011LS-INWorks!
Dell (Finisar)FTLX8571D3BCL300m10GDual LC, MM850nmMost of SFP/SFP+ MikroTik productsWorks!
Juniper (Finisar)FTLX8571D3BCL-J1300m10GDual LC, MM850nmMost of SFP/SFP+ MikroTik productsWorks!
Intel (Finisar)FTLX8571D3BCV-IT300m10GDual LC, MM850nmMost of SFP/SFP+ MikroTik productsWorks!
OEM (Juniper?)EX-SFP-10GE-SR-OEM300m10GDual LC, MM850nmMost of SFP/SFP+ MikroTik productsWorks!
FiberstoreSFP-10G31-4040km10GDual LC, SM1310nmCRS series, CCR series devices with SFP+ interfacesWorks!
FiberstoreSFP-10G55-4040km10GDual LC, SM1310nmCRS series, CCR series devices with SFP+ interfacesWorks!
FiberstoreSFP-10G32-4040km10GBiDi LC, SMTx:1330nm/Rx:1270nmCRS series, CCR series devices with SFP+ interfacesWorks!
FiberstoreSFP-10G23-4040km10GBiDi LC, SMTx:1270nm/Rx:1330nmCRS series, CCR series devices with SFP+ interfacesWorks!
OptechOPAK-TX1-00-C30m10GRJ45 - Cat 6a/7 CableN/ACCR, CCR, CSS series devices with SFP+ interfacesWorks, starting with v6.40rc20 RouterOS build.
ProLabsSFP-10G-T-C30m10GRJ45 - Cat 6a/7 CableN/ACCR, CCR, CSS series devices with SFP+ interfacesWorks, starting with v6.40rc20 RouterOS build.


Multi-chassis Link Aggregation Group

Page edited by Gļebs K.

Introduction

MLAG (Multi-chassis Link Aggregation Group) implementation in RouterOS allows configuring LACP bonds on two separate devices, while the client device believes to be connected to the same machine. This provides a physical redundancy in case of switch failure. All CRS3xx, CRS5xx series switches, and CCR2116, CCR2216 devices can be configured with MLAG using RouterOS version 7.

Both peers establish the MLAG interfaces and update the bridge host table over peer-port using ICCP (Inter Chassis Control Protocol). RouterOS ICCP does not require an IP configuration, but it should be isolated from the rest of the network using a dedicated untagged VLAN. This untagged VLAN can be configured with vlan-filtering and pvid. Peer ports can also be configured as LACP bonding interfaces.

When peer-port is running and ICCP is established, the primary device election happens. The peer with the lowest bridge MAC address will be acting as a primary device and system-id will be selected. This system-id is used for STP BPDU bridge identifier and LACP system ID. The MLAG requires enabled STP, RSTP or MSTP protocol. Use the same STP priority and the same STP configuration on dual-connected bridge ports on both nodes. When MLAG bridges are elected as STP root, then both devices will show as root bridges under the bridge monitor. 

The MLAG is not compatible with L3 hardware offloading. When using MLAG, the L3 hardware offloading must be disabled.


Quick setup

in this example, CRS317 and CRS309 devices are used as MLAG peers and any device with two SFP+ interfaces can be used as an LACP client. The SFP+1 interface is used on both peer nodes to create peer-port, and it is used for ICCP,  see a network scheme below.

Below are configuration commands to create a regular LACP bonding in RouterOS for the Client device: 

/interface bonding
add mode=802.3ad name=bond1 slaves=sfp-sfpplus1,sfp-sfpplus2

Next, configure bonding interfaces for MLAG on Peer1 and Peer2 devices, use a matching mlag-id setting on both peer devices:

# Peer1
/interface bonding
add mlag-id=10 mode=802.3ad name=client-bond slaves=sfp-sfpplus2

# Peer2
/interface bonding
add mlag-id=10 mode=802.3ad name=client-bond slaves=sfp-sfpplus2

Configure bridge with enabled vlan-filtering, and add needed interfaces as bridge ports. A dedicated untagged VLAN should be applied for the inter-chassis communication on a peer port, thus a different pvid setting is used. Below are configuration commands for Peer1 and Peer2 devices:

# Peer1
/interface bridge
add name=bridge1 vlan-filtering=yes
/interface bridge port
add bridge=bridge1 interface=sfp-sfpplus1 pvid=99
add bridge=bridge1 interface=client-bond

# Peer2
/interface bridge
add name=bridge1 vlan-filtering=yes
/interface bridge port
add bridge=bridge1 interface=sfp-sfpplus1 pvid=99
add bridge=bridge1 interface=client-bond


The MLAG requires enabled STP, RSTP or MSTP protocol. Use the same STP priority and the same STP configuration on dual-connected bridge ports on both nodes.

In this example, client-bond interfaces are using the default untagged VLAN 1 (the default pvid=1 is set). In order to send these packets over peer ports, we need to add them as tagged VLAN 1 members. Notice that the default pvid value for the peer ports was changed in the previous step, it is important to include the peer ports in all the VLANs that are used on other bridge ports, this includes the untagged and tagged VLANs. Below are configuration commands for both peer devices:

# Peer1
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus1 vlan-ids=1

# Peer2
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus1 vlan-ids=1


All VLANs used for bridge slave ports must be also configured as tagged VLANs for peer-port, so that peer-port is a member of those VLANs and can forward data.

Last, specify bridge and peer-port to enable MLAG. Below are configuration commands for both peer devices:

# Peer1
/interface bridge mlag
set bridge=bridge1 peer-port=sfp-sfpplus1

# Peer2
/interface bridge mlag
set bridge=bridge1 peer-port=sfp-sfpplus1

Additionally, check MLAG status on peer devices and make sure that Client LACP has both interfaces active.

# Peer1
[admin@Peer1] > /interface/bridge/mlag/monitor    
       status: connected
    system-id: 74:4D:28:11:70:6B
  active-role: primary

# Peer2
[admin@Peer2] > /interface/bridge/mlag/monitor           
       status: connected
    system-id: 74:4D:28:11:70:6B
  active-role: secondary

# Client
[admin@Client] > /interface bonding monitor bond1 
                    mode: 802.3ad
            active-ports: sfp-sfpplus1,sfp-sfpplus2
          inactive-ports: 
          lacp-system-id: 74:4D:28:7B:7F:96
    lacp-system-priority: 65535
  lacp-partner-system-id: 74:4D:28:11:70:6C

MLAG settings and monitoring

This section describes the available MLAG settings and monitoring options.

Sub-menu: /interface bridge mlag

Property

Description

bridge (interface; Default: none)The bridge interface where MLAG is being created.

peer-port  (interface; Default: none)

An interface that will be used as a peer port. Both peer devices are using inter-chassis communication over these peer ports to establish MLAG and update the host table. Peer port should be isolated on a different untagged VLAN using a pvid setting. Peer port can be configured as a bonding interface.

Use the monitor commands to see the current MLAG status.

[admin@Peer1] > /interface/bridge/mlag/monitor    
       status: connected
    system-id: 74:4D:28:11:70:6B
  active-role: primary

Property

Description

status (connected | connecting | disabled)The MLAG status.

system-id (MAC address)

The lowest MAC address between both peer bridges will be used as the system-id. This system-id is used for (R)STP BPDU bridge identifier and LACP system ID.

active-role (primary | secondary)

The peer with the lowest bridge MAC address will be acting as a primary device. The system-id of the primary device is used for sending the (R)STP BPDU bridge identifier and LACP system ID.

Sub-menu: /interface bonding

Property

Description

mlag-id (integer: 0..4294967295; Default:)Changes MLAG ID for bonding interface. The same MLAG ID should be used on both peer devices to successfully create a single LAG for the client device. The peer-port should not be configured with the MLAG ID. 

LACP bonding interface and bonding slave ports can be monitored with monitor and monitor-slaves commands. See more details on Bonding monitoring.

The "not hw offloaded" : error will occur, if the bridge or bridge/port does not utilize Layer 2 hardware offloading. MLAG setup must be done using single bridge as well as bridge port hw=yes

MikroTik newsletter

To follow the latest product and software news, make sure to read our newsletters in the blog section. 

Newsletter

  • No labels