Manual de Mikrotik Fulll
Manual de Mikrotik Fulll
Manual de Mikrotik Fulll
Applies to RouterOS:All
Contents
[hide]
1Overview
2Winbox
3QuickSet and WebFig
4CLI
o 4.1Serial Cable
o 4.2Monitor and Keyboard
Overview
After you have installed the RouterOS software, or turned on the Router for the first time, there
are various ways how to connect to it:
Accessing Command Line Interface (CLI) via Telnet, SSH, serial cable or even keyboard
and monitor if your router has a VGA card.
Accessing Web based GUI (WebFig)
Using the WinBox configuration utility (Windows app, compatible with Wine)
Every router is factory pre-configured with the IP address 192.168.88.1/24 on the ether1 port.
The default username is admin with no password. After you log in for the first time, please
create a new user with a password in the "full" group, re-login and delete the default admin
user. We highly recommend you to follow the general guidelines of the article Securing your
router to protect the device from any unauthorised access.
Additional configuration may be set depending on RouterBOARD model. Most models have the
ether1 configured as a WAN port and any communication with the router through that port is
not possible, since it is firewalled to protect from any outside access. List of RouterBOARD
models and their default configurations can be found in this article.
Winbox
Winbox is a configuration utility that can connect to the router via MAC or IP protocol. Latest
winbox version can be downloaded from our download page.
Run the Winbox utility, then click the [...] button and see if Winbox finds your Router and it's
MAC address. Winbox neighbor discovery will discover all routers on the broadcast network. If
you see routers on the list, connect to it by clicking on MAC address and
pressing Connect button.
Winbox will try download plugins from the router, if it is connecting for the first time to the router
with current version. Note that it may take up to one minute to download all plugins if winbox is
connected with MAC protocol. After winbox have successfully downloaded plugins and
authenticated, main window will be displayed:
If winbox cannot find any routers, make sure that your Windows computer is directly connected
to the router with an Ethernet cable, or at least they both are connected to the same switch. As
MAC connection works on Layer2, it is possible to connect to the router even without IP
address configuration. Due to the use of broadcasting MAC connection is not stable enough to
use continuously, therefore it is not wise to use it on a real production / live network!. MAC
connection should be used only for initial configuration.
Follow winbox manual for more information.
Please see following articles to learn more about web interface configuration:
CLI
Command Line Interface (CLI) allows configuration of the router's settings using text
commands. Since there is a lot of available commands, they are split into groups organized in
a way of hierarchical menu levels. Follow console manual for CLI syntax and commands.
There are several ways how to access CLI:
Serial Cable
If your device has a Serial port, you can use a console cable (or Null modem cable)
Plug one end of the serial cable into the console port (also known as a serial port or DB9
RS232C asynchronous serial port) of the RouterBOARD and the other end in your PC (which
hopefully runs Windows or Linux). You can also use a USB-Serial adapter. Run a terminal
program (HyperTerminal, or Putty on Windows) with the following parameters for All
RouterBOARD models except 230:
If parameters are set correctly you should be able to see login prompt. Now you can access
router by entering username and password:
MikroTik 4.15
MikroTik Login:
[admin@MikroTik] >
MikroTik v3.16
Login:
Enter admin as the login name, and hit enter twice (because there is no password yet), you
will see this screen:
Now you can start configuring the router, by issuing the setup command.
This method works with any device that has a video card and keyboard connector
Manual:Initial Configuration
Contents
[hide]
1Summary
2Connecting wires
3Configuring router
o 3.1Logging into the router
o 3.2Router user accounts
o 3.3Configure access to internet
3.3.1DHCP Client
3.3.2Static IP Address
3.3.3Configuring network address translation (NAT)
3.3.4Default gateway
3.3.5Domain name resolution
3.3.6SNTP Client
o 3.4Setting up Wireless
3.4.1Check Ethernet interface state
3.4.2Security profile
3.4.3Wireless settings
3.4.4Bridge LAN with Wireless
4Troubleshooting & Advanced configuration
o 4.1General
4.1.1Check IP address
4.1.2Change password for current user
4.1.3Change password for existing user
4.1.4No access to the Internet or ISP network
4.1.5Checking link
o 4.2Wireless
4.2.1Channel frequencies and width
4.2.2Wireless frequency usage
4.2.3Change Country settings
o 4.3Port forwarding
4.3.1Static configuration
4.3.2Dynamic configuration
o 4.4Limiting access to web pages
4.4.1Set up Web Proxy for page filtering
4.4.2Set up Access rules
4.4.3Limitation strategies
Summary
Congratulations, you have got hold of MikroTik router for your home network. This guide will
help you to do initial configuration of the router to make your home network a safe place to be.
The guide is mostly intended in case if default configuration did not get you to the internet right
away, however some parts of the guide is still useful.
Connecting wires
Router's initial configuration should be suitable for most of the cases. Description of the
configuration is on the back of the box and also described in the online manual.
The best way to connect wires as described on the box:
Connect ethernet wire from your internet service provider (ISP) to port ether1, rest of the
ports on the router are for local area network (LAN). At this moment, your router is
protected by default firewall configuration so you should not worry about that;
Connect LAN wires to the rest of the ports.
Configuring router
Initial configuration has DHCP client on WAN interface (ether1), rest of the ports are
considered your local network with DHCP server configured for automatic address
configuration on client devices. To connect to the router you have to set your computer to
accept DHCP settings and plug in the ethernet cable in one of the LAN ports (please check
routerboard.com for port numbering of the product you own, or check front panel of the router).
It is good idea to start with password setup or add new user so that router is not accessible by
anyone on your network. User configuration is done form System -> Users menu.
To access this menu, click on System on the left panel and from the dropdown menu
choose Users (as shown in screenshot on the left)
You will see this screen, where you can manage users of the router. In this screen you can edit
or add new users:
When you click on account name (in this case admin), edit screen for the user will be
displayed.
If you click on Add new button, new user creation screen will be displayed.
Both screens are similar as illustrated in screenshot below. After editing user's data
click OK (to accept changes) or Cancel. It will bring you back to initial screen of user
management.
In user edit/Add new screen you can alter existing user or create new. Field marked with 2. is
the user name, field 1. will open password screen, where old password for the user can be
changed or added new one (see screenshot below).
Configure access to internet
If initial configuration did not work (your ISP is not providing DHCP server for automatic
configuration) then you will have to have details from your ISP for static configuration of the
router. These settings should include
You will have one address here - address of your local area network (LAN) 192.168.88.1 one
you are connected to router. Select Add new to add new static IP address to your router's
configuration.
You have to fill only fields that are marked. Field 1. should contain IP address provided by your
ISP and network mask'. Examples:
172.16.88.67/24
both of these notations mean the same, if your ISP gave you address in one notation, or in the
other, use one provided and router will do the rest of calculation.
Other field of interest is interface this address is going to be assigned. This should be interface
your ISP is connected to, if you followed this guide - interface contains name - ether1
Note: While you type in the address, webfig will calculate if address you have typed is
acceptable, if it is not label of the field will turn red, otherwise it will be blue
Note: It is good practice to add comments on the items to give some additional information for
the future, but that is not required
enabled is checked;
chain - should be srcnat;
out-interface is set to interface connected to your ISP network, Following this guide ether1;
action should be set to masquerade.
In screenshot correct rule is visible, note that irrelevant fields that should not have any value
set here are hidden (and can be
ignored)
Default gateway
under 'IP -> Routes' menu you have to add routing rule called default route. And select Add
new to add new
route.
After this, you can press OK button to finish creation of the default route.
At this moment, you should be able to reach any globally available host on the Internet using IP
address.
To check weather addition of default gateway was successful use Tools -> Ping
Domain name resolution
To be able to open web pages or access Internet hosts by domain name DNS should be
configured, either on your router or your computer. In scope of this guide, i will present only
option of router configuration, so that DNS addresses are given out by DHCP-Server that you
are already using.
This can be done in 'IP -> DNS ->Settings', first Open 'IP ->DNS':
Then select Settings to set up DNS cacher on the router. You have to add field to enter DNS IP
address, section 1. in image below. and check Allow Remote Requests marked with 2.
The result of pressing + twice will result in 2 fields for DNS IP addresses:
Note: Filling acceptable value in the field will turn field label blue, other way it will be marked
red.
SNTP Client
RouterBOARD routers do not keep time between restarts or power failuers. To have correct
time on the router set up SNTP client if you require that.
To do that, go to 'System -> SNTP' where you have to enable it, first mark, change mode from
broadcast to unicast, so you can use global or ISP provided NTP servers, that will allow to
enter NTP server IP addresses in third area.
Setting up Wireless
For ease of use bridged wireless setup will be used, so that your wired hosts will be in same
ethernet broadcast domain as wireless clients.
To make this happen several things has to be checked:
Ethernet interfaces designated for LAN are swtiched or bridged, or they are separate ports;
If bridge interface exists;
Wireless interface mode is set to ap-bridge (in case, router you have has level 4 or higher
license level), if not, then mode has to be set to bridge and only one client (station) will be
able to connect to the router using wireless network;
There is appropriate security profile created and selected in interface settings.
Check Ethernet interface state
Warning: Changing settings may affect connectivity to your router and you can be
disconnected from the router. Use Safe Mode so in case of disconnection made changes are
reverted back to what they where before you entered safe mode
To check if ethernet port is switched, in other words, if ethernet port is set as slave to another
port go to 'Interface' menu and open Ethernet interface details. They can be distinguished by
Type column displaying Ethernet.
Security profile
It is important to protect your wireless network, so no malicious acts can be performed by 3rd
parties using your wireless access-point.
To edit or create new security profile head to 'Wireless -> tab 'Security Prodiles' and choose
one of two options:
Note: When configuring this, you can deselect Hide passwords in page header to see the
actual values of the fields, so they can be successfully entered into device configuration that
are going to connect to wireless access-point
Wireless settings
Adjusting wireless settings. That can be done
here:
In General section adjust settings to settings as shown in screenshot. Consider these safe,
however it is possible, that these has to be adjusted slightly.
Interface mode has to be set to ap-bridge, if that is not possible (license resctrictions) set to
bridge, so one client will be able to connect to device.
WiFI devices usually are designed with 2.4GHz modes in mind, setting band to 2GHz-b/g/n will
enable clients with 802.11b, 802.11g and 802.11n to connect to the access point
Adjust channel width to enable faster data rates for 802.11n clients. In example channel 6 is
used, as result, 20/40MHz HT Above or 20/40 MHz HT Below can be used. Choose either of
them.
Set SSID - the name of the access point. It will be visible when you scan for networks using
your WiFi
equipment.
In section HT set change HT transmit and receive chains. It is good practice to enable all
chains that are
available
When settings are set accordingly it is time to enable our protected wireless access-
point
To change password of the current user, safe place to go is System -> Password
Where all the fields has to be filled. There is other place where this can be done in case you
have full privileges on the router.
Change password for existing user
If you have full privileges on the router, it is possible to change password for any user without
knowledge of current one. That can be done under System -> Usersmenu.
Steps are:
Select user;
type in password and re-type it to know it is one you intend to set
No access to the Internet or ISP network
If you have followed this guide to the letter but even then you can only communicate with your
local hosts only and every attempt to connect to Internet fails, there are certain things to check:
Or contact your ISP for details and inform that you have changed device.
Checking link
There are certain things that are required for Ethernet link to work:
Link activity lights are on when Ethernet wire is plugged into the port
Correct IP address is set on the interface
Correct route is set on the router
What to look for using ping tool:
It is located here: Tool -> Ping menu. Fill in Ping To field and press start to initiate sending of
ICMP packets.
Wireless
Wireless unnamed features in the guide that are good to know about. Configuration
adjustments.
Channel frequencies and width
It is possible to choose different frequency, here are frequencies that can be used and channel
width settings to use 40MHz HT channel (for 802.11n). For example, using channel 1 or
2412MHz frequency setting 20/40MHz HT below will not yield any results, since there are no
20MHz channels available below set frequency.
Warning: You should check how many and what frequencies you have in your regulatory
domain before. If there are 10 or 11 channels adjust settings accordingly. With only 10
channels, channel #10 will have no sense of setting 20/40MHz HT above since no full 20MHz
channel is available
Open frequency usage monitoring tool Freq. Usage... that is located in wireless interface
details;
Wait for some time as scan results are displayed. Do that for minute or two. Smaller
numbers in Usage column means that channel is less crowded.
Note: Monitoring is performed on default channels for Country selected in configuration. For
example, if selected country would be Latvia, there would have been 13 frequencies listed as
at that country have 13 channels allowed.
Note: Advanced mode is toggle button that changes from Simple to Advanced mode and back.
Port forwarding
To make services on local servers/hosts available to general public it is possible to forward
ports from outside to inside your NATed network, that is done from /ip firewall nat menu. For
example, to make possible for remote helpdesk to connect to your desktop and guide you,
make your local file cache available for you when not at location etc.
Static configuration
A lot of users prefer to configure these rules statically, to have more control over what service
is reachable from outside and what is not. This also has to be used when service you are using
does not support dynamic configuration.
Following rule will forward all connections to port 22 on the router external ip address to port 86
on your local host with set IP address:
if you require other services to be accessible you can change protocol as required, but usually
services are running TCP and dst-port. If change of port is not required, eg. remote service is
22 and local is also 22, then to-ports can be left unset.
Note: Screenshot contain only minimal set of settings are left visible
Dynamic configuration
uPnP is used to enable dynamic port forwarding configuration where service you are running
can request router using uPnP to forward some ports for it.
Warning: Services you are not aware of can request port forwarding. That can compromise
security of your local network, your host running the service and your data
With this rule any host that has example.com will be unaccessible.
Limitation strategies
There are two main approaches to this problem
Contents
[hide]
1Description
2Console login options
3Different information shown by login process
o 3.1Banner
o 3.2License
o 3.3Demo version upgrade reminder
o 3.4Software key information
4Different information shown by console process after logging in
o 4.1System Note
o 4.2Critical log messages
5Prompt
6FAQ
Description
There are different ways to log into console:
serial port
console (screen and keyboard)
telnet
ssh
mac-telnet
winbox terminal
Input and validation of user name and password is done by login process. Login process can
also show different informative screens (license, demo version upgrade reminder, software key
information, default configuration).
At the end of successful login sequence login process prints banner and hands over control to
the console process.
Console process displays system note, last critical log entries, auto-detects terminal size and
capabilities and then displays command prompt]. After that you can start writing commands.
Use up arrow to recall previous commands from command history, TAB key to automatically
complete words in the command you are typing, ENTER key to execute command, and
Control-C to interrupt currently running command and return to prompt.
Easiest way to log out of console is to press Control-D at the command prompt while command
line is empty (You can cancel current command and get an empty line with Control-C, so
Control-C followed by Control-D will log you out in most cases).
If parameter is not present, then default value is used. If number is not present then implicit
value of parameter is used.
example: admin+c80w - will disable console colors and set terminal width to 80.
Param Default Implicit
"w" auto auto Set terminal width
"h" auto auto Set terminal height
"c" on off disable/enable console colors
"t" on off Do auto detection of terminal capabilities
"e" on off Enables "dumb" terminal mode
Actual banner can be different from the one shown here if it is replaced by distributor. See
also: branding.
License
After logging in for the first time after installation you are asked to read software licenses.
Answer y to read licenses, n if you do not wish to read licenses (question will not be shown
again). Pressing SPACE will skip this step and the same question will be asked after next
login.
Demo version upgrade reminder
After logging into router that has demo key, following remonder is shown:
After entering valid software key, following information is shown after login:
-----------------------------------------------------------------------
--------
You can type "v" to see the exact commands that are used to add and
remove
this default configuration, or you can view them later with
'/system default-configuration print' command.
To remove this default configuration type "r" or hit any other key to
continue.
If you are connected using the above IP and you remove it, you will be
disconnected.
Applying and removing of the default configuration is done using console script (you can press
'v' to review it).
Prompt
[admin@MikroTik] /interface> - Default command prompt, shows user name, system
identity, and current command path.
[admin@MikroTik] /interface<SAFE> - Prompt indicates that console session is in
Safe Mode.
[admin@MikroTik] >> - Prompt indicates that HotLock is turned on.
{(\... - While entering multiple line command continuation prompt shows open
parentheses.
line 2 of 3> - While editing multiple line command prompt shows current line number
and line count.
address: - Command requests additional input. Prompt shows name of requested value.
Console can show different prompts depending on enabled modes and data that is being
edited. Default command prompt looks like this:
[admin@MikroTik] /interface>
Default command prompt shows name of user, '@' sign and system name in brackets, followed
by space, followed by current command path (if it is not '/'), followed by '>' and space. When
console is in safe mode, it shows word SAFE in the command prompt.
[admin@MikroTik] /interface<SAFE>
Hotlock mode is indicated by an additional yellow '>' character at the end of the prompt.
[admin@MikroTik] >>
It is possible to write commands that consist of multiple lines. When entered line is not a
complete command and more input is expected, console shows continuation prompt that lists
all open parentheses, braces, brackets and quotes, and also trailing backslash if previous line
ended with backslash-whitespace.
[admin@MikroTik] > {
{... :put (\
{(\... 1+2)}
3
When you are editing such multiple line entry, prompt shows number of current line and total
line count instead of usual username and system name.
Sometimes commands ask for additional input from user. For example, command '/password'
asks for old and new passwords. In such cases prompt shows name of requested value,
followed by colon and space.
FAQ
Q: How do I turn off colors in console?
A: Add '+c' after login name.
Q: After logging in console prints rubbish on the screen, what to do?
Q: My expect script does not work with newer 3.0 releases, it receives some strange
characters. What are those?
A: These sequences are used to automatically detect terminal size and capabilities. Add '+t'
after login name to turn them off.
Q: Thank you, now terminal width is not right. How do I set terminal width?
A: Add '+t80w' after login name, where 80 is your terminal width.
Manual:Troubleshooting tools
Contents
[hide]
1Troubleshooting tools
o 1.1Check network connectivity
1.1.1Using the ping command
1.1.2Using the traceroute command
o 1.2Log Files
o 1.3Torch (/tool torch)
1.3.1IPv6
1.3.2Winbox
o 1.4Packet Sniffer (/tool sniffer)
o 1.5Bandwidth test
o 1.6Profiler
Troubleshooting tools
Before, we look at the most significant commands for connectivity checking and
troubleshooting, here is little reminder on how to check host computer's network interface
parameters on .
The Microsoft windows have a whole set of helpful command line tools that helps testing and
configuring LAN/WAN interfaces. We will look only at commonly used Windows networking
tools and commands.
All of the tools are being ran from windows terminal. Go to Start/Run and enter "cmd" to open
a Command window.
Some of commands on windows are:
ipconfig – used to display the TCP/IP network configuration values. To open it, enter
" ipconfig " in the command prompt.
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : mshome.net
Link-local IPv6 Address . . . . . : fe80::58ad:cd3f:f3df:bf18%8
IPv4 Address. . . . . . . . . . . : 173.16.16.243
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 173.16.16.1
There are also a variety of additional functions for ipconfig. To obtain a list of additional
options, enter " ipconfig /? " or “ ipconfig -? ”.
netstat – displays the active TCP connections and ports on which the computer is listening,
Ethernet statistics, the IP routing table, statistics for the IP, ICMP, TCP, and UDP protocols. It
comes with a number of options for displaying a variety of properties of the network and TCP
connections “netstat –?”.
nslookup – is a command-line administrative tool for testing and troubleshooting DNS servers.
For example, if you want to know what IP address is "www.google.com", enter "nslookup
www.google.com" and you will find that there are more addresses 74.125.77.99,
74.125.77.104, 74.125.77.147.
netsh – is a tool an administrator can use to configure and monitor Windows-based computers
at a command prompt. It allows configure interfaces, routing protocols, routes, routing filters
and display currently running configuration.
Very similar commands are available also on unix-like machines. Today in most of Linux
distributions network settings can be managed via GUI, but it is always good to be familiar with
the command-line tools. Here is the list of basic networking commands and tools on Linux:
ifconfig – it is similar like ipconfig commands on windows. It lets enable/disable network
adapters, assigned IP address and netmask details as well as show currently network interface
configuration.
iwconfig - iwconfig tool is like ifconfig and ethtool for wireless cards. That also view and set
the basic Wi-Fi network details.
nslookup – give a host name and the command will return IP address.
netstat – print network connections, including port connections, routing tables, interface
statistics, masquerade connections, and more. (netstat – r, netstat - a)
ip – show/manipulate routing, devices, policy routing and tunnels on linux-machine.
For example, check IP address on interface using ip command:
mentioned tools are only small part of networking tools that is available on Linux. Remember if
you want full details on the tools and commands options use man command. For example, if
you want to know all options on ifconfig write command man ifconfig in terminal.
C:\>ping 10.255.255.4
Pinging 10.255.255.4 with 32 bytes of data:
Reply from 10.255.255.4: bytes=32 time=1ms TTL=61
Reply from 10.255.255.4: bytes=32 time<1ms TTL=61
Reply from 10.255.255.4: bytes=32 time<1ms TTL=61
Reply from 10.255.255.4: bytes=32 time<1ms TTL=61
Ping statistics for 10.255.255.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0%
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
Unix-like:
From MikroTik:
C:\>tracert 10.255.255.2
Tracing route to 10.255.255.2 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms 10.13.13.1
2 1 ms 1 ms 1 ms 10.255.255.2
Trace complete.
Unix-like:
Traceroute and tracepath is similar, only tracepath does not not require superuser privileges.
From MikroTik:
Log Files
System event monitoring facility allows to debug different problems using Logs. Log file is a
text file created in the server/router/host capturing different kind of activity on the device. This
file is the primary data analysis source. RouterOS is capable of logging various system events
and status information. Logs can be saved in routers memory (RAM), disk, file, sent by email or
even sent to remote syslog server.
All messages stored in routers local memory can be printed from /log menu. Each entry
contains time and date when event occurred, topics that this message belongs to and message
itself.
Note: Wireless clients which belong to the same subnet and have enabled default-
forwarding communicate through wireless chip. This traffic will not be seen by the torch tool.
Example:
The following example monitor the traffic generated by the telnet protocol, which passes
through the interface ether1.
[admin@MikroTik] tool>
[admin@MikroTik] tool>
In order to see what protocols are linked to a host connected to interface 10.0.0.144/32 ether1:
PRO.. SRC-ADDRESS TX RX
tcp 10.0.0.144 1.01kbps 608bps
icmp 10.0.0.144 480bps 480bps
[admin@MikroTik] tool>
IPv6
Starting from v5RC6 torch is capable of showing IPv6 traffic. Two new parameters are
introduced src-address6 and dst-address6. Example:
78.7kbps 1010.0kbps
To make /ping tool to work with domain name that resolves IPv6 address use the following:
Here you can specify different packet sniffer parameters, like maximum amount of used
memory, file size limit in KBs.
Running Packet Sniffer Tool
There are three commands that are used to control runtime operation of the packet sniffer:
/tool sniffer start, /tool sniffer stop, /tool sniffer save.
The start command is used to start/reset sniffing, stop - stops sniffing. To save currently
sniffed packets in a specific file save command is used.
In the following example the packet sniffer will be started and after
some time - stopped:
[admin@MikroTik] tool sniffer> start
[admin@MikroTik] tool sniffer> stop
Below the sniffed packets will be saved in the file named test:
/tool sniffer protocol – show all kind of protocols that have been sniffed
/tool sniffer host – shows the list of hosts that were participating in data exchange you've
sniffed
For example:
Bandwidth test
The Bandwidth Tester can be used to measure the throughput (Mbps) to another MikroTik
router (either wired or wireless network) and thereby help to discover network
"bottlenecks"- network point with lowest throughput.
BW test uses two protocols to test bandwidth:
TCP – uses the standard TCP protocol operation principles with all main components like
connection initialization, packets acknowledgments, congestion window mechanism and all
other features of TCP algorithm. Please review the TCP protocol for details on its internal
speed settings and how to analyze its behavior. Statistics for throughput are calculated
using the entire size of the TCP data stream. As acknowledgments are an internal working
of TCP, their size and usage of the link are not included in the throughput statistics.
Therefore statistics are not as reliable as the UDP statistics when estimating throughput.
UDP traffic – sends 110% or more packets than currently reported as received on the other
side of the link. To see the maximum throughput of a link, the packet size should be set for
the maximum MTU allowed by the links which is usually 1500 bytes. There is no
acknowledgment required by UDP; this implementation means that the closest
approximation of the throughput can be seen.
Remember that Bandwidth Test uses all available bandwidth (by default) and may impact
network usability.
If you want to test real throughput of a router, you should run bandwidth test through the router
not from or to it. To do this you need at least 3 routers connected in chain:
Bandwidth Server – router under test – Bandwidth Client.
Note: If you use UDP protocol then Bandwidth Test counts IP header+UDP header+UDP data.
In case if you use TCP then Bandwidth Test counts only TCP data (TCP header and IP header
are not included).
Configuration example:
Server
To enable bandwidth-test server with client authentication:
Client
Run UDP bandwidth test in both directions, user name and password depends on remote
Bandwidth Server. In this case user name is ‘admin’ without any password.
More information and all commands description can be found in the manual>>
Profiler
Profiler is a tool that shows CPU usage for each process running on RouterOS. It helps to
identify which process is using most of the CPU resources.
Applies to RouterOS:ALL
The support file is used for debugging MikroTik RouterOS and to solve the support questions
faster. All MikroTik Router information is saved in a binary file, which is stored on the router
and can be downloaded from the router using FTP. If required, then you can generate file also
on "/flash" folder on devices with FLASH type memory or external storage drive, by specifying
full path to the file "name=flash/supout.rif". You can view the contents of this file in
your Mikrotik account, simply click on "Supout.rif viewer" located in the left column and upload
the file.
This file contains all your routers configuration, logs and some other details that will help the
MikroTik Support to solve your issue. The file does not contain sensitive information or router
passwords.
Making Support Output file
Winbox
To generate this file in Winbox, click on "Make Supout.rif"
To save the file to your computer, right mouse click on file and select "Download" to get
support output file, or simply drag the file to your desktop.
Webfig
To generate this file in Webfig, click on "Make Supout.rif" and then "Download" to get in on
your
computer
Console
To generate this file, please type in the command line:
Contents
[hide]
1Access to a router
o 1.1Access username
o 1.2Access password
o 1.3Access by IP address
2Router services
o 2.1RouterOS services
o 2.2RouterOS MAC-access
2.2.1MAC-Telnet
2.2.2MAC-Winbox
2.2.3MAC-Ping
o 2.3Neighbor Discovery
o 2.4Bandwidth server
o 2.5DNS cache
o 2.6Other clients services
o 2.7More Secure SSH access
3Router interface
o 3.1Ethernet/SFP interfaces
o 3.2LCD
4Firewall
o 4.1IPv4 firewall to a router
o 4.2IPv4 firewall for clients
5IPv6
o 5.1IPv6 ND
o 5.2IPv6 firewall to a router
o 5.3IPv6 firewall for clients
Access to a router
Access username
Change default username admin to different name, custom name helps to protect access to
your rotuer, if anybody got direct access to your router.
/user print
/user set 0 name=myname
Access password
MikroTik routers requires password configuration, we suggest to use pwgen or other password
generator tool to create secure and non-repeating passwords,
/password
We strongly suggest to use second method or Winbox interface to apply new password for
your router, just to keep it safe from other unauthorised access.
Access by IP address
Besides the fact that default firewall protects your router from unauthorized access from outer
networks, it is possible to restrict username access for the specific IP address
Note: login to router with new credentials to check that username/password are working.
Router services
All production routers have to be administred by SSH, secured Winbox or HTTPs services. Use
the latest Winbox version for secure
access.
RouterOS services
Most of RouterOS administrative tools are configured at
and also change the default port, this will immediately stop most of the random SSH bruteforce
login attempts:
RouterOS MAC-access
RouterOS has built-in options for easy management access to network devices. The particular
services should be shutdown on production networks.
MAC-Telnet
Disable mac-telnet services,
MAC-Winbox
Disable mac-winbox services,
MAC-Ping
Disable mac-ping service,
Neighbor Discovery
MikroTik Neighbor discovery protocol is used to show and recognize other MikroTik routers in
the network, disable neighbor discovery on all interfaces,
Bandwidth server
Bandwidth server is used to test throughput between two MikroTik routers. Disable it in
production enironment.
DNS cache
Router might have DNS cache enabled, that decreases resolving time for DNS requests from
clients to remote servers. In case DNS cache is not required on your router or another router is
used for such purposes, disable it.
Router interface
Ethernet/SFP interfaces
It is good practice to disable all unused interfaces on your router, in order to decrease
unauthorised access to your router.
/interface print
/interface set x disabled=yes
x numbers of the unused interfaces.
LCD
Some RouterBOARDs have LCD module for informational purpose, set pin or disable it.
Firewall
We strongly suggest to keep default firewall on. Here are few adjustment to make it more
secure, make sure to apply the rules, when you understand what are they doing.
IPv4 firewall to a router
Established/related packets are added to fasttrack for faster data throughput, firewall will
work with new connections only;
drop invalid connection and log them with prefix invalid;
drop attempts to reach not public addresses from your local network, apply address-
list=not_in_internet before, bridge1 is local network interface, log attempts
with !public_from_LAN;
drop incoming packets that are not NATed, ether1 is public interface, log attempts
with !NAT prefix;
drop incoming packets from Internet, which are not public IP addresses, ether1 is public
interface, log attempts with prefix !public;
drop packets from LAN that does not have LAN IP, 192.168.88.0/24 is local network used
subnet;
Manual:RouterOS features
Contents
[hide]
1RouterOS features
o 1.1Hardware Support
o 1.2Installation
o 1.3Configuration
o 1.4Backup/Restore
o 1.5Firewall
o 1.6Routing
o 1.7MPLS
o 1.8VPN
o 1.9Wireless
o 1.10DHCP
o 1.11Hotspot
o 1.12QoS
o 1.13Proxy
o 1.14Tools
o 1.15Other features
RouterOS features
RouterOS is MikroTik's stand-alone operating system based on linux v3.3.5 kernel. The
following list shows features found in the latest RouterOS release:
Hardware Support
M:Netinstall: Full network based installation from PXE or EtherBoot enabled network card
Netinstall: Installation to a secondary drive mounted in Windows
CD based installation
Configuration
Firewall
Statefull filtering
Source and destination NAT
NAT helpers (h323, pptp, quake3, sip, ftp, irc, tftp)
Internal connection, routing and packet marks
Filtering by IP address and address range, port and port range, IP protocol, DSCP and
many more
Address lists
Custom Layer7 matcher
IPv6 support
PCC - per connection classifier, used in load balancing configurations
RAW filtering to bypass connection tracking.
Routing
Static routing
Virtual Routing and Forwarding (VRF)
Policy based routing
Interface routing
ECMP routing
IPv4 dynamic routing protocols: RIP v1/v2, OSPFv2, BGP v4
IPv6 dynamic routing protocols: RIPng, OSPFv3, BGP
Bidirectional Forwarding Detection ( BFD)
MPLS
VPN
IPSec – tunnel and transport mode, certificate or PSK, AH and ESP security protocols.
Hardware encryption support on RouterBOARD 1000.
IKEv2 support
AES-NI hardware acceleration support for IPSec
Point to point tunneling ( OpenVPN, PPTP, PPPoE, L2TP, SSTP)
Advanced PPP features (MLPPP, BCP)
Simple tunnels ( IPIP, EoIP) IPv4 andIPv6 support
6to4 tunnel support (IPv6 over IPv4 network)
VLAN – IEEE802.1q Virtual LAN support, Q-in-Q support
MPLS based VPNs
Wireless
DHCP
QoS
Hierarchical Token Bucket ( HTB) QoS system with CIR, MIR, burst and priority support
Simple and fast solution for basic QoS implementation - Simple queues
Dynamic client rate equalization ( PCQ)
Proxy
Tools
Ping, traceroute
Bandwidth test, ping flood
Packet sniffer, torch
Telnet, ssh
E-mail and SMS send tools
Automated script execution tools
CALEA
File Fetch tool
Advanced traffic generator
Other features
Samba support
OpenFlow support
Bridging – spanning tree protocol (STP, RSTP), bridge firewall and MAC natting.
Dynamic DNS update tool
NTP client/server and synchronization with GPS system
VRRP v2 and v3 support
SNMP
M3P - MikroTik Packet packer protocol for wireless links and ethernet
MNDP - MikroTik neighbor discovery protocol, supports CDP (Cisco discovery protocol)
RADIUS authentication and accounting
TFTP server
Synchronous interface support (Farsync cards only) (Removed in v5.x)
Asynchronous – serial PPP dial-in/dial-out, dial on demand
ISDN – dial-in/dial-out, 128K bundle support, Cisco HDLC, x75i, x75ui, x75bui line
protocols, dial on demand
Manual:RouterOS FAQ
See also: Mikrotik_RouterOS_Preguntas_Frecuentes_(español/spanish)
Contents
[hide]
Installation
How can I install RouterOS?
RouterOS can be installed with CD Install or Netinstall.
How large HDD can I use for the MikroTik
RouterOS™?
MikroTik RouterOS™ supports disks larger than 8GB (usually up to 120GB). But make
sure the BIOS of the router's motherboard is able to support these large disks.
Can I run MikroTik RouterOS™ from any hard
drive in my system?
Yes
Is there support for multiple hard drives in
MikroTik RouterOS™?
A secondary drive is supported for web cache. This support has been added in 2.8,
older versions don't support multiple hard drives.
Why the CD installation stops at some
point and does not go "all the way
through"?
The CD installation is not working properly on some motherboards. Try to reboot the
computer and start the installation again. If it does not help, try using different
hardware.
Logging on and
Passwords
What is the username and
password when logging on to the
router for the first time?
Username is 'admin', and there is no password (hit the 'Enter' key). You can change
the password using the '/password' command.
How can I recover a lost
password?
If you have forgotten the password, there is no recovery for it. You have to reinstall the
router.
After power failure the
MikroTik router is not
starting up again
If you haven't shut the router down, the file system has not been unmounted properly.
When starting up, the RouterOS™ will perform a file system check. Depending on the
HDD size, it may take several minutes to complete. Do not interrupt the file system
check! It would make your installation unusable.
How can I access the
router if the LAN
interface has been
disabled?
You can access the router either locally (using monitor and keyboard) or through the
serial console.
Licensing
Issues
How many
MikroTik
RouterOS™
installations does
one license cover?
The license is per RouterOS installation. Each installed router needs a separate
license.
Does the
license expire?
The license never expires. The router runs for ever. Your only limitation is to which
versions you can upgrade. For example if it says "Upgradable to v4.x", it means you
can use all v4 releases, but not v5 This doesn't mean you can't stay on v4.x as long as
you want.
How can I
reinstall
the
MikroTik
RouterOS
™ software
without
losing my
software
license?
You have to use CD, Floppies or Netinstall procedure and install the MikroTik
RouterOS™ on the HDD with the previous MikroTik RouterOS™ installation still intact.
The license is kept with the HDD. Do not use format or partitioning utilities, they will
delete your key! Use the same (initial) BIOS settings for your HDD!
Can I
use my
MikroTi
k
Router
OS™
softwar
e
license
on a
differen
t
hardwa
re?
Yes, you can use different hardware (motherboard, NICs), but you should use the
same HDD. The license is kept with the HDD unless format or fdisk utilities are used. It
is not required to reinstall the system when moving to different hardware. When paying
for the license, please be aware, that it cannot be used on another harddrive than the
one it was installed upon.
License transfer to another hard drive costs 10$. Contact support to arrange this.
W
h
a
t
t
o
d
o
,
i
f
m
y
h
a
r
d
d
r
i
v
e
w
i
t
h
M
i
k
r
o
T
i
k
R
o
u
t
e
r
O
S
™
c
r
a
s
h
e
s
,
a
n
d
I
h
a
v
e
t
o
i
n
s
t
a
l
l
a
n
o
t
h
e
r
o
n
e
?
If you have paid for the license, you have to write to support[at]mikrotik.com and
describe the situation. We may request you to send the broken hard drive to us as
proof prior to issuing a replacement key.
W
h
a
t
h
a
p
p
e
n
s
i
f
m
y
h
a
r
d
w
a
r
e
b
r
e
a
k
s
a
g
a
i
n
,
a
n
d
I
l
o
s
e
m
y
r
e
p
l
a
c
e
m
e
n
t
k
e
y
?
The same process is used as above, but this time, we need physical proof that there is
in fact been another incident.
If you have a free demo license, no replacement key can be issued. Please obtain
another demo license, or purchase the base license.
More information available here All_about_licenses
H
o
w
c
a
n
I
e
n
t
e
r
a
n
e
w
S
o
f
t
w
a
r
e
K
e
y
?
Entering the key from Console/FTP:
Entering the key with Console/Telnet:
use copy/paste to enter the key into a Telnet window (no matter which submenu).
Be sure to copy the whole key, including the lines "--BEGIN MIKROTIK
SOFTWARE KEY--" and "--END MIKROTIK SOFTWARE KEY--"
Entering the key from Winbox:
use 'system -> license' menu in Winbox to Paste or Import the key
In the Account Server choose `work with keys`, then select your mis-typed key, and
then choose `fix key`.
To upgrade the software, you will need to download the latest package files (*.npk)
from our website (the 'system' package plus the ones that you need). Then, connect to
the router via FTP and upload the new packages to it by using Binary transfer mode.
Then reboot the router by issuing /system reboot command. More information
here: Upgrading_RouterOS
You have to obtain (purchase) the required license level or install the NPK package for
this interface (for example package 'wireless').
No, configuration is kept intact for upgrades within one version family. When upgrading
version families (for example, V2.5 to V2.6) you may lose the configuration of some
features that have major changes. For example when upgrading from V2.4, you should
upgrade to the last version of 2.4 first.
You need space for the system package and the additional packages you have to
upgrade. After uploading the newer version packages to the router you should have at
least 2MB free disk space left. If not, do not try to make the upgrade! Uninstall the
unnecessary packages first, and then upgrade the remaining ones.
You can downgrade by reinstalling the RouterOS™ from any media. The software
license will be kept with the HDD as long as the disk is not repartitioned/reformatted.
The configuration of the router will be lost (it is possible to save the old configuration,
but this option has unpredictable results when downgrading and it is not recommended
to use it).
Another way is to use the /system package downgrade command. This works only if
you downgrade to 2.7.20 and not lower. Upload the older packages to the router via
FTP and then use the /system package downgrade command.
This is a typical problem, where you do not have routing set up at your main Internet
gateway. Since you have introduced a new network, you need to 'tell' about it your
main gateway (your ISP). A route should be added for your new network. Alternatively,
you can 'hide' your new network by means of masquerading to get access to the
Internet. Please take time to study the Basic Setup Guide, where the problem is
described and the solution is given.
There is an example how to masquerade your private LAN:
You can change the allocated ports under /ip service.
The rules 'do not work', since they do not match the packets due to the incorrectly
specified address/mask. The correct form would be:
The DHCP feature is not included in the system software package. You need to install
the dhcp package. Upload it to the router and reboot!
Yes, you can add static leases to the DHCP server leases list. However, DHCP is
insecure by default, and it is better to use PPPoE for user authentication and handing
out IP addresses. There you can request the user to log on from a specified MAC
address as well.
Use /ip firewall nat rule with chain=srcnat action=nat, specify the to-src-
address argument value. It should be one of the router's external addresses. If you
use action=masquerade, the to-src-address is not taken into account, since it is
substituted by the external address of the router automatically.
Use /ip firewall mangle to change MSS (maximum segment size) 40 bytes less than
your connection MTU. For example, if you have encrypted PPPoE link with MTU=1492,
set the mangle rule as follows:
In bridge settings enable use-ip-firewall.
Yes. You can use all the extensive queue management features. Set the queue to the
interface where the traffic is actually leaving the router, when passing through the
router. It is not the bridge interface! The queue on the bridge interface is involved only
for the traffic generated from the router.
For download:
While this solution should function, it is fundamentally flawed as the first packet of each
connection destined to these clients will not be taken into account.
For upload:
No, you cannot.
Manual:Connection oriented communication
(TCP/IP)
Contents
[hide]
1. The host A who needs to initialize a connection sends out a SYN (Synchronize) packet
with proposed initial sequence number to the destination host B.
2. When the host B receives SYN message, it returns a packet with both SYN and ACK
fags set in the TCP header (SYN-ACK).
3. When the host A receives the SYN-ACK, it sends back ACK (Acknowledgment)
macket.
4. Host B receives ACK and at this stage the connection is ESTABLISHED.
Connection-oriented protocol services are often sending acknowledgments (ACKs) after
successful delivery. After packet with data is transmitted, sender waits acknowledgement from
receiver. If time expires and sender did not receive ACK, packet is retransmitted.
Connection termination
When the data transmission is complete and the host wants to terminate the connection,
termination process is initiated. Unlike TCP Connection establishment, which uses three-way
handshake, connection termination uses four-way messages. Connection is terminated when
both sides have finished the shut down procedure by sending a FIN and receiving an ACK.
1. The host A, who needs to terminate the connection, sends a special message with the
FIN (finish) flag, indicating that it has finished sending the data.
2. The host B, who receives the FIN segment, does not terminate the connection but
enters into a "passive close" (CLOSE_WAIT) state and sends the ACK for the FIN
back to the host A. Now the host B enters into LAST_ACK state. At this point host B
will no longer accept data from host A, but can continue transmit data to host A. If host
B does not have any data to transmit to the host A it will also terminate the connection
by sending FIN segment.
3. When the host A receives the last ACK from the host B, it enters into a (TIME_WAIT)
state, and sends an ACK back to the host B.
4. Host B gets the ACK from the host A and closes the connection.
Ethernet networking
CSMA/CD
The Ethernet system consists of three basic elements:
the physical medium used to carry Ethernet signals between network devices,
medium access control system embedded in each Ethernet interface that allow multiple
computers to fairly control access to the shared Ethernet channel,
Ethernet frame that consists of a standardized set of bits used to carry data over the
system.
Ethernet network uses Carrier Sense Multiple Access with Collision detection (CSMA/CD)
protocol for data transmission. That helps to control and manage access to shared bandwidth
when two or more devices want to transmit data at the same time. CSMA/CD is a modification
of Carrier Sense Multiple Access. Carrier Sense Multiple Access with Collision Detection is
used to improve CSMA performance by terminating transmission as soon as collision is
detected, reducing the probability of a second collision on retry.
Before we discuss a little more about CSMA/CD we need to understand what is collision,
collision domain and network segment. A collision is the result of two devices on the same
Ethernet network attempting to transmit data at the same time. The network detects the
"collision" of the two transmitted packets and discards both of them.
If we have one large network solution is to break it up into smaller networks – often
called network segmentation. It is done by using devices like routers and switches - each of
switch ports create separate network segment which result in separate collision domain. A
collision domain is a physical network segment where data packets can "collide" with each
other when being sent on a shared medium. Therefore on a hub, only one computer can
receive data simultaneously otherwise collision can occur and data will be lost.
Hub (called also repeater) is specified in Physical layer of OSI model because it regenerates
only electrical signal and sends out input signal to each of ports. Today hubs do not dominate
on the LAN networks and are replaced with switches.
Carrier Sense – means that a transmitter listens for a carrier (encoded information signal) from
another station before attempting to transmit.
Multiple Access – means that multiple stations send and receive on the one medium.
Collision Detection - involves algorithms for checking for collision and advertises about collision
with collision response – “Jam signal”.
When the sender is ready to send data, it checks continuously if the medium is busy. If the
medium becomes idle the sender transmits a frame.
Look at the Figure 2.4 bellow where simple example of CSMA/CD is explained.
1. Any host on the segment that wants to send data “listens” what is happening on the
physical medium(wire) an is checking whether someone else is not sending data
already.
2. Host A and host C on shared network segment sees that nobody else is sending and
tries to send frames.
3. Host A and Host C are listening at the same time so both of them will transmit at the
same time and collision will occur. Collision results in what we refer to as "noise" - a
change in the voltage of the signals in the line (wire).
4. Host A and Host B detect this collision and send out “jam” signal to tell other hosts not
to send data at this time. Both Host A and Host C need to retransmit this data, but we
don't want them to send frames simultaneously once again. To avoid this, host A and
host B will start a random timer (ms) before attempting to start CSMA/CD process
again by listening to the wire.
Each computer on Ethernet network operates independently of all other stations on the
network.
Commands that displays current ARP entries on a PC (linux, DOS) and a MikroTik router
(commands might do the same thing, but they syntax may be different):
For windows and Unix like machines: arp – a displays the list of IP addresses with its
corresponding MAC addresses
ip arp print – same command as arp – a but display the ARP table on a MikroTik Router.
Manual:Router AAA
Contents
[hide]
1Summary
2User Groups
o 2.1Properties
o 2.2Sensitive information
o 2.3Notes
o 2.4Example
3Router Users
o 3.1Properties
o 3.2Notes
4Monitoring Active Users
o 4.1Properties
o 4.2Example
5Remote AAA
o 5.1Properties
6SSH Keys
o 6.1Private keys
o 6.2Example
Summary
Sub-menu: /user
MikroTik RouterOS router user facility manage the users connecting the router from the local
console, via serial terminal, telnet, SSH or Winbox. The users are authenticated using either
local database or 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 Groups
Sub-menu: /user group
The router user groups provide a convenient way to assign different permissions and access
rights to different user classes.
Properties
Property
name (string; Default: ) The name of the user grou
policy (local | telnet | ssh | ftp | reboot | read | write | policy | test | web | sniff | api | List of allowed policies:
winbox | password | sensitive; Default: ) Login policies:
Sensitive information
Starting with RouterOS v3.27, the following information is regarded as sensitive, and can be
hidden from certain user groups with the 'sensitive' policy unchecked.
Also, since RouterOS v4.3, backup files are considered sensitive, and users without this policy
will not be able to download them in any way.
system package
/radius: secret
/snmp/community: authentication-password, encryption-password
advanced-tools package
/tool/sms: secret
wireless package
/interface/wireless/security-profiles: wpa-pre-shared-key,
wpa2-pre-shared-key, static-key-0, static-key-1, static-key-2,
static-key-3, static-sta-private-key
/interface/wireless/access-list: private-key, private-pre-shared-key
wireless-test package
user-manager package
/tool/user-manager/user: password
/tool/user-manager/customer: password
hotspot package
/ip/hotspot/user: password
ppp package
/ppp/secret: password
security package
routing package
/routing/bgp/peer: tcp-md5-key
/routing/rip/interface: authentication-key
/routing/ospf/interface: authentication-key
/routing/ospf/virtual-link: authentication-key
routing-test package
/routing/bgp/peer: tcp-md5-key
/routing/rip/interface: authentication-key
/routing/ospf/interface: authentication-key
/routing/ospf/virtual-link: authentication-key
Notes
There are three system groups which cannot be deleted:
1 name="write"
policy=local,telnet,ssh,reboot,read,write,test,winbox,password,web,!ftp
,!policy
2 name="full"
policy=local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,passwo
rd,web
3 name="test"
policy=ssh,read,policy,!local,!telnet,!ftp,!reboot,!write,!test,!winbox
,!password,!web
[admin@rb13] >
Exclamation sign '!' just before policy item name means NOT.
Example
To add reboot group that is allowed to reboot the router locally or using telnet, as well as read
the router's configuration, enter the following command:
1 name="write"
policy=local,telnet,ssh,reboot,read,write,test,winbox,password,web,!ftp
,!policy
2 name="full"
policy=local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,passwo
rd,web
3 name="reboot"
policy=local,telnet,reboot,read,!ssh,!ftp,!write,!policy,!test,!winbox,
!password,!web
[admin@rb13] user group>
Router Users
Sub-menu: /user
Router user database stores the information such as username, password, allowed access
addresses and group about router management personnel.
Properties
Property
address (IP/mask | IPv6 prefix; Default: ) Host or network address fr
group (string; Default: ) Name of the group the use
name (string; Default: ) User name. Although it mu
password (string; Default: ) User password. If not spec
may contain letters, digits,
Notes
There is one predefined user with full access rights:
[admin@MikroTik] user>
There always should be at least one user with fulls access rights. If the user with full access
rights is the only one, it cannot be removed.
/user active print command shows the currently active users along with respective
statisics information.
Properties
All properties are read-only.
Property
address (IP/IPv6 address) Host IP/IPv6 address from
group (string) Group that user belongs to
name (string) User name.
radius (true | false) Whether user is authentica
via (console | telnet | ssh |winbox | api | web) User's access method
when (time) Time and date when user l
Example
To print currently active users, enter the following command:
Remote AAA
Sub-menu: /user aaa
Router user remote AAA enables router user authentication and accounting via RADIUS
server. The RADIUS user database is consulted only if the required username is not found in
the local user database
Properties
Property
accounting (yes | no; Default: yes)
exclude-groups (list of group names; Default: ) Exclude-groups consists o
for users authenticated by
Note: If you are using RADIUS, you need to have CHAP support enabled in the RADIUS
server for Winbox to work
SSH Keys
Sub-menu: /user ssh-keys
This menu allows to import public keys used for ssh authentication.
Warning: User is not allowed to login via ssh by password if ssh-keys for the user is added
Properties:
Property
user (string; Default: ) username to which ssh key
Read-only properties:
Property
key-owner (string)
When importing ssh key by /user ssh-keys import command you will be asked for two
parameters:
Private keys
Sub-menu: /user ssh-keys private
This menu is used to import and list imported private keys. Private keys are used to
authenticate remote login attempts using certificates.
Read-only properties:
Property
user (string)
key-owner (string)
When importing ssh keys from this sub menu using /user ssh-keys private import
command you will be asked for three parameters:
Manual:RouterOS6 news
(Redirected from Manual:What's New In v6)
Contents
[hide]
1General
2PPP
3Firewall
4Wireless
5DHCP
6IpSec
7Certificates
8Routing
9Queues
10Compact configuration export
11Tools
General
Updated drivers and Kernel (to linux-3.3.5)
Initial OpenFlow support
New LCD Touch screen features
Hotspot mac-cookie login method (mostly used for smartphones)
Configurable Kernel options in /ip settings and /ipv6 settings menu (ip forward, rp filters
etc)
ARP timeout can be changed in /ip settings
Neighbor discovery can be disabled by default on dynamic interfaces in /ip neighbor
discovery settings menu
To enable/disable discovery on interface you now must use command: "/ip neighbor
discovery set (interface number/name) discover=yes/no".
Show last-logged-in in users list
GRE supports all protocol encapsulation, not just ip and ipv6;
Slave flag shows up for interfaces that are in bridge,bonding or switch group;
SSH client has new property output-to-file, useful for scripting.
Support for API over TLS (SSL)
API is now enabled by default
DNS retry queries with tcp if truncated results received
DNS rotates servers only on failure
DNS cache logs requests to topics "dns" and "packet";
WebFig now supports RADIUS authentication (via MS-CHAPv2)
New Web Proxy parameter max-cache-object-size
Increased Max client/server connection count for Web Proxy
If NTP client is enabled, logs show correct time and date when router was rebooted.
802.1Q Trunking with Atheros switch chip
PPP
SSTP can now force AES encryption instead of default RC4
PPP profile now has bridge-path-cost amd bridge-port-priority parameters
Secrets shows last-logged-out date and time
Hotspot and PPP now support multiple address-lists
Only 2 change mss mangle rules are created for all ppp interfaces;
Firewall
New all-ether,all-wireless,all-vlan,all-ppp interface matchers
Priority matcher
New change-dscp options from-priority and from-priority-to-high-3-bits
New Mangle Actions snif-tzsp,snif-pc
Wireless
Wireless Channels options - creating custom channel lists
DHCP
DHCP client now support custom options
DHCP v4 client now have special-classless option for add-default-route parameter
Possibility to add DHCP relay agent information option (Option 82)
DHCPv6 DNS option support
DHCPv6 Relay support
DHCP server RADIUS framed route support
DHCP option configuration per lease
IpSec
Significantly improved Road Warrior setup usage with Mode Configuration support.
Detailed configuration example can be found in the manual.
Full list of new features:
Certificates
CA keys are no more cached, every CA operations now requires a valid CA passphrase.
Use set-ca-passphrase for scep server to cache CA key in encrypted form;
For certificates marked as trusted=yes, CRL will be automatically updated once in an hour
from http sources;
Ipsec and SSTP respects CRLs
SCEP server/client support
Certificate manager now can issue self signed certificates.
Routing
New OSPF parameter use-dn. Forces to ignore DN bit in LSAs.
Changed BGP MED propagation logic, now discarded when sending route with non-empty
AS_PATH to an external peer
Connected routes become inactive when Interface goes down. It also means that dynamic
routing protocols will stop distributing connected routes without Active flag.
Queues
improved overall router performance when simple queues are used
improved queue management (/queue simple and /queue tree) - easily handles tens of
thousands of queues;
/queue tree entries with parent=global are performed separately from /queue simple and
before /queue simple;
new default queue types: pcq-download-default and pcq-upload-default;
simple queues have separate priority setting for download/upload/total;
global-in, global-out, global-total parent in /queue tree is replaced
with global that is equivalent to global-total in v5;
simple queues happen in different place - at the very end of postrouting and local-in
chains;
simple queues target-addresses and interface parameters are joined into one target
parameter, now supports multiple interfaces match for one queue;
simple queues dst-address parameter is changed to dst and now supports destination
interface matching;
Tools
FastPath support
Renamed e-mail tls to start-tls and added it as a configurable parameter
Fetch tool now has HTTPS support
Added ipv6 header support for traffic generator
Playback pcap files into network using new trafficgen inject-pcap command
NAND Flash can be Partitioned on routerboards and separate RouterOS versions can be
installed on each of the partitions
Manual:License
Contents
[hide]
CHR license
Cloud Hosted Router (CHR) licenses for virtual machines do not use Levels, please see
the CHR manual for more information
License Levels
After installation RouterOS runs in trial mode. You have 24 hours to register for Level1 or
purchase Level 3,4,5 or 6 and enter a valid key.
Level 3 is a wireless station (client or CPE) only license. For x86 PCs, Level3 is not available
for purchase individually. For ordering more than 100 L3 licenses, contact
sales[at]mikrotik.com
Level 2 was a transitional license from old legacy (pre 2.8) license format. These licenses are
not available anymore, 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 0 (Trial 1 (Free 3 (WISP 6
4 (WISP) 5 (WISP)
number mode) Demo) CPE) (Controller)
registration
Price no key volume only $45 $95 $250
required
Initial Config
- - - 15 days 30 days 30 days
Support
Wireless
Client and 24h trial - yes yes yes yes
Bridge
RIP, OSPF,
BGP 24h trial - yes(*) yes yes yes
protocols
PPPoE
24h trial 1 200 200 500 unlimited
tunnels
OVPN
24h trial 1 200 200 unlimited unlimited
tunnels
Level 0 (Trial 1 (Free 3 (WISP 6
4 (WISP) 5 (WISP)
number mode) Demo) CPE) (Controller)
VLAN
24h trial 1 unlimited unlimited unlimited unlimited
interfaces
HotSpot
24h trial 1 1 200 500 unlimited
active users
RADIUS
24h trial - yes yes yes yes
client
User
manager
24h trial 1 10 20 50 Unlimited
active
sessions
(*) - BGP is included in License Level3 only for RouterBOARDs, for other devices you need
Level4 or above to have BGP.
All Licenses:
never expire
include 15-30 day free support over e-mail
can use unlimited number of interfaces
are for one installation each
offer unlimited software upgrades
Note: 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.
See also
Article translation to Spanish
Select your License Level and the number of licenses you need
Enter your SoftIDs and select the system kind, remember that SoftID will be given to you after installation of
RouterOS. The system kind is a choice between RouterBOARD and X86. Basically if you have a
RouterBOARD(TM) device, select RouterBOARD, if you have some other kind of device - select X86. NOTE!:
Older RouterBOARD 230 model is an X86 device too.
Click on Pay By Credit Card and You will be presented the bank payment page
In the Bank page you will be asked for your Credit Card Number, CVC/CVV code, expiry date of the
card and the name on the card. The CVC/CVV card can be found on the back of the card and is a three
digit code. After you enter all the details and submit the information, your credit card will be charged.
Do not close the browser or push any buttons until the process is complete. Then you will receive your
new key in your email, and it will also appear in the "work with keys" section of your account.
Instructions how to apply license on your router are here.
Categories:
Manual
License
Basic
Navigation menu
Log in
Manual
Discussion
Read
View source
View history
Search
Go
Main Page
Recent changes
Tools
What links here
Related changes
Special pages
Printable version
Permanent link
Page information
This page was last edited on 14 September 2011, at 13:40.
Privacy policy
Disclaimers
Manual:Replacement Key
1 - To request replacement key go to required section in you account management in
mikrotik.com
1General
o 1.1Properties
o 1.2Upgrading RouterBOOT
2Settings
o 2.1Protected bootloader
3Mode button
o 3.1Example
General
Sub-menu level: /system resource
On RouterBOARD devices, the following menu exists which gives you some basic information
about your device:
Properties
All properties are read-only
Property
Upgrading RouterBOOT
RouterBOOT upgrades usually include minor improvements to overall RouterBOARD
operation. It is recommended to keep this version upgraded. If you see that upgrade-
firmware value is bigger than current-firmware, you simply need to perform
the upgrade command, accept it with y and then reboot with /system reboot
After rebooting, the current-firmware value should become identical with upgrade-firmware
Settings
Sub-menu level: /system routerboard settings
Property
flash-boot -
flash-boot-once
nand-if-fail-th
nand-only -
try-ethernet-on
cpu-frequency (depends on model; Default: depends on model) This option allows for chan
keyboard at this prompt
enter-setup-on (any-key | delete-key; Default: any-key) Which key will cause the B
use Delete key to enter th
memory-frequency (depends on model; Default: depends on model) This option allows to chan
keyboard at this prompt
yes - no output on th
no - regular info and
Protected bootloader
This is a new feature which allows the protection of RouterOS configuration and files from a
physical attacker by disabling etherboot. It is called "Protected RouterBOOT". This feature can
be enabled and disabled only from within RouterOS after login, i.e., there is no RouterBOOT
setting to enable/disable this feature. These extra options appear only under certain conditions.
When this setting is enabled - both the reset button and the reset pin-hole is disabled. Console
access is also disabled. The only ability to change boot mode or RouterBOOT settings is
through RouterOS. If you do not know the RouterOS password - only a complete format is
possible.
The backup RouterBOOT version can not be older than v3.24 version. A special package
is provided to upgrade the backup RouterBOOT (DANGEROUS). Newer devices will have
this new backup loader already installed at the factory. Download the package for:
MIPSBE platform here SMIPS platform here MMIPS platform here TILE platform here.
RouterOS version 6.33 or later is required to enable this feature. Also make sure, that you
have the latest firmware installed.
Property
enabled - secure m
Etherboot is not avail
disabled - regular
EXTREMELY DANGER
1. RouterOS, all of it
2. all RouterBOOT se
3. Board is rebooted
4. As boot from NAN
5. Netinstall is requi
Please note! Reformat on
Mode button
Some RouterBOARD devices have a mode button that allows you to run any script when the
button it pushed.
Example
Upon pressing the button, the message 1234567890 will be logged in the system log.
Property
Manual:RouterBOOT
RouterBOOT is responsible for starting RouterOS in RouterBOARD devices.
Contents
[hide]
Hold this button during boot time until LED light starts flashing, release the button to reset
RouterOS configuration (total 5 seconds)
Keep holding for 5 more seconds, LED turns solid, release now to turn on CAPs mode
(total 10 seconds)
Or Keep holding the button for 5 more seconds until until LED turns off, then release it to
make the RouterBOARD look for Netinstall servers (total 15 seconds)
Note: If you hold the button before applying power, backup RouterBOOT will be used in
addition to all the above actions. To do the above actions without loading the backup loader,
push the button right after applying power to the device.
Configuration
For RouterBOARD devices that feature a serial console connector, it is possible to access the
RouterBOOT loader configuration menu. The required cable is described in the Serial
console manual. RouterBOARD serial port is configured to 115200bit/s, 8 data bits, 1 stop bit,
no parity. We suggest to disable the hardware flow control.
This example shows the menu which is available in RouterBOOT 3.19:
CCR1009-8G-1S-1S+
RouterBOOT-3.19
What do you want to configure?
d - boot delay
k - boot key
s - serial console
n - silent boot
o - boot device
f - cpu frequency
r - reset booter configuration
e - format nand
w - repartition nand
y - active partition
g - upgrade firmware
i - board info
p - boot protocol
b - booter options
t - do memory testing
k boot key The button that will open the configuration menu
Supresses all output on the serial port, in case some device is connected
n silent boot
to it (like a GPS device or a temperature monitor)
reset booter
r Resets the settings in this menu. Warning, no confirmation!
configuration
y active partition Choose active partition from which to try to load RouterOS
Allows upgrading RouterBOOT version through the network, or the
g upgrade firmware
XModem protocol
i board info
p boot protocol
Hitting the appropriate keyboard letter will give you a list of further options, they are shown
below:
# d - boot delay:
# k - boot key:
# s - serial console:
# n - silent boot:
Silent boot:
0 - off
* 1 - on
# o - boot device:
# f - cpu frequency:
# e - format nand:
# w - repartition nand:
Select parititon count:
1 - partition
* 2 - partitions
3 - partitions
4 - partitions
# y - active partition:
# g - upgrade firmware:
# i - board info:
Board Info:
# b - booter options:
#t - do memory testing:
# x - exit setup:
Simple Upgrade
RouterBOOT can be upgraded from RouterOS by:
Note: If you need to install a different version than included in your "routerboard.npk - Upload
the latest RouterBOOT firmware to your router's FTP, the latest firmware is available
on routerboard.com and then follow above steps.
In this case you see, that there is a newer version of the Bootloader firmware available
already inside your current RouterOS version.
Note: Downgrade is also possible by uploading *.FWF file with older version
Xmodem Method
If there is no IP connectivity with your RouterBOARD, you can also use the Serial Console
XMODEM transfer to send the FWF file to the router, while connected via Serial Console. From
the Bootloader menu it's possible to upgrade the firmware with this method. This method is the
last resort, and should be used only if the first two methods are not available.
[ Top | Back to Content ]
Manual:PoE-In
RouterBOARD devices with "poe" labeled ports, support powering by Passive PoE over spare
pairs, except where notified otherwise. This table explains Ethernet cable pinout for
RouterBOARD devices, and shows powered pins for PoE on 10/100 and 10/100/1000 devices.
Note: for Gigabit models, you have to use the MikroTik Gigabit PoE injector, that passes PoE
trough pins 4,5 (+) and 7,8 (-). When using other PoE injectors, power can be passed on any
other pins, depending on PoE injector model.
Manual:Product Naming
Contents
[hide]
Board Name
Currently there can be three types of board names:
3-symbol name
1st symbol stands for series (this can either be a number or a letter)
2nd digit for indicating number of potential wired interfaces (Ethernet, SFP, SFP+)
3rd digit for indicating number of potential wireless interfaces (built-in and mPCI and
mPCIe slots)
Word - currently used names are: OmniTIK, Groove, SXT, SEXTANT, Metal, LHG,
DynaDish, cAP, wAP, LDF, DISC, mANTBox, QRT, DynaDish, cAP, hAP, hEX . If
board has fundamental changes in hardware (such as completely different CPU) revision
version will be added in the end
Exceptional naming - 600, 800, 1000, 1100, 1200, 2011, 3011 boards are standalone
representatives of the series or have more than 9 wired interfaces, so name was simplified
to full hundreds or development year.
Board Features
Board features follows immediately after board name section (no spaces or dashes), except
when board name is a word, then board features are separated by space.
U - USB
P - power injection with controller
i - single port power injector without controller
A - more memory (and usually higher license level)
H - more powerful CPU
G - Gigabit (may include "U","A","H", if not used with "L")
L - light edition
S - SFP port (legacy usage - SwitchOS devices)
e - PCIe interface extension card
x<N> - where N is number of CPU cores ( x2, x16, x36 etc)
R - MiniPCI or MINIPCIe slot
Built-in wireless details
If board has built-in wireless, then all its features are represented in following format:
<band><power_per_chain><protocol><number_of_chains>
band
5 - 5Ghz
2 - 2.4Ghz
52 - dual band 5Ghz and 2.4Ghz
protocol
(not used) - for cards with only 802.11a/b/g support
n - for cards with 802.11n support
ac - for cards with 802.11ac support
number_of_chains
(not used) - single chain
D - dual chain
T - triple chain
connector type
(not used) - only one connector option on the model
MMCX - MMCX connector type
u.FL - u.FL connector type
Enclosure type
RB (RouterBOARD)
912 - 9th series board with 1 wired (ethernet) interface and two wireless interfaces (built-in
and miniPCIe)
UAG - has USB port, more memory and gigabit ethernet port
5HPnD - has built in 5GHz high power dual chain wireless card with 802.11n support.
list of ports
-<n>G number of 1G Ethernet ports
-<n>P number of 1G Ethernet ports with PoE-out
-<n>C number of combo 1G Ethernet/SFP ports
-<n>S number of 1G SFP ports
-<n>G+ number of 2.5G Ethernet ports
-<n>P+ number of 2.5G Ethernet ports with PoE-out
-<n>C+ number of combo 10G Ethernet/SFP+ ports
-<n>S+ number of 10G SFP+ ports
-<n>XG number of 5G/10G Ethernet ports
-<n>XP number of 5G/10G Ethernet ports with PoE-out
-<n>XC number of combo 10G/25G SFP+ ports
-<n>XS number of 25G SFP+ ports
-<n>Q+ number of 40G QSFP+ ports
-<n>XQ number of 100G QSFP+ ports
3 digit number
1st digit stands for series
2nd-3rd digit - total number of wired interfaces (Ethernet, SFP, SFP+)
list of ports
-<n>G number of 1G Ethernet ports
-<n>P number of 1G Ethernet ports with PoE-out
-<n>C number of combo 1G Ethernet/SFP ports
-<n>S number of 1G SFP ports
-<n>G+ number of 2.5G Ethernet ports
-<n>P+ number of 2.5G Ethernet ports with PoE-out
-<n>C+ number of combo 10G Ethernet/SFP ports
-<n>S+ number of 10G SFP+ ports
-<n>XG number of 5G/10G Ethernet ports
-<n>XP number of 5G/10G Ethernet ports with PoE-out
-<n>XC number of combo 10G/25G SFP+ ports
-<n>XS number of 25G SFP+ ports
-<n>Q+ number of 40G QSFP+ ports
-<n>XQ number of 100G QSFP+ ports
Manual:Peripherals
Contents
[hide]
1Cellular modems
2SFP modules
3SFP+ modules
This article describes supported add-on peripherals for RouterBOARD hardware devices.
Cellular modems
Tested
Route Passthr
For Technol
Model rOS Comments ough
mat ogies
versio support
n
v5.25 and
BandRich C501 [1] USB ? LTE
v6.0
FACTORY mode to
change operating state.
ZTE MF825A v6.xx Some settings are ignored. USB ? LTE
Vodafone K5160 [7] v6.37 Some settings are ignored. USB ? LTE
Vodafone K4201- Some settings are ignored.
v6.8 USB ? LTE
Z [8] LTE interface.
ZTE MF827 [9] v6.8 Some settings are ignored. USB ? LTE
Some settings are ignored.
There are multiple
versions of this modem.
Huawei E3272 v6.8 USB ? LTE
Looks like only modem
with device-id="0x14db"
works as LTE interface.
MIFI unit. No serial
Huawei E5377 v6.36.1 support, but works with IP USB ? LTE
on LTE interface
MiniPC
Huawei MU609 [10] v6.11 ? 3G
I-e
Huawei MU709s- MiniPC
v6.28 Y 3G
2 [11] I-e
Huawei ME909u- MiniPC
v6.11 N LTE
521 [12] I-e
Huawei ME909s- MiniPC
v6.28 Y LTE
120 [13] I-e
Works! PPP interface.
MiniPC
And starting with v7.xx it
v6.xx(pp I-e /
will support LTE
SIMcom SIM7100 p) v7.xx USB w/ ? LTE
interface. vendor-
(LTE) convert
id="0x1e0e" device-
er
id="0x9001"
Works! PPP interface.
And starting with v7.xx it
v6.xx(pp
Sierra wireless will support LTE MiniPC
p) v7.xx N LTE
MC73xx interface. MC7304 tested I-e
(LTE)
with firmware
SWI9X15C_05.05.67.00
Not supported in ROS v6,
Vodafone (Huawei)
v7.xx but as this modem USB ? LTE
K4203
supports MBIM drivers
Tested
Route Passthr
For Technol
Model rOS Comments ough
mat ogies
versio support
n
+CGMR:
MOLY.WR8.W1231.DC.
WG.MP.V3, 2013/04/09
02:08 Different HW
revisions might not work
with RouterOS
( aka "USB Wireless
HSDPA/UMTS 2.1GHz
AnyData ADU-
v6 GSM/GPRS/EGPRS USB 3G
E630WH
900/17000MHz/CDMA 1x
EVDO Rev.A")
v6.x and MiniPC
Ericsson F5521gw 3G
higher I-e
ZTE AC5730 v6.x USB 3G
v6.31<
Huawei E153 and USB 3G
higher
Set info channel = 2, data
v6.28 and
ZTE MF110 channel = 2, Dial USB 3G
higher
command=ATM1L3DT
Set Info channel = 1, Data
ZTE 821D v6.x channel = 3, Dial USB 3G
command=ATDT
There are different
versions of this modem
v6.24 or
E3531-6 works from
Huawei E3531 6.40RC2 USB 3G
version 6.40RC25 as ppp,
5
mbim supported only from
RouterOS V7
v6.24 and
Huawei E3351 USB 3G
higher
Data channel 0, Info
channel 0, init:
Dell Wireless 5530 v6.1 and MiniPC
AT+CFUN=1 (needs 3G
HSPA higher I-e
manualy change profile by
command AT*ENAP=1,1)
Data Channel=2, Info
Telecom NZ T-Stick Channel=2, APN
v6.0rc13 USB 3G
ZTE MF-181 internet.telecom.co.nz,
PHONE=*99#. Tested ok
Tested
Route Passthr
For Technol
Model rOS Comments ough
mat ogies
versio support
n
Note: Not all modems are listed. Localized and locked units may have compatibility issues.
SFP modules
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
*Check: SFP/
Nativel
SFP+
MikroTi y
S-85DLC05D 1,25G Dual LC, MM 850nm compatibility
k support
reference
ed
table
*Check: SFP/
Nativel
SFP+
MikroTi y
S-31DLC20D 1,25G Dual LC, SM 1310nm compatibility
k support
reference
ed
table
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
*Check: SFP/
Nativel
SFP+
MikroTi Tx:1310nm/Rx:1 y
S-35LC20D 1,25G BiDi LC, SM compatibility
k 550nm support
reference
ed
table
*Check: SFP/
Nativel
SFP+
MikroTi Tx:1550nm/Rx:1 y
S-53LC20D 1,25G BiDi LC, SM compatibility
k 310nm support
reference
ed
table
*Check: SFP/
Nativel
SFP+
MikroTi 1000/100 RJ45, y
S-RJ01 N/A compatibility
k /10 Cat5/Cat6 support
reference
ed
table
1000BA CRS125-
Axiom AXG91632 Dual LC 1310nm Works!
SE-LX 24G-1S-RM
10/100/1 RB2011LS-
Finisar FCLF-8521-3 RJ45, Cat6 N/A Works!
000 IN
10/100/1
000 1.25
FTRJ8519P1 Gb/s RB2011LS-
Finisar Dual LC, MM 850nm Works!
BNL-B1 1000Bas IN
e-SX
Ethernet
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
10/100/1
000 1.25
FTLF8519P2 Gb/s RB2011LS-
Finisar Dual LC, MM 850nm Works!
BNL 1000Bas IN
e-SX
Ethernet
CCR1009-
1.25Gb/s
8G-1S-1S+
FTRJ1319P1 1000Bas
Finisar Dual LC, SM 1310nm and Works!
BTL e-LX
CCR1009-
Ethernet
7G-1C-1S+
RB2011LS-
Unica SFP-1.25G-T 1000M RJ45, Cat6 N/A Works!
IN
FTLX8571D3 RB2011LS-
Dell 1,25G Dual LC, MM 850nm Works!
BCL IN
GP-3124- RB2011LS-
Unica 1,25G Dual LC, MM 1310nm Works!
L2CD-C IN
RB2011LS-
Cisco GLC-T 1.25G RJ45, Cat6 N/A Works!
IN
1000BA
SE-SX
SFP
transceiv
RB2011LS-
Cisco GLC-SX-MM er Dual LC, MM 850nm Works!
IN
module
for
MMF,
1.25G
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
1000BA
SE-
LX/LH
SFP
Various MT
Cisco SFP-GE-L transceiv Dual LC, SM 1300nm Works!
hardware
er
module
for SMF,
1.25G
10/100/1 RB2011LS-
6COM 6C-SFP-T RJ45, Cat6 N/A Works!
000 IN
6C-SFP- RB2011LS-
6COM 1,25G Dual LC, MM 1310nm Works!
0310D IN
6C-SFP- RB2011LS-
6COM 1,25G Dual LC, MM 850nm Works!
0301D IN
INSP-
10/100/1 RB2011LS-
Ingellen T(10/100/100 RJ45, Cat6 N/A Works!
000 IN
0)
INSPL-53- RB2011LS-
Ingellen 1,25G BiDi LC, MM 1550/1310 Works!
BX IN
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
INSPL-35- RB2011LS-
Ingellen 1,25G BiDi LC, MM 1310/1550 Works!
BX IN
RB2011LS-
Ingellen INSP-LX-SM 1,25G Dual LC, SM 1310nm Works!
IN
INSP-SX- RB2011LS-
Ingellen 1,25G Dual LC, MM 850nm Works!
MM IN
AXGD-1354- RB2011LS-
AXCEN 1,25G Dual LC, MM 1310nm Works!
0531 IN
AXGD-5854- RB2011LS-
AXCEN 1,25G Dual LC, MM 850nm Works!
0511 IN
RB2011LS-
TP-Link TL-SM311LS 1,25G Dual LC, SM 1310nm Works!
IN
TL- CCR1036
TP-Link 1,25G Dual LC, MM 850nm Works!
SM311LM 12G-4S
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
RB2011UAS-
OPTIC-SFP- Tx:1310nm/Rx:1
OPTIC 1,25G BiDi SC, SM RM, Works!
3524S-02-SC 550nm
RB260GS
RB2011UAS-
OPTIC-SFP- Tx:1550nm/Rx:1
OPTIC 1,25G BiDi SC, SM RM, Works!
5324S-02-SC 310nm
RB260GS
OPTIC-SFP- RB2011UAS-
Tx:1310nm/Rx:1
OPTIC S1203- 1,25G BiDi LC, SM RM, Works!
550nm
L3302-LC RB260GS
OPTIC-SFP- RB2011UAS-
Tx:1550nm/Rx:1
OPTIC S1205- 1,25G BiDi LC, SM RM, Works!
310nm
L3302-LC RB260GS
CCR1036-
ROBOFi
SFP-7120-55 1,25G Dual LC, SM 1550nm 12G-4S, Works!
ber
RB2011
SFP- CCR,
Tx:1310nm/Rx:1
Enguity 3647603KM. 1,25G BiDi LC, SM RB2011, Works!
550nm
b1310 XT RB260GS
SFP- CCR,
Tx:1550nm/Rx:1
Enguity 3647603KM. 1,25G BiDi LC, SM RB2011, Works!
310nm
b1550 XT RB260GS
Wor
Bran Connector/ Tested ks /
Model Rate Wavelength
d Cable type with Does
n't
SFP- CCR,
Tx:1490nm/Rx:1
Enguity 3647610KM. 1,25G BiDi LC, SM RB2011, Works!
550nm
b1490 XT RB260GS
SFP- CCR,
Tx:1550nm/Rx:1
Enguity 3647610KM. 1,25G BiDi LC, SM RB2011, Works!
490nm
b1550 XT RB260GS
CCR,
AdvOpti Tx:1310nm/Rx:1
GLC-SX-MM 1,25G BiDi LC, MM RB2011, Works!
cs MSA 310nm
RB260GS
CCR,
AdvOpti Tx:1310nm/Rx:1
GLC-ZX-SM 1,25G BiDi LC, SM RB2011, Works!
cs MSA 310nm
RB260GS
GLC-BX- Tx:1490nm/Rx:1
Proline 1,25G BiDi LC, SM CRS125 Works!
D20-PRO 310nm
GLC-BX- Tx:1310nm/Rx:1
Proline 1,25G BiDi LC, SM CRS125 Works!
D40-PRO 490nm
Foundry
E1MG-BXU- Tx:1310nm/Rx:1 RB3011UiAS
Network 1,25G BiDi LC, SM Works!
AC 490nm , hAP ac
s
Works
SFBR- CRS326, in
Avago 1,25G Dual LC, MM 850nm
5799APZ CRS112 1Gbps
mode!
SFP+ modules
Wo
Connect Test rks
Bra Dist Wavelengt
Model Rate or/Cable ed /
nd ance h
type with Doe
sn't
All
MikroT
ik
Native
product
Mikro S+85DLC0 Dual LC, ly
300m 10G 850nm s with
Tik 3D MM suppor
SFP/SF
ted
P+
interfac
es
All
MikroT
ik
Native
product
Mikro S+31DLC1 Dual LC, ly
10km 10G 1310nm s with
Tik 0D SM suppor
SFP/SF
ted
P+
interfac
es
All
MikroT
ik
Native
product
Mikro S+23LC10 BiDi LC, Tx:1270nm/R ly
10km 10G s with
Tik D SM x:1330nm suppor
SFP/SF
ted
P+
interfac
es
All
MikroT
ik
Native
product
Mikro S+32LC10 BiDi LC, Tx:1330nm/R ly
10km 10G s with
Tik D SM x:1270nm suppor
SFP/SF
ted
P+
interfac
es
Wo
Connect Test rks
Bra Dist Wavelengt
Model Rate or/Cable ed /
nd ance h
type with Doe
sn't
All
MikroT
ik
Native
product
Mikro Twinax ly
S+DA0001 1m 10G N/A s with
Tik Copper suppor
SFP/SF
ted
P+
interfac
es
All
MikroT
ik
Native
product
Mikro Twinax ly
S+DA0003 3m 10G N/A s with
Tik Copper suppor
SFP/SF
ted
P+
interfac
es
various
,
All
depend
MikroT
ing on
ik Native
link RJ45 -
Mikro 10G/5G/2.5G/1G product ly
S+RJ10 rate. Cat5E/Cat6/ N/A
Tik /100M/10M s with suppor
Check Cat7
SFP+ ted
brochu
interfac
re for
es
more
details
CRS
series,
Does
APSP55B3 Dual LC, CCR
Atop 40km 10G 1550nm NOT
0CDL40 SM series
work!
devices
with
SFP+
Wo
Connect Test rks
Bra Dist Wavelengt
Model Rate or/Cable ed /
nd ance h
type with Doe
sn't
interfac
es
Most of
SFP/SF
Dell P+
FTLX8571 Dual LC, Works
(Finis 300m 10G 850nm MikroT
D3BCL MM !
ar) ik
product
s
Most of
SFP/SF
Junipe
P+
r FTLX8571 Dual LC, Works
300m 10G 850nm MikroT
(Finis D3BCL-J1 MM !
ik
ar)
product
s
Most of
SFP/SF
Intel P+
FTLX8571 Dual LC, Works
(Finis 300m 10G 850nm MikroT
D3BCV-IT MM !
ar) ik
product
s
Most of
SFP/SF
OEM EX-SFP- P+
Dual LC, Works
(Junip 10GE-SR- 300m 10G 850nm MikroT
MM !
er?) OEM ik
product
s
Wo
Connect Test rks
Bra Dist Wavelengt
Model Rate or/Cable ed /
nd ance h
type with Doe
sn't
CRS
series,
CCR
series
Fibers SFP- Dual LC, Works
40km 10G 1310nm devices
tore 10G31-40 SM !
with
SFP+
interfac
es
CRS
series,
CCR
series
Fibers SFP- Dual LC, Works
40km 10G 1310nm devices
tore 10G55-40 SM !
with
SFP+
interfac
es
CRS
series,
CCR
series
Fibers SFP- BiDi LC, Tx:1330nm/R Works
40km 10G devices
tore 10G32-40 SM x:1270nm !
with
SFP+
interfac
es
CRS
series,
CCR
series
Fibers SFP- BiDi LC, Tx:1270nm/R Works
40km 10G devices
tore 10G23-40 SM x:1330nm !
with
SFP+
interfac
es
Wo
Connect Test rks
Bra Dist Wavelengt
Model Rate or/Cable ed /
nd ance h
type with Doe
sn't
CCR, Works
CCR, ,
CSS startin
series g with
Optec OPAK- RJ45 - Cat
30m 10G N/A devices v6.40r
h TX1-00-C 6a/7 Cable
with c20
SFP+ Router
interfac OS
es build.
CCR, Works
CCR, ,
CSS startin
series g with
ProLa SFP-10G- RJ45 - Cat
30m 10G N/A devices v6.40r
bs T-C 6a/7 Cable
with c20
SFP+ Router
interfac OS
es build.
Categories:
RouterBOARD
Manual
Basic
Hardware
Manual:CHR
Contents
[hide]
System Requirements
Minimal requirements:
ESX:
Network: vmxnet3, E1000
Disk: IDE, VMware paravirtual SCSI, LSI Logic SAS, LSI Logic Parallel
Hyper-V:
Network: Network adapter, Legacy Network adapter
Disk: IDE, SCSI
Qemu/KVM:
Network: Virtio, E1000, vmxnet3 (optional)
Disk: IDE, Sata, Virtio
Xen Project:
Network: E1000, rtl8193, netfront
Disk: IDE, Sata
VirtualBox
Network: E1000, rtl8193
Disk: IDE, Sata, SCSI, SAS
Note: SCSI controller Hyper-V and ESX is usable just for secondary disks, system image must
be used with IDE controller!
Warning: We do not recommend using E1000 network interface if better synthetic interface
options are available on specific Hypervisor!
CHR Licensing
The CHR has 4 license levels:
free
p1 perpetual-1 ($45)
p10 perpetual-10 ($95)
p-unlimited perpetual-unlimited ($250)
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 function 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.
License
Free 1Mbit
P1 1Gbit
P10 10Gbit
P-Unlimited Unlimited
Paid licenses
p1
p1 (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.
p10
p10 (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-unlimited
The p-unlimited (perpetual-unlimited) license level allows CHR to run indefinitely. It is the
highest tier license and it has no enforced limitations.
Free licenses
There are several options to use and try CHR free of charge.
free
The 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.
60-day trial
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.
If you plan to purchase the selected license, you must do it within 60 days of the trial end date.
If your trial ends, and there are no purchases within 2 months after it ended, 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.
You will be presented with a list of your CHR machines and licenses:
To upgrade from a Trial to a Paid license click 'Upgrade', choose the desired license
level (it can be different than the level of the trial license) and click 'Upgrade key':
Choose the payment method:
It is possible to pay using account balance (deposit), credit card (CC), PayPal or using
Balance (prepaid) key (if you have any).
Upgrade from higher tier up
Only an upgrade to a higher tier is possible at the moment (for paid licenses only) and that is
done in the account server. For changes to take place on the router itself renew command
should be issued. When the router already has any kind of trial or paid license, the license level
you set for the renew command is not important anymore, it is mandated by the account
server. Possible upgrades are as follows:
p1 upgrade to p10
p1 upgrade to p-unlimited
p10 upgrade to p-unlimited
License Update
In '/system license' menu router will indicate the time next-renewal-at when it will attempt to
contact server located on licence.mikrotik.com. Communication attempts will be performed
once an hour after the date on next-renewal-at and will not cease until the server responds with
an error. If deadline-at date is reached without successfully contacting the account server, the
router will consider that license has expired and will disallow further software updates.
However, router will continue to work with the same license tier as before.
Troubleshooting
Running on VMware ESXi
Changing MTU
VMware ESXi supports MTU of up to 9000 bytes. To get the benefit of that, you have to adjust
your ESXi installation to allow a higher MTU. Virtual Ethernet interface added after the MTU
change will be properly allowed by the ESXi server to pass jumbo frames. Interfaces added
prior to MTU change on the ESXi server will be barred by the ESXi server (it will still report old
MTU as maximum possible size). If you have this, you have to re-add interfaces to the virtual
guests.
Example. There are 2 interfaces added to the ESXi guest, auto-detected MTU on the
interfaces show MTU size as it was at the time when the interface was added:
https://kb.vmware.com/kb/1002934
https://kb.vmware.com/kb/1004099
Hyper-V
Hyper-V documentation:
https://technet.microsoft.com/en-us/library/cc816585(v=ws.10).aspx#Anchor_2
bhyve hypervisor
It wont be possible to run CHR on this hypervisor. CHR cannot be run as paravirtualized
platform.
Linode
When creating multiple Linodes with the same disk size, new Linodes will have the same
systemID. This will cause issues to get a Trial/Paid license. To avoid this, run the
command /system license generate-new-id after the first boot and before you request
a trial or paid license. This will make sure the ID is unique.
https://blogs.msdn.microsoft.com/adamfazio/2008/11/14/understanding-hyper-v-vlans/
http://www.aidanfinn.com/?p=10164
Allow passing other vlans:
https://social.technet.microsoft.com/Forums/windows/en-US/79d36d5b-c794-4502-8ed4-
b7a4183b1891/vlan-tags-and-hyperv-switches?forum=winserverhyperv
Guest tools
VMWare
Time synchronization
Must be enabled from GUI ('Synchronize guest time with host'). Backwards synchronization is
disabled by default - if guest is ahead of host by more than ~5 seconds, synchronization is not
performed
Power operations
poweron and resume scripts are executed (if present and enabled) after poweron and
resume operations respectively.
poweroff and suspend scripts are executed before poweroff and suspend operations
respectively.
If scripts take longer than 30 seconds or contain errors, the operation fails
In case of failure, retrying the same operation will ignore any errors and complete
successfully
Failed script output is saved to file (e. g. 'poweroff-script.log', 'resume-script.log' etc)
Scripts can be enabled/disabled from hypervisor GUI ('run VMware Tools Scripts') or by
enbaling/disabling scripts from console
Quiescing/backup
Guest filesystem quiescing is performed only if requested.
The order, in which network interfaces are reported, can be controlled by setting
'guestinfo.exclude-nics', 'guestinfo.primary-nics' and 'guestinfo.low-priority-nics' options.
Standard wildcard patterns can be used.
Provisioning
Can use the ProcessManager from vim API to execute scripts. Python bindings are available
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,time
from pyVim import connect
from pyVmomi import vmodl,vim
def runInline(content,vm,creds,source):
''' Execute script source on vm '''
if isinstance(source, list):
source = '\n'.join(source)
ps = vim.vm.guest.ProcessManager.ProgramSpec(
programPath = 'console',
arguments = source
)
return
content.guestOperationsManager.processManager.StartProgramInGuest(vm,cr
eds,ps)
def runFromFile(content,vm,creds,fileName):
''' Execute script file located on CHR '''
ps = vim.vm.guest.ProcessManager.ProgramSpec(
programPath = 'import',
arguments = fileName
)
return
content.guestOperationsManager.processManager.StartProgramInGuest(vm,cr
eds,ps)
def findDatastore(content,name):
sessionManager = content.sessionManager
dcenterObjView =
content.viewManager.CreateContainerView(content.rootFolder,
[vim.Datacenter], True)
datacenter = None
datastore = None
for dc in dcenterObjView.view:
dstoreObjView = content.viewManager.CreateContainerView(dc,
[vim.Datastore], True)
for ds in dstoreObjView:
if ds.info.name == name:
datacenter = dc
datastore = ds
break
dstoreObjView.Destroy()
dcenterObjView.Destroy()
return datacenter,datastore
def _FAILURE(s,*a):
print(s.format(*a))
sys.exit(-1)
#----------------------------------------------------------------------
--------#
if __name__ == '__main__':
host = sys.argv[1] # ip or something
user = 'root'
pwd = 'MikroTik'
vmName = 'chr-test'
dataStoreName = 'datastore1'
service = connect.SmartConnectNoSSL(host=host,user=user,pwd=pwd)
if not service:
_FAILURE("Could not connect to the specified host using
specified username and password")
content = service.RetrieveContent()
#------------------------------------------------------------------
---------
# Find datacenter and datastore
datacenter,datastore = findDatastore(content,dataStoreName)
#------------------------------------------------------------------
---------
# Locate vm
if not vm:
connect.Disconnect(service)
_FAILURE("Could not locate vm")
#------------------------------------------------------------------
---------
# Setup credentials from user name and pasword
pm = content.guestOperationsManager.processManager
try:
# Run script
src = [':ip address add address=192.168.0.1/24
interface=ether1;']
jobID = runInline(content, vm, creds, src)
#--------------------------------------------------------------
-------------
# Wait for job to finish
pm = content.guestOperationsManager.processManager
jobInfo = pm.ListProcessesInGuest(vm, creds, [jobID])[0]
while jobInfo.endTime is None:
time.sleep(1.0)
jobInfo = pm.ListProcessesInGuest(vm, creds, [jobID])[0]
if jobInfo.exitCode != 0:
_FAILURE('Script failed!')
except:
raise
else:
connect.Disconnect(service)
Xen
Network, disk, memory and OS info is reported to hypervisor every 30 seconds
On older hosts (pre 21.06.2017) only the first ipv4 address assigned to interface is visible
Provisioning
Base-64 encoded strings written to (domain local) xenstore path ('vm-data/provision/script') are
decoded and interpreted a script-text. Status ('ready', 'running', 'error') is reported in 'vm-
data/provision/script/status'. Scripts are accepted only if 'status' != 'running'. Base 64 encoded
script output (if any) is written to 'vm-data/provision/script/otuput'.
vmid=256
hostip=192.168.0.1
portnum=1234
qm set $vmid --args "-chardev
'socket,host=$hostip,port=$portnum,id=chr-agent,server,nowait' -device
'virtio-serial,bus=pci.0,addr=0x9' -device 'virtserialport,chardev=chr-
agent,name=chr.provision_agent'"
Disabling 'chr.provision-agent'
In host shell:
vmid=256
qm set $vmid --delete args
vmid=256
portnum=1234
socat TCP-LISTEN:$portnum,reuseaddr,fork UNIX-CLIENT:/run/qemu-
server/$vmid.qga
import os,time,base64,json,socket,select,errno
class GuestAgent(object):
'''
Qemu guest agent interface
runScript and runFile commands are tailored for ROS agent
implementation
Transport provided by derived classes (transact method)
'''
def __init__(self,**kwargs):
# Due to file contents being passed as base64 inside json:
# - large chunk sizes may slow down guest-side parsing.
# - small chunk sizes result in additional message
fragmentation overhead.
# Default value is a guestimate.
self.__chunkSize = kwargs.get('chunkSize', 4096)
def _qmpError(self,cls,msg):
''' Generic callback to log qmp errors before (optionally)
raising an exception '''
print(cls)
for line in msg.split('\n'):
print(line)
# raise RuntimeError()
def _error(self,msg,*a):
''' Generic callback to misc errors before (optionally) raising
an exception '''
print(msg.format(*a))
# raise RuntimeError()
def _info(self,msg,*a):
''' Generic callback to log info '''
print(msg.format(*a))
def _monitorJob(self,pid):
''' Block untill script job completes, echo output. Returns
None on failure '''
ret = self.transact('guest-exec-status',{'pid':pid})
if ret is None:
return None
exitcode = int(ret['exitcode'])
return exitcode, out
def putFile(self,src,dst):
''' Upload file '''
src = os.path.expanduser(src)
if not os.path.exists(src) or not os.path.isfile(src):
self._error('File does not exist: \'{}\'', src)
return None
handle = int(ret)
ret = self.transact('guest-file-
write',{'handle':handle,'buf-b64':chunk,'count':count})
if ret is None:
return None
self.transact('guest-file-flush',{'handle':handle})
ret = self.transact('guest-file-close',{'handle':handle})
return True
def getFile(self,src,dst):
''' Download file '''
dst = os.path.expanduser(dst)
ret = self.transact('guest-file-open',{'path':src,'mode':'rb'})
if ret is None:
return None
handle = int(ret)
data = ''
size = 0
while True:
ret = self.transact('guest-file-
read',{'handle':handle,'count':self.__chunkSize})
if ret is None:
return None
data += ret['buf-b64']
size += int(ret['count'])
if bool(ret['eof']):
break
ret = self.transact('guest-file-close',{'handle':handle})
data = base64.b64decode(data.encode('ascii'))
with open(dst,'wb') as f:
f.write(data)
return True
def runFile(self,fileName):
''' Execute file (on guest) as script '''
ret = self.transact('guest-exec',{'path':fileName, 'capture-
output':True})
if ret is None:
return None
pid = ret['pid']
return self._monitorJob(pid)
def runSource(self,cmd):
''' Execute script '''
if isinstance(cmd,list):
cmd = '\n'.join(cmd)
cmd += '\n'
cmd = base64.b64encode(cmd.encode('utf-8')).decode('ascii')
pid = ret['pid']
return self._monitorJob(pid)
def shutdown(self,mode='powerdown'):
'''
Execut shutdown command
mode == 'reboot' - reboot guest
mode == 'shutdown' or mode == 'halt' - shutdown guest
'''
ret = self.transact('guest-shutdown',{'mode':mode})
return ret
class SocketAgent(GuestAgent):
'''
GuestAgent using unix/tcp sockets for communication.
'''
def __init__(self):
GuestAgent.__init__(self,chunkSize= 32 * 65536)
@staticmethod
def unix(dev):
''' Connect using unix socket '''
self = SocketAgent()
self.__af = socket.AF_UNIX
self.__args = dev
self.__wait = False
return self
@staticmethod
def tcp(ip,port,wait = True):
''' Connect using tcp socket '''
self = SocketAgent()
self.__af = socket.AF_INET
self.__args = (ip,port)
self.__wait = wait
return self
def __enter__(self):
self._sock = socket.socket(self.__af, socket.SOCK_STREAM)
if self.__wait:
self._info('Waiting for guest ...')
# Wait for hyper to create channel
while True:
try:
self._sock.connect(self.__args)
break
except socket.error as e:
if e.errno == errno.EHOSTUNREACH or e.errno ==
errno.ECONNREFUSED:
time.sleep(1)
else:
self._sock.close()
raise
self._sock.setblocking(0)
response = b''
if (select.select([self._sock],[],[])[0]):
response += self._sock.recv(65536)
else:
raise RuntimeError()
self._sock.setblocking(1)
sentinel = b'\xff'
response = response.split(sentinel)[-1]
if not response:
time.sleep(3)
continue
response = json.loads(response.decode('utf-8').strip())
if 'return' in response.keys():
if int(response['return']) == key:
break
time.sleep(3)
else:
self._sock.connect(self.__args)
return self
def __exit__(self,*a):
self._sock.close()
def transact(self,cmd,args={}):
''' Exchange a single command with guest agent '''
timeout = 2
msg =
json.dumps({'execute':cmd,'arguments':args},separators=(',',':'),sort_k
eys=True)
self._sock.send(msg.encode('ascii'))
self._sock.setblocking(0)
response = b''
if (select.select([self._sock],[],[],timeout)[0]):
response += self._sock.recv(65536)
self._sock.setblocking(1)
if not response:
response = None
else:
if response[0] == 255: # sync
response = response[1:]
response = json.loads(response.decode('utf-8').strip())
if 'error' in response.keys():
self._qmpError(response['error']['class'],response['error']['desc'])
response = None
elif 'return' in response:
response = response['return']
return response
#----------------------------------------------------------------------
---------
if __name__ == '__main__':
script = [':log info "hello world";']
ip = '192.168.0.1'
port = 1234
# can also use unix sockets
#with SocketAgent.unix('/dev/something') as agent:
Manual:Default Configurations
Contents
[hide]
1Overview
2CPE Router
3LTE CPE AP router
4AP Router
5PTP Bridge
6WISP Bridge
7Switch
8IP Only
9CAP
Overview
All RouterBOARDs from factory come with default configuration. There are several different
configurations depending on board type:
CPE Router;
LTE CPE AP router;
AP Router (single or dual band);
PTP Bridge (AP or CPE);
WISP Bridge (AP in ap_bridge mode);
Switch;
IP Only;
CAP.
You can run command /system default-configuration print to see exact applied default
configuration commands.
CPE Router
In this type of configurations router is configured as wireless client device. WAN interface
is Wireless interface. WAN port has configured DHCP client, is protected by IP firewall and MAC
discovery/connection is disabled.
List of routers using this type of configuration:
AP Router
This type of configuration is applied to home access point routers to be used straight out of the box
without additional configuration (except router passwords and wireless keys)
First Ethernet is always configured as WAN port (protected by firewall, enabled DHCP client and
disabled MAC connection/discovery). Other Ethernet ports and wireless interfaces are added to local
LAN bridge with 192.168.88.1/24 address set and configured DHCP server. In case of dual band routers,
one wireless is configured as 5 GHz access point and other as 2.4 GHz access point.
List of routers using this type of configuration:
RB 450,751,850,951,953,2011,3011
hEX,PowerBox
mAP
wAP,wAP R (without LTE card)
hAP
OmniTIK
CRS series with wireless interface
PTP Bridge
Bridged ethernet with wireless interface. Default IP address 192.168.88.1/24 is set on the bridge
interface. There are two possible options - as CPE and as AP. For CPE wireless interface is set in
"station-bridge" mode, for AP "bridge" mode is used.
List of routers using this type of configuration:
DynaDish - as CPE
Wireless Wire kit
wAP 60G - with level3 license
WISP Bridge
Configuration is the same as PTP Bridge in AP mode, except that wireless mode is set to ap_bridge for
PTMP setups. Router can be accessed directly using MAC address. If device is connected to the network
with enabled DHCP server, configured DHCP client configured on the bridge interface will get the IP
address, that can be used to access the router.
List of routers using this type of configuration:
Switch
This configuration utilizes switch chip features to configure dumb switch. All ethernet ports are added to
switch group and default IP address 192.168.88.1/24 is set on master port.
List of routers using this type of configuration:
FiberBox
CRS without wireless interface
IP Only
When no specific configuration is found, IP address 192.168.88.1/24 is set on ether1, or combo1, or
sfp1.
List of routers using this type of configuration:
RB 411,433,435,493,800,M11,M33,1100
CCR
CAP
This type of configuration is used when device need to be used as wireless client device controlled by
CAPsMAN.
When CAP default configuration is loaded, ether1 is considered a management port with DHCP client
configured. All other Ethernet interfaces are bridged and wlan1 is set to be managed by CAPsMAN.
To load CAP configuration refer to Reset Button manual.
Main Page
Recent changes
Tools
What links here
Related changes
Special pages
Printable version
Permanent link
Page information
This page was last edited on 31 January 2018, at 14:25.
Privacy policy
Disclaimers
Manual:System/Packages
< Manual:System
Contents
[hide]
1Summary
2Acquiring packages
3RouterOS packages
4Working with packages
5Examples
o 5.1List available packages
o 5.2Uninstall package
o 5.3Disable package
o 5.4Downgrade
o 5.5Cancel uninstall or disable action
Summary
RouterOS supports a lot of different features and since every installation requires specific set
of features supprted it is possible to add or remove certain groups of features using package
system. As result user is able to control what features are available and size of installation.
Packages are provided only by MikroTik and no 3rd parties are allowed to make them.
Acquiring packages
Packages can be downloaded from MikroTik download page or mirrors listed on that page.
Either of provided download methods can be used.
RouterOS packages
For a simple home router, only the system package is needed for basic operation. Other
packages are optional. The DHCP package might be the next most important, if your ISP
provides IP addresses using this method. PPP is needed if you require PPPoE or PPTP for
connectivity. Other packages are not required for a home router, and are completely optional.
Install them only if you are sure of their purpose.
Package Features
advanced- Advanced ping tools (flood-ping, ping-speed), Netwatch, ip-scan, SMS tool, Wake-
tools (mipsle, on-LAN
mipsbe, ppc, x86,
mmips, arm)
calea (mipsle, Data gathering tool for specific use due to "Communications Assistance for Law
mipsbe, ppc, x86, Enforcement Act" in USA
mmips, arm)
multicast (mipsle, Protocol Independent Multicast - Sparse Mode; Internet Group Managing Protoco
mipsbe, ppc, x86, l - Proxy
mmips, arm)
ntp (mipsle, Network protocol server, also includes simplistic client. NTP client is also built into
mipsbe, ppc, x86, the system package and functions well without this package installed.
mmips, arm)
ppp (mipsle, MlPPP client, PPP, PPTP, L2TP, PPPoE, ISDN PPP clients and servers
mipsbe, ppc, x86,
mmips, arm)
routing (mipsle, dynamic routing protocols like RIP, BGP, OSPF and routing utilities like BFD, filters
mipsbe, ppc, x86, for routes.
mmips, arm)
system (mipsle, basic router features like static routing, ip addresses, sNTP, telnet, API,
mipsbe, ppc, x86, queues, firewall, web proxy, DNS cache, TFTP, IP pool, SNMP, packet sniffer, e-
mmips, arm) mail send tool, graphing, bandwidth-test,
torch, EoIP, IPIP, bridging, VLAN, VRRP etc.). Also, for RouterBOARD platform
- MetaROUTER | Virtualization
user- MikroTik User Manager server for controlling Hotspot and other service users.
manager (mipsle,
mipsbe, ppc, x86,
mmips, arm)
wireless (mipsle, wireless interface support. Sometimes sub-types are released, for
mipsbe, ppc, x86, example wireless-fp introduced FastPath support, wireless-cm2 introduced
mmips, arm) CAPsMAN v2 and wireless-rep introduced Repeater mode. These packages are
occasionally released separately, before the new features get merged into the
main wireless package.
lcd (x86) LCD panel support for serial/parallel port devices. Not needed for RouterBOARD
LCD panels.
routeros- combined package for mipsle (RB100, RB500) (includes system, hotspot, wireless,
mipsle (mipsle) ppp, security, mpls, advanced-tools, dhcp, routerboard, ipv6, routing)
routeros- combined package for smips (hAP mini, hAP lite) (includes system, hotspot,
smips (smips) wireless, ppp, security, mpls, advanced-tools, dhcp, routerboard, ipv6, routing)
routeros- combined package for mipsbe (RB400) (includes system, hotspot, wireless, ppp,
mipsbe (mipsbe) security, mpls, advanced-tools, dhcp, routerboard, ipv6, routing)
routeros- combined package for powerpc (RB300, RB600, RB1000) (includes system,
powerpc (ppc) hotspot, wireless, ppp, security, mpls, advanced-tools, dhcp, routerboard, ipv6,
routing)
routeros-x86 (x86) combined package for x86 (Intel/AMD PC, RB230) (includes system, hotspot,
wireless, ppp, security, mpls, advanced-tools, dhcp, routerboard, ipv6, routing)
routeros- combined package for multicore mips (Mxx, RB750v3) (includes system, hotspot,
mmips (mmips) wireless, ppp, security, mpls, advanced-tools, dhcp, routerboard, ipv6, routing)
routeros- combined package for arm (cAP ac, hAP ac², CRS3xx, RB3011, RB1100AHx4, etc)
arm (arm) (includes system, hotspot, wireless, ppp, security, mpls, advanced-tools, dhcp,
routerboard, ipv6, routing)
Command Desciption
disable schedule the package to be disabled after the next reboot. No features provided by the
package will be accessible
downgrade will prompt for the reboot. During the reboot process will try to downgrade the
RouterOS to the oldest version possible by checking the packages that are uploaded to
the router.
print outputs information about the packages, like: version, package state, planned state
changes etc.
uninstall schedule package to be removed from the router. That will take place during the reboot.
Examples
Upgrade process is described here.
List available packages
Disable package
Downgrade
Manual:Upgrading RouterOS
It is suggested to always keep your RouterOS installation up to date, MikroTik always keeps
adding new functionality and improving performance and stability by releasing updates.
Contents
[hide]
1Automatic upgrade
2RouterOS version release chains
3Manual upgrade methods
4Upgrade process
o 4.1Using Winbox
o 4.2Using FTP
5RouterOS massive auto-upgrade
o 5.1RouterOS auto-upgrade
o 5.2The Dude auto-upgrade
o 5.3The Dude hierarchical upgrade
6License issues
7Version numbering
8Suggestions
Automatic upgrade
The automatic upgrade feature connects to the MikroTik download servers, and checks if there
is a new RouterOS version for your device. If yes, a changelog is displayed, and Upgrade
button is shown. Clicking the upgrade button, software packages are automatically
downloaded, and device will be rebooted. Even if you have a custom set of packages installed,
only the correct packages will be downloaded.
Note: If you are running v5.25 or older, the system will only auto-upgrade to the most recent
version of the v5 major version release and not up to v6.20. Manual upgrade is needed in this
case.
Bugfixed-only version is the most stable release without new features, just most important
fixes. Updated rarely, only when a critical issue is found in a bugfixes-only release.
Current includes the same fixes plus improvements and new features. Once a current
release has been tested for several months, it is promoted to bugfix-only and is no longer
updated with features.
Release candidate released a few times per week. Includes newest features, released
without intensive testing. Not recommended for production.
Note: RouterOS cannot be upgraded through serial cable. Using this method
only RouterBOOT can be upgraded.
Upgrade process
First step - visit www.mikrotik.com and head to the download page, there choose the type
of system you have the RouterOS installed on.
Download the Combined package, it will include all the functionality of RouterOS:
Using Winbox
Choose your system type, and download the upgrade package:
Connect to your router with Winbox, Select the downloaded file with your mouse, and drag it to
the Files menu. If there are some files already present, make sure to put the package in
the root menu, not inside the hotspot folder!:
The upload will start:
After it finishes - REBOOT and that's all! The New version number will be seen in the
Winbox Title and in the Packages menu
Using FTP
Open your favourite FTP program (in this case it is Filezilla), select the package and
upload it to your router (demo2.mt.lv is the address of my router in this example). note that
in the image I'm uploading many packages, but in your case - you will have one file that
contains them all
if you wish, you can check if the file is successfully transferred onto the router (optional):
after the reboot, your router will be up to date, you can check it in this menu:
if your router did not upgrade correctly, make sure you check the log
RouterOS version 6 has new auto upgrade option. RouterOS checks amazon servers for
information if new version is available and upgrades after upgrade command is executed. You
can automate the upgrade process by running a script in the scheduler:
After v6.31:
Older options
Until v6.31:
Add upgrade router (192.168.100.1) information to a router that you want to update
(192.168.100.253), required settings IP address/Username/Password
Click on Refresh to see available packages, download newest packages and reboot the
router to finalize the upgrade.
The Dude auto-upgrade
Dude application can help you to upgrade entire RouterOS network with one click per router.
Set type RouterOS and correct password for any device on your Dude map, that you want
to upgrade automatically,
Upload required RouterOS packages to Dude files,
Upgrade RouterOS version on devices from RouterOS list. Upgrade process is automatic,
after click on upgrade (or force upgrade), package will be uploaded and router will be
rebooted by the Dude automatically.
The Dude hierarchical upgrade
For complicated networks, when routers are connected sequentially, the simplest example is
1router-2router-3router connection. You might get an issue, 2router will go to reboot before
packages are uploaded to the 3router. The solution is Dude groups, the feature allows to group
routers and upgrade all of them by one click!
License issues
When upgrading from older versions, there could be issues with your license key. Possible
scenarios:
When upgrading from RouterOS v2.8 or older, the system might complain about expired
upgrade time. To override this, use Netinstall to upgrade. Netinstall will ignore old license
restriction and will upgrade
When upgrading to RouterOS v4 or newer, the system will ask you to update license to a
new format. To do this, ensure your Winbox PC (not the router) has a working internet
connection without any restrictions to reach www.mikrotik.com and click "update license" in
the license menu.
Version numbering
RouterOS versions are numbered sequentially, when a period is used to separate sequences,
it does not represent a decimal point, and the sequences do not have positional significance.
An identifier of 2.5, for instance, is not "two and a half" or "half way to version three", it is the
fifth second-level revision of the second first-level revision. Therefore v5.2 is older than v5.18,
which is newer.
Suggestions
When using a RouterBOARD device, it is always suggested to upgrade it's RouterBOOT
bootloader after RouterOS is upgraded. To do this, issue the command "/system routerboard
upgrade"
anual:CD Install
Contents
[hide]
CD Install Description
CD-Install allows to install MikroTik RouterOS to x86 boxes, which do not support Netinstall (all
the RouterBOARDs should be reinstalled with Netinstall).
Note: RouterOS installation will erase all data on your HDD, it will only work as the only
operating system in your PC. Remove any drives that you don't want to be erased
CD Install Requirements
Router
x86 box with hard drive
CD-ROM
Additional PC
CD-ROM
CD burning application
MikroTik RouterOS CD installation ISO image
CD Install Example
Prepare MikroTik RouterOS CD Installation Disk
1. Download CD installation Image from MikroTik download page,
2. Burn ISO image to disk, you need PC with CD-ROM and application to write ISO files to CD.
For Linux (the latest Ubuntu release) you can use built-in application. Mouse right-click on
the .iso file and specify 'Write to Disk'. You got MikroTik RouterOS installation disk after
process is finished.
Router Preconfiguration
3. Switch on the x86 box, where you want to install MikroTik RouterOS, it should be with CD-
ROM as well. Put MikroTik RouterOS installation disk to CD-ROM and set to boot from CD-
ROM in BIOS settings,
4. x86 will boot from MikroTik RouterOS installation disk and should offer you to select the
RouterOS Packages to install,
Package Selection
5. Select the packages you want to install, it is possible to select all packages with a or
minimum with m, then Press i to install the RouterOS.
Installation
6. If you have previous installation of the RouterOS and want to reset the configuration, then
answer no for the question 'Do you want to keep old configuration ?' and click y to proceed,
7. You will the process of the packages installation. Router will ask for the reboot after
installation is finished,
10. The last of the installation to license the router, use the software-id to purchase
the license,
Manual:Netinstall
Contents
[hide]
1Introduction
2How to use Netinstall
3Properties
Introduction
Netinstall is a tool designed for Windows operating systems to reinstall MikroTik devices
running RouterOS (except for non-MikroTik x86 devices). Netinstall re-formats the device's
disk and copies over fresh files on to the system's disk, this can solve multiple issues when
your device is not working properly. Always try using Netinstall if you suspect that your device
is not working properly.
Warning: Netinstall re-formats the system's drive, all configuration and saved files will be lost.
Netinstall does not erase the RouterOS license key, nor does it reset RouterBOOT related
settings, for example, CPU frequency is not changed after reinstalling the device.
Note: You must choose a version for the Netinstall. If you are not sure, then you can always
select the version that is marked as Current.
Note: You must choose a RouterOS version. You can always select the version that is marked
as Current. You must also select the architecture (ARM, MIPS, SMIPS, TILE, etc...), but if you
are not sure, then you can download the RouterOS package for ALL architectures, Netinstall
will choose the right architecture for you.
Disconnect your computer from WiFi, Ethernet, LTE or any other type of connections!
Warning: Netinstall will only work on one active interface on your computer, it is highly
recommended that you disconnect any other network interfaces in order to be sure that
Netinstall will select the right network interface.
Configure a static IP address for your Ethernet interface, open Start and select Settings:
Note: Netinstall can run also on a local network, in such case you could skip setting a static IP
address, but it is highly recommended that you set a static IP address if you are not familiar
with Netinstall.
Open your Downloads folder (or wherever you saved the downloaded files) and extract
the Netinstall .zip file to a convenient place
Extract the files
Run Netinstall.exe
Note: If you followed the guide precisely, then you should not have any Internet connection on
your computer, Windows 10 wants to verify all apps that it runs, but will not be able to do it
since lack of the Internet connection, for this reason a warning might pop up, you should
click Run.
Warning: Netinstall requires administrator rights, there should be a window asking for
permissions to run Netinstall, you must accept these permissions in order for Netinstall to work
properly.
Wait for the device to show up in Netinstall, select it and press Browse...
Note: If the device does not show up in this window, then you can try closing the Netinstall
application and opening it up again or try to put the device into Etherboot mode again.
Navigate to your Downloads folder (or wherever you saved your RouterOS packages) and
press OK
Select your desired RouterOS version and press Install
Note: If you downloaded RouterOS packages for multiple architectures, then Netinstall will only
show the appropriate architecture packages for your device after you have selected it. All
unsupported packages will not show up in this window after you have selected a device.
Wait for the installation to finish and press "Reboot"
Note: If the installation does not start (progress bar is not moving or no status is shown), then
you can try closing the Netinstall application and opening it up again or try to put the device
into Etherboot mode again.
You are done! Remove the device from power, remove the Ethernet cable, place the
device back in your network and your device should be running properly now!
Note: After using Netinstall the device will be reset to defaults (unless you specified not to
apply default configuration). Some devices are not accessible through ether1 port with the
default configuration for security reasons. Read more about Default configuration.
Properties
Property
Routers/Drives list of system drives on which RouterO
drive, the drive is going to be formatte
Make floppy used to create a bootable 1.44" floppy
Net booting (yes | no; Default: no) Used to enable PXE booting on your n
properly.
Install/Cancel After selecting the router or drive and
SoftID (Ready-only) The Software-ID that belongs to the ro
Key (use previous key | browse | get key; Default: use previous key) Specify the licence key for your Route
does not have a license) by selecting B
selecting Get key, or leave it blank t
Flashfig Launches the Flashfig utility, which ca
Keep old configuration (yes | no; Default: no) Keeps the configuration that was on th
IP address/Netmask (IP address/Netmask; Default: ) If set, then Netinstall will apply the sp
Gateway (IP address; Default: ) If set, then Netinstall will apply the sp
Baud rate (integer; Default: 115200) If set, then Netinstall will apply the sp
Apply default config (yes | no; Default: no) Applies default configuration on the d
set, then the default configuration will
Configure script (yes | no; Default: no) If set, then Netinstall will apply a custo
the export command. The configuratio
the default configuration. Resetting the
selecting Apply default config
Manual:Configuration Management
Applies to RouterOS:ALL
Contents
[hide]
1Summary
2Description
3System Backup
o 3.1Description
o 3.2Encryption
o 3.3Example
4Exporting Configuration
o 4.1Command Description
o 4.2Example
o 4.3Compact Export
5Importing Configuration
o 5.1Command Description
o 5.2Automatic Import
o 5.3Example
6Configuration Reset
o 6.1Description
o 6.2Command Description
o 6.3Example
7Import troubleshooting
o 7.1Configuration parts to watch out for in exported .rsc files
o 7.2Startup delay
Summary
This manual introduces you with commands which are used to perform the following functions:
system backup;
system restore from a backup;
configuration export;
configuration import;
system configuration reset.
Description
The configuration backup can be used for backing up MikroTik RouterOS configuration to a
binary file, which can be stored on the router or downloaded from it using FTP for future use.
The configuration restore can be used for restoring the router's configuration, exactly as it was
at the backup creation moment, from a backup file. The restoration procedure assumes the
cofiguration is restored on the same router, where the backup file was originally created, so it
will create partially broken configuration if the hardware has been changed.
The configuration export can be used for dumping out complete or partial MikroTik RouterOS
configuration to the console screen or to a text (script) file, which can be downloaded from the
router using FTP protocol. The configuration dumped is actually a batch of commands that add
(without removing the existing configuration) the selected configuration to a router. The
configuration import facility executes a batch of console commands from a script file.
System reset command is used to erase all configuration on the router. Before doing that, it
might be useful to backup the router's configuration.
System Backup
Submenu level: /system backup
Description
The backup save command is used to store the entire router configuration in a backup file.
The file is shown in the /file submenu. It can be downloaded via ftp to keep it as a backup for
your configuration.
Important! The backup file contains sensitive information, do not store your backup files inside
the router's Files directory, instead, download them, and keep them in a secure location.
Warning: If TheDude and user-manager is installed on the router then backup will not take
care of configuration used by these tools. Therefore additional care should be taken to save
configuration from these. Use provided tool mechanisms to save/export configuration if you
want to save it.
Exporting Configuration
Command name: /export
The export command prints a script that can be used to restore configuration. The command
can be invoked at any menu level, and it acts for that menu level and all menu levels below it.
The output can be saved into a file, available for download using FTP.
Command Description
Compact Export
Starting from v5.12 compact export was added. It allows to export only part of configuration
that is not default RouterOS config.
Note: Starting from v6rc1 "export compact" is default behavior. To do old style export
use export verbose
Compact export introduces another feature that indicates which part of config is default on
RouterOS and cannot be deleted. As in example below '*' indicates that this OSPF instance is
part of default configuration.
/ipv6 nd "all"
Configuration Reset
Command name: /system reset-configuration
Description
The command clears all configuration of the router and sets it to the default including the login
name and password ('admin' and no password), IP addresses and other configuration is
erased, interfaces will become disabled. After the reset command router will reboot. The
default is either the factory default, that you can see in the article Default configurations, or it
can be a custom default, that can be loaded by including an RSC file when doing Netinstall or if
specified with a branding package.
Command Description
Warning: If the router has been installed using netinstall and had a script specified as the
initial configuration, the reset command executes this script after purging the configuration. To
stop it doing so, you will have to reinstall the router.
Example
Import troubleshooting
Configuration parts to watch out for in exported .rsc files
Things that should be removed from export files that were created with: "/export", before
attempting import on new device.
/interface ethernet
set [ find default-name=ether5 ] auto-negotiation=no name=ether1-
gateway
set [ find default-name=ether6 ] name=ether2
set [ find default-name=ether7 ] name=ether3
set [ find default-name=ether8 ] name=ether4
set [ find default-name=ether1 ] name=ether5
set [ find default-name=ether2 ] name=ether6
set [ find default-name=ether3 ] name=ether7
set [ find default-name=ether4 ] name=ether8
In older version exports default entries might show with "add" instead of "set" command.
That should be edited before import to avoid errors.
Check if interface/module: ether/wlan/modem/com/etc count match on new and old device.
If there will some missing that will end up in error during .rsc import.
In case of problematic import, attempt the following:
Reset the configuration on that device.
Run import command again with "verbose=yes" argument. It will stop also stop import
process on problem which you already encountered, but will also show place where export
failed. That way showing you place where things need to be edited in .rsc import file
Startup delay
If your configuration relies on interfaces that might not yet have started up upon command
execution, it is suggested to introduce delays, or to monitor until all needed interfaces are
available. This example script allows you to set how many interfaces you are expecting, and
how long to wait until they become available:
{
:local i 0
#Number of interfaces
:local x 10
#Max time to wait
:local t 30
while ($i < $t && [:len [/interface find]] < $x) do={
:put $i
:set $i ($i + 1)
:delay 1
}
if ($i = $t) do={
:log warning message="Could not load all physical interfaces"
} else={
#Rest of your script
}
}
The above script will wait until there are 10 interfaces visible, or 30 seconds. If there are no 10
interfaces in this time, it will put a message in the log. Modify the variables according to your
needs.
Manual:Console
Contents
[hide]
1Overview
2Hierarchy
o 2.1Example
3Item Names and Numbers
o 3.1Item Names
o 3.2Item Numbers
4Quick Typing
5General Commands
6Modes
7List of keys
o 7.1Built-in Help
o 7.2Safe Mode
o 7.3HotLock Mode
o 7.4Quick Help menu
8See also
Overview
The console is used for accessing the MikroTik Router's configuration and management
features using text terminals, either remotely using serial port, telnet, SSH or console screen
within Winbox, or directly using monitor and keyboard. The console is also used for writing
scripts. This manual describes the general console operation principles. Please consult the
Scripting Manual on some advanced console commands and on how to write scripts.
Hierarchy
The console allows configuration of the router's settings using text commands. Since there is a
lot of available commands, they are split into groups organized in a way of hierarchical menu
levels. The name of a menu level reflects the configuration information accessible in the
relevant section, eg. /ip hotspot.
Example
For example, you can issue the /ip route print command:
Notice that the prompt changes in order to reflect where you are located in the menu hierarchy
at the moment. To move to the top level again, type " / "
[admin@MikroTik] ip route> ..
[admin@MikroTik] ip>
You can also use / and .. to execute commands from other menu levels without changing the
current level:
Warning: Do not use Item numbers in scripts, it is not reliable way to edit items in scheduler.
scripts, etc. Instead use find command. More info here also look at scripting examples.
Quick Typing
There are two features in the console that help entering commands much quicker and easier -
the [Tab] key completions, and abbreviations of command names. Completions work similarly
to the bash shell in UNIX. If you press the [Tab] key after a part of a word, console tries to find
the command within the current context that begins with this word. If there is only one match, it
is automatically appended, followed by a space:
/inte[Tab]_ becomes /interface _
If there is more than one match, but they all have a common beginning, which is longer than
that what you have typed, then the word is completed to this common part, and no space is
appended:
/interface set e[Tab]_ becomes /interface set ether_
If you've typed just the common part, pressing the tab key once has no effect. However,
pressing it for the second time shows all possible completions in compact form:
The [Tab] key can be used almost in any context where the console might have a clue about
possible values - command names, argument names, arguments that have only several
possible values (like names of items in some lists or name of protocol in firewall and NAT
rules). You cannot complete numbers, IP addresses and similar values.
Another way to press fewer keys while typing is to abbreviate command and argument names.
You can type only beginning of command name, and, if it is not ambiguous, console will accept
it as a full name. So typing:
equals to:
It is possible to complete not only beginning, but also any distinctive substring of a name: if
there is no exact match, console starts looking for words that have string being completed as
first letters of a multiple word name, or that simply contain letters of this string in the same
order. If single such word is found, it is completed at cursor position. For example:
General Commands
There are some commands that are common to nearly all menu levels, namely: print, set,
remove, add, find, get, export, enable, disable, comment, move. These commands have
similar behavior throughout different menu levels.
add - this command usually has all the same arguments as set, except the item number
argument. It adds a new item with the values you have specified, usually at the end of the
item list, in places where the order of items is relevant. There are some required properties
that you have to supply, such as the interface for a new address, while other properties are
set to defaults unless you explicitly specify them.
Common Parameters
copy-from - Copies an existing item. It takes default values of new item's
properties from another item. If you do not want to make exact copy, you can
specify new values for some properties. When copying items that have names,
you will usually have to give a new name to a copy
place-before - places a new item before an existing item with specified position.
Thus, you do not need to use the move command after adding an item to the list
disabled - controls disabled/enabled state of the newly added item(-s)
comment - holds the description of a newly created item
Return Values
add command returns internal number of item it has added
edit - this command is associated with the set command. It can be used to edit values of
properties that contain large amount of text, such as scripts, but it works with all editable
properties. Depending on the capabilities of the terminal, either a fullscreen editor, or a
single line editor is launched to edit the value of the specified property.
find - The find command has the same arguments as set, plus the flag arguments
like disabled or active that take values yes or no depending on the value of respective flag.
To see all flags and their names, look at the top of print command's output.
The find command returns internal numbers of all items that have the same values of
arguments as specified.
move - changes the order of items in list.
Parameters
first argument specifies the item(-s) being moved.
second argument specifies the item before which to place all items being moved
(they are placed at the end of the list if the second argument is omitted).
print - shows all information that's accessible from particular command level.
Thus, /system clock print shows system date and time, /ip route print shows all routes
etc. If there's a list of items in current level and they are not read-only, i.e. you can
change/remove them (example of read-only item list is /system history, which shows
history of executed actions), then print command also assigns numbers that are used by all
commands that operate with items in this list.
Common Parameters
from - show only specified items, in the same order in which they are given.
where - show only items that match specified criteria. The syntax
of where property is similar to the find command.
brief - forces the print command to use tabular output form
detail - forces the print command to use property=value output form
count-only - shows the number of items
file - prints the contents of the specific submenu into a file on the router.
interval - updates the output from the print command for every interval seconds.
oid - prints the OID value for properties that are accessible from SNMP
without-paging - prints the output without stopping after each screenful.
remove - removes specified item(-s) from a list.
set - allows you to change values of general parameters or item parameters. The set
command has arguments with names corresponding to values you can change. Use ? or
double [Tab] to see list of all arguments. If there is a list of items in this command level,
then set has one action argument that accepts the number of item (or list of numbers) you
wish to set up. This command does not return anything.
Modes
Console line editor works either in multiline mode or in single line mode. In multiline mode line
editor displays complete input line, even if it is longer than single terminal line. It also uses full
screen editor for editing large text values, such as scripts. In single line mode only one terminal
line is used for line editing, and long lines are shown truncated around the cursor. Full screen
editor is not used in this mode.
Choice of modes depends on detected terminal capabilities.
List of keys
Control-C
keyboard interrupt.
Control-D
log out (if input line is empty)
Control-K
clear from cursor to the end of line
Control-X
toggle safe mode
Control-V
toggle hotlock mode mode
F6
toggle cellar
F1 or ?
show context sensitive help. If the previous character is \, then inserts literal ?.
Tab
perform line completion. When pressed second time, show possible completions.
Delete
remove character at cursor
Control-H or Backspace
remove character before cursor and move cursor back one position.
Control-\
split line at cursor. Insert newline at cursor position. Display second of the two resulting
lines.
Control-B or Left
move cursor backwards one character
Control-F or Right
move cursor forward one character
Control-P or Up
go to previous line. If this is the first line of input then recall previous input from history.
Control-N or Down
go to next line. If this is the last line of input then recall next input from history.
Control-A or Home
move cursor to the beginning of the line. If cursor is already at the beginning of the line,
then go to the beginning of the first line of current input.
Control-E or End
move cursor to the end of line. If cursor is already at the end of line, then move it to the
end of the last line of current input.
Control-L or F5
reset terminal and repaint screen.
up, down and split
keys leave cursor at
the end of line.
Built-in Help
The console has a
built-in help, which
can be accessed by
typing ?. General
rule is that help
shows what you can
type in position
where the ? was
pressed (similarly to
pressing [Tab] key
twice, but in verbose
form and with
explanations).
Safe Mode
It is sometimes
possible to change
router configuration
in a way that will
make the router
inaccessible (except
from local console).
Usually this is done
by accident, but
there is no way to
undo last change
when connection to
router is already cut.
Safe mode can be
used to minimize
such risk.
Safe mode is
entered by
pressing [CTRL]+[X
]. To save changes
and quit safe mode,
press [CTRL]+[X] a
gain. To exit without
saving the made
changes,
hit [CTRL]+[D]
[admin@MikroT
ik] ip
route>[CTRL]+
[X]
[Safe Mode
taken]
[admin@MikroT
ik] ip
route<SAFE>
Message Safe
Mode taken is
displayed and
prompt changes to
reflect that session
is now in safe mode.
All configuration
changes that are
made (also from
other login
sessions), while
router is in safe
mode, are
automatically
undone if safe mode
session terminates
abnormally. You can
see all such
changes that will be
automatically
undone tagged with
an F flag in system
history:
[admin@MikroT
ik] ip route>
[Safe Mode
taken]
[admin@MikroT
ik] ip
route<SAFE>
add
[admin@MikroT
ik] ip
route<SAFE>
/system
history print
Flags: U -
undoable, R -
redoable, F -
floating-undo
ACTION
BY
POLICY
F route added
admin
write
Now, if telnet
connection (or
winbox terminal) is
cut, then after a
while (TCP timeout
is 9 minutes) all
changes that were
made while in safe
mode will be
undone. Exiting
session
by [Ctrl]+[D] also
undoes all safe
mode changes,
while /quit does not.
If another user tries
to enter safe mode,
he's given following
message:
[admin@MikroT
ik] >
Hijacking
Safe Mode
from someone
-
unroll/releas
e/don't take
it [u/r/d]:
[admin@MikroT
ik] ip
firewall rule
input
[Safe
mode released
by another
user]
[d] - leaves
everything as-is.
If too many changes
are made while in
safe mode, and
there's no room in
history to hold them
all (currently history
keeps up to 100
most recent
actions), then
session is
automatically put
out of the safe
mode, no changes
are automatically
undone. Thus, it is
best to change
configuration in
small steps, while in
safe mode. Pressing
[Ctrl]+[X] twice is an
easy way to empty
safe mode action
list.
HotLock Mode
When HotLock
mode is enabled
commands will be
auto completed.
To enter/exit
HotLock mode
press [CTRL]+[V].
[admin@MikroT
ik] /ip
address>
[CTRL]+[V]
[admin@MikroT
ik] /ip
address>>
Double >> is
indication that
HotLock mode is
enabled. For
example if you
type /in e , it will
be auto completed
to
[admin@MikroT
ik] /ip
address>>
/interface
ethernet
Quick Help
menu
F6 key enables
menu at the bottom
of the terminal which
shows common key
combinations and
their usage.
[admin@RB493G
] >
tab compl ?
F1 help ^V
hotlk ^X safe
^C brk ^D
quit
Line editor
There is currently no text in this page. You can search for this page title in other pages,
or search the related logs, but you do not have permission to create this page.
Prompt
There is currently no text in this page. You can search for this page title in other pages,
or search the related logs, but you do not have permission to create this page.
Manual:Winbox
Contents
[hide]
1Summary
2Starting Winbox
o 2.1IPv6 connectivity
3Run Winbox on macOS
o 3.1Wine bottler
o 3.2Homebrew
4Interface Overview
5Work Area and child windows
o 5.1Child window menu bar
o 5.2Sorting out displayed items
o 5.3Customizing list of displayed columns
5.3.1Detail mode
5.3.2Category view
o 5.4Drag & Drop
o 5.5Traffic monitoring
o 5.6Item copy
6Transferring Settings
7Troubleshooting
8Legacy version manual
Summary
Winbox is a small utility that allows administration of MikroTik RouterOS using a fast and
simple GUI. It is a native Win32 binary, but can be run on Linux and MacOS (OSX) using
Wine. All Winbox interface functions are as close as possible mirroring the console functions,
that is why there are no Winbox sections in the manual. Some of advanced and system critical
configurations are not possible from winbox, like MAC address change on an interface Winbox
changelog
From Winbox v3.14, the following security features are used:
Starting Winbox
Winbox loader can be downloaded from the mikrotik download page. When winbox.exe is
downloaded, double click on it and winbox loader window will pop up:
To connect to the router enter IP or MAC address of the router, specify username and
password (if any) and click on Connect button. You can also enter the port number after the IP
address, separating them with a colon, like this 192.168.88.1:9999. The port can be changed in
RouterOS services menu.
Note: It is recommended to use IP address whenever possible. MAC session uses network
broadcasts and is not 100% reliable.
You can also use neighbor discovery, to list available routers use Neighbors tab:
From list of discovered routers you can click on IP or MAC address column to connect to that
router. If you click on IP address then IP will be used to connect, but if you click on MAC
Address then MAC address will be used to connect to the router.
Note: Neighbor discovery will show also devices which are not compatible with Winbox, like
Cisco routers or any other device that uses CDP (Cisco Discovery Protocol). If you will try to
connect to SwOS device, then connection will be established through web browser
Simple mode:
-- Buttons/check-boxes
Warning: Managed routers list is encrypted, but it can still be loaded in other winbox without
problems IF the master password is not set for it!
It is possible to use command line to pass connect to, user and password parameters
automatically:
Will connect to router D4:CA:6D:E1:B5:7D through 10.5.101.1 RoMON Agent with user
"admin" without password.
IPv6 connectivity
Winbox supports IPv6 connectivity. To connect to the routers IPv6 address, it must be placed
in square braces the same as in web browsers when connecting to IPv6 server. Example:
Winbox neighbor discovery is now capable of discovering IPv6 enabled routers. As you can
see from the image below, there are two entries for each IPv6 enabled router, one entry is with
IPv4 address and another one with IPv6 link-local address. You can easily choose to which
one you want to connect:
Run Winbox on macOS
Wine bottler
It is possible to use Winbox in Apple macOS operating system by using Wine emulation
software. For easier use it can be combined with WineBottler software to create a more
convenient executable.
Homebrew
If the bottled version does not work, you can use Homebrew to install Wine and then launch
the regular Winbox.exe file from our download page
Requirements:
1. Xcode latest version. If you have Xcode 9-beta, delete Xcode 8 first, then rename the
Beta to "Xcode".
2. Homebrew
Then just follow these steps:
If you'd like to create a launcher in MacOS, to avoid launching Wine from the Terminal, you
can do it with Automator and save the result as a service or as an app. This is an example
setup:
Interface Overview
Winbox interface has been designed to be intuitive for most of the users. Interface consists of:
Main toolbar at the top where users can add various info fields, like CPU and memory
usage.
Menu bar on the left - list of all available menus and sub-menus. This list changes
depending on what packages are installed. For example if IPv6 package is disabled,
then IPv6 menu and all it's sub-menus will not be displayed.
Work area - area where all menu windows are opened.
Title bar shows information to identify with which router Winbox session is opened. Information
is displayed in following format:
From screenshot above we can see that user krisjanis is logged into router with IPv4/IPv6
address [fe80::4e5e:cff:fef6:c0ab%3]. Router's ID is 3C18-Krisjanis_GW, currently installed
RouterOS version is v6.36rc6, RouterBoard is CCR1036-12G-4S and platform is tile.
On the Main toolbar's left side is located undo and redo buttons to quickly undo any changes
made to configuration. On the right side is located:
winbox traffic indicator displayed as a green bar,
indicator that shows whether winbox session uses encryption
Child windows can not be dragged out of working area. Notice in screenshot above
that Interface window is dragged out of visible working area and horizontal scroll bar appeared
at the bottom. If any window is outside visible work area boundaries the vertical or/and
horizontal scrollbars will appear.
Child window menu bar
Each child window has its own toolbar. Most of the windows have the same set of toolbar
buttons:
Add - add new item to the list
Enable - enable selected item (the same as enable command from console)
Disable - disable selected item (the same as disable command from console)
Sort - allows to sort out items depending on various parameters. Read more >>
Almost all windows have quick search input field at the right side of the toolbar. Any text
entered in this field is searched through all the items and highlighted as illustrated in
screenshot below
Notice that at the right side next to quick find input filed there is a dropdown box. For currently
opened (IP Route) window this dropdown box allows to quickly sort out items by routing tables.
For example if main is selected, then only routes from main routing table will be listed.
Similar dropdown box is also in all firewall windows to quickly sort out rules by chains.
Sorting out displayed items
Almost every window has a Sort button. When clicking on this button several options appear
as illustrated in screenshot below
Example shows how to quickly filter out routes that are in 10.0.0.0/8 range
Click on little arrow button (1) on the right side of the column titles or right mouse click
on the route list.
From popped up menu move to Show Columns (2) and from the sub-menu pick
desired column, in our case click on BGP AS Path (3)
Changes made to window layout are saved and next time when winbox is opened the same
column order and size is applied.
Detail mode
It is also possible to enable Detail mode. In this mode all parameters are displayed in
columns, first column is parameter name, second column is parameter's value.
To enable detail mode right mouse click on the item list and from the popupmenu pick Detail
mode
Category view
It is possible to list items by categories. In tis mode all items will be grouped alphabetically or
by other category. For example items may be categorized alphabetically if sorted by name,
items can also be categorized by type like in screenshot below.
To enable Category view, right mouse click on the item list and from the popupmenu
pick Show Categories
Drag & Drop
It is possible to upload and download files to/from router using winbox drag & drop
functionality. You can also download file by pressing right mouse button on it and selecting
"Download".
Note: Drag & Drop does not work if winbox is running on Linux using wine. This is not a winbox
problem, wine does not support drag & drop.
Traffic monitoring
Winbox can be used as a tool to monitor traffic of every interface, queue or firewall rule in real-
time. Screenshot below shows ethernet traffic monitoring graphs.
Item copy
This shows how easy it is to copy an item in Winbox. In this example, we will use the COPY
button to make a Dynamic PPPoE server interface into a Static interface.
This image shows us the initial state, as you see DR indicates "D" which means Dynamic:
Double-Click on the interface and click on COPY:
A new interface window will appear, a new name will be created automatically (in this case
pppoe-in1)
After this Down/Up event this interface will be Static:
Transferring Settings
Managed router transfer - In File menu, use Save As and Open functions to save managed
router list to file and open it up again on new workstation.
Router sessions transfer - In Tools menu, use Export and Import functions to save existing
sessions to file and import them again on new workstation.
Troubleshooting
Winbox cannot connect to router's IP address
Make sure that Windows firewall is set to allow Winbox connections or disable windows
firewall.
I get an error '(port 20561) timed out' when connecting to routers mac address
Windows (7/8) does not allow mac connection if file and print sharing is disabled.
1Summary
2Connecting to Router
o 2.1IPv6 Connectivity
o 2.2Enable HTTPS
3Interface Overview
o 3.1Item configuration
4Work with Files
5Traffic Monitoring
6Skins
o 6.1Designing skins
6.1.1Configure wireless interface
o 6.2Status page
6.2.1Addition of fields
6.2.2Two columns
o 6.3Skin design examples
6.3.1Set field
o 6.4Using skins
Summary
WebFig is a web based RouterOS utility which allows you to monitor, configure and
troubleshoot the router. It is designed as an alternative of WinBox, both have similar layouts
and both have access to almost any feature of RouterOS.
WebFig is accessible directly from the router which means that there is no need to install
additional software (except web browser with JavaScript support, of course).
As Webfig is platform independent, it can be used to configure router directly from various
mobile devices without need of a software developed for specific platform.
Some of the tasks that you can perform with WebFig:
Connecting to Router
WebFig can be launched from the routers home page which is accessible by entering routers
IP address in the browser. When home page is successfully loaded, choose webfig from the
list of available icons as illustrated in screenshot.
After clicking on webfig icon, login prompt will ask you to enter username and password. Enter
login information and click connect.
Now you should be able to see webfig in action.
IPv6 Connectivity
RouterOS http service now listens on ipv6 address, too. To connect to IPv6, in your browser
enter ipv6 address in square brackets, for example [2001:db8:1::4]. If it is required to connect
to link local address, don't forget to specify interface name or interface id on windows, for
example [fe80::9f94:9396%ether1].
Enable HTTPS
By default access to the router using HTTPS is disabled, but it can be enabled if you have a
valid certificate. In case you don't have a valid certificate, you can generate your own using
RouterOS. To generate your own certificates and enable HTTPS access, you must first login to
the router by using Webfig (HTTP version or you can use Winbox, SSH or Telnet), open a new
terminal and input the following commands:
/certificate
add name=LocalCA common-name=LocalCA key-usage=key-cert-sign,crl-sign
/certificate
sign LocalCA
Note: In case you already have set up your own CA or you are using a service that signs
certificates for you, then you create and sign the certificate remotely and import the certificate
on the router later. In case you are importing a certificate, then make sure you mark the
certificate as trusted.
/certificate
add name=Webfig common-name=192.168.88.1
Note: Most browsers will throw out an invalid certificate error if the common name for the
certificate does not match the address you are visiting, for this reason you can specify the
router's IP address as the common name since you will be using the IP address to open up
Webfig.
/certificate
sign Webfig ca=LocalCA
Note: It is not required to set the certificate as trusted if you created your own root CA on the
same router since by default RouterOS will trust its own generated root CA and therefore will
trust all certificates signed by it, including the newly created certificate for Webfig.
Enable www-ssl and specify to use the newly created certificate for Webfig
/ip service
set www-ssl certificate=Webfig disabled=no
You can now visit https://192.168.88.1 and securely configure your router.
Note: By default browsers will not trust self-signed certificates, you will need to add the
certificate as trusted on the first time you visit the page in your browser. Another approach is to
export the root CA certificate and import it as a trusted root certificate on your computer, this
way all certificates signed by this router will be considered as valid and will make it easier to
manage certificates in your network.
Interface Overview
WebFig interface is designed to be very intuitive especially for WinBox users. It has very
similar layout: menu bar on the left side, undo/redo at the top and work are at the rest of
available space.
When connected to router, browsers title bar (tab name on Chrome) displays currently opened
menu, user name used to authenticate, ip address, system identity, ROS version and
RouterBOARD model in following format:
[menu] at [username]@[Router's IP] ( [RouterID] ) - Webfig [ROS
version] on [RB model] ([platform])
Menu bar has almost the same design as WinBox menu bar. Little arrow on the right side of
the menu item indicates that this menu has several sub-menus.
When clicking on such menu item, sub-menus will be listed and the arrow will be pointing
down, indicating that sub-menus are listed.
At the top you can see three common buttons Undo/Redo buttons similar to winbox and one
additional button Log Out. In the top right corner, you can see WebFig logo and
RouterBOARDS model name.
Work area has tab design, where you can switch between several configuration tabs, for
example in screenshot there are listed all tabs available in Bridge menu (Bridge, Ports, Filters,
NAT, Rules).
Below the tabs are listed buttons for all menu specific commands, for example Add
New and Settings.
The last part is table of all menu items. First column of an item has item specific command
buttons:
Status bar similar to winbox shows current status of item specific flags (e.g running flag). Grey-
ed out flag means that it is not active. In example screenshot you can see that running is in
solid black and slave is grey-ed, which means that interface is running and is not a slave
interface.
List of properties is divided in several sections, for example "General", "STP", "Status",
"Traffic". In winbox these sections are located in separate tabs, but webfig lists them all in one
page specifying section name. In screenshotyou can see "General" section. Grey-edout
properties mean that they are read-only and configuration is not possible.
Files also can be easily downloaded from the router, by clicking Download button at the right
side of the file entry.
Traffic Monitoring
Template:TODO
[ Top | Back to Content ]
Skins
Webfig skins is handy tool to make interface more user friendly. It is not a security tool. If user
has sufficient rights it is possible to access hidden features by other means.
Designing skins
If user has sufficient permissions (group has policy edit permissions) Design Skin button
becomes available. Pressing that toggle button will open interface editing options. Possible
operations are:
Hide menu - this will hide all items from menu and its submenus;
Hide submenu - only certain submenu will be hidden
Hide tabs - if submenu details have several tabs, it is possible to hide them this way;
Rename menus, items - make some certain features more obvious or translate them into
your launguage;
Add note to to item (in detail view) - to add comments on filed;
Make item read-only (in detail view) - for user safety very sensitive fields can be made read
only
Hide flags (in detail view) - while it is only possible to hide flag in detail view, this flag will
not be visible in list view and in detailed view;
Add limits for field - (in detail view) where it is list of times that are comma or newline
separated list of allowed values:
number interval '..' example: 1..10 will allow values from 1 to 10 for fiels with numbers,
example, MTU size.
field prefix (Text fields, MAC address, set fields, combo-boxes). If it is required to limit
prefix length $ should be added to the end, for example, limiting wireless interface to
"station" only will contain
Add Tab - will add grey ribbon with editable label that will separate the fields. Ribbon will
be added before field it is added to;
Add Separator - will add low height horizontal separator before the field it is added to.
Note: Number interval cannot be set to extend limitations set by RouterOS for that field
Note: Set fields are argument that consist of set of check-boxes, for example, setting up
policies for user groups, RADIUS "Service"
Note: Limitations set for combo-boxes will values selectable from dropdown
Note: Starting RouterOS 5.7 webfig interface adds capability for users to create status page
where fields from anywhere can be added and arranged.
Satus page can be created by users (with sufficient permissions) and fields on the page can be
reordered.
When status page is created it is default page that opens when logging in the router through
webfig interface.
Addition of fields
To add field to status page user has to enter "Design skin" mode and from drop-down menu at
the field choose option - "Add to status page"
As the result of this action desired field in read-only mode will be added to status page. If at the
time Status page is not present at the time, it will be created for the user automatically.
Two columns
Fields in Status page can be arranged in two columns. Columns are filled from top to bottom.
When you have only one column then first item intended for second should be dragged to the
top of the first item when black line appear on top of the first item, then drag mouse to the left
until shorter black line is displayed as showed in screenshot. Releasing mouse button will
create second column. Rest of the fields afterwards can be dragged and dropped same way as
with one column design.
Skin design examples
Set field
Setting limits for set
field
And the
result:
Using skins
To use skins you have to assign skin to group, when that is done users of that group will
automatically use selected skin as their default when logging into Webfig.
Manual:Quickset
Applies to RouterOS:v5.15+
Contents
[hide]
1Summary
2Modes
3HomeAP
o 3.1Wireless
o 3.2Internet
o 3.3Local Network
o 3.4VPN
o 3.5System
4F.A.Q
Summary
Quickset is a simple configuration wizard page that prepares your router in a few clicks. It is
the first screen a user sees, when opening the default IP address 192.168.88.1 in a web
browser.
Quickset is available for all devices that have some sort of default configuration from factory.
Devices that do not have configuration must be configured by hand. The most popular and
recommended mode is the HomeAP (or HomeAP dual, depending on the device). This
Quickset mode provides the simplest of terminology and the most common options for the
home user.
Modes
Depending on the router model, different Quickset modes might be available from the Quickset
dropdown menu:
HomeAP
This is the mode you should use if you would like to quickly configure a home access point.
Wireless
Network Name: How will your smartphone see your network? Set any name you like here.
In HomeAP dual, you can set the 2GHz (legacy) and 5GHz (modern) networks to the
same, or different names (see FAQ). Use any name you like, in any format.
Frequency: Normally you can leave "Auto", in this way, the router will scan the
environment, and select the least occupied frequency channel (it will do this once). Use a
custom selection if you need to experiment.
Band: Normally leave this to defaults (2GHz b/g/n and 5GHz A/N/AC).
Use Access List (ACL): Enable this if you would like to restrict who can connect to your
AP, based on the users MAC (hardware) address. To use this option, first you need to
allow these clients to connect, and then use the below button "Copy to ACL". This will copy
the selected client to the access list. After you have build an Access list (ACL), you can
enable this option to forbid anyone else to attempt connections to your device. Normally
you can leave this alone, as the Wireless password already provides the needed
restrictions.
WiFi Password: The most important option here. Sets a secure password that also
encrypts your wireless communications.
WPS accept: Use this button to grant access to a specific device that supports the WPS
connection mode. Useful for printers and other peripherals where typing a password is
difficult. First start WPS mode in your client device, then once click the WPS button here to
allow said device. Button works for a few seconds and operates on a per-client basis.
Guest network: Useful for house guests who don't need to know your main WiFi
password. Set a separate password for them in this option. Important! Guest users will not
be able to access other devices in your LAN and other guest devices. This mode enabled
Bridge filters to prevent this.
Wireless clients: This table shows the currently connected client devices (their MAC
address, if they are in your Access List, their last used IP address, how long are they
connected, their signal level in dBm and in a bar graph).
Internet
Port: Select which port is connected to the ISP (internet) modem. Usually Eth1.
Address Acquisition: Select how the ISP is giving you the IP address. Ask your service
provider about this and the other options (IP address, Netmask, Gateway).
MAC address: Normally should not be changed, unless your ISP has locked you to a
specific MAC address and you have changed the router to a new one.
Firewall router: This enables secure firewall for your router and your network. Always
make sure this box is selected, so that no access is possible to your devices from the
internet port.
MAC server / MAC Winbox: Allows connection with the [Winbox utility http://mt.lv/winbox]
from the LAN port side in MAC address mode. Useful for debugging and recovery, when IP
mode is not available. Advanced use only.
Discovery: Allows the device to be identified by model name from other RouterOS
devices.
Local Network
IP address: Mostly can stay at the default 192.168.88.1 unless your router is behind
another router. To avoid IP conflict, change to 192.168.89.1 or similar
Netmask: In most situations can leave 255.255.255.0
Bridge all LAN ports: Allows your devices to communicate to each other, even if, say,
your TV is connected via ethernet LAN cable, but your PC is connected via WiFi.
DHCP server: Normally, you would want automatic IP address configuration in your home
network, so leave the DHCP settings ON and on their defaults.
NAT: Turn this off ONLY if your ISP has provided a public IP address for both the router
and also the local network. If not, leave NAT on.
UPnP: This option enables automatic port forwarding ("opening ports to the local network"
as some call it) for supported programs and devices, like your NAS disks and peer-to-peer
utilities. Use with care, as this option can sometimes expose internal devices to the internet
without your knowledge. Enable only if specifically needed.
VPN
If you want to access your local network (and your router) from the internet, use a secure VPN
tunnel. This option gives you a domain name where to connect to, and enables PPTP and
L2TP/IPsec (the second one is recommended). The username is 'vpn' and you can specify
your own password. All you need to do is enable it here, and then provide the address,
username and password in your laptop or phone, and when connected to the VPN, you will
have a securely encrypted connection to your home network. Also useful when travelling - you
will be able to browse the internet through a secure line, as if connecting from your home. This
also helps to avoid geographical restrictions that are set up in some countries.
System
Check for updates: Always make sure your device is up to date with this button. Checks if
an updated RouterOS release is available, and installs it.
Password: Sets the password for the device config page itself. Make sure nobody can
access your router config page and change the settings.
F.A.Q
How is Quickset different from the Webfig tab, where a whole bunch of new menus
appear?
If you need more options, do not use any Quickset settings at all, click on "Webfig" to
open the advanced configuration interface. The full functionality is unlocked.
Can I use Quickset and Webfig together?
While settings that are not conflicting can be configured this way, it is not
recommended to mix up these menus. If you are going to use Quickset, use only
Quickset and vice versa.
What's is difference between Router and Bridge mode?
Bridge mode adds all interfaces to the bridge allowing to forward Layer2 packets (acts
as a hub/switch).
In Router mode packets are forwarded in Layer3 by using IP addresses and IP routes
(acts as a router).
In HomeAP mode, should the 2GHz and 5GHz network names be the
same, or different?
If you prefer that all your client devices, like TV, phones, game consoles, would
automatically select the best preferred network, set the names identically. If you would
like to force a client device to use the faster 5GHz 802.11ac connection, set the names
unique.
Manual:CAPsMAN
Contents
[hide]
1Overview
2CAPsMAN v2
3Requirements
4Limitations
5CAP to CAPsMAN Connection
o 5.1CAP Auto Locking to CAPsMAN
o 5.2Auto Certificates
6CAP Configuration
7CAPsMAN Configuration Concepts
8CAPsMAN Global Configuration
9Radio Provisioning
10Interface Configuration
11Master Configuration Profiles
12Channel Groups
13Datapath Configuration
14Local Forwarding Mode
15Manager Forwarding Mode
16Access List
17Registration Table
18Examples
o 18.1Basic configuration with master and slave interface
o 18.2Configuration with certificates
18.2.1Fast and easy configuration
18.2.2Manual certificates and issuing with SCEP
Overview
Controlled Access Point system Manager (CAPsMAN) allows centralization of wireless network
management and if necessary, data processing. 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 and optionally, data forwarding.
When a CAP is controlled by CAPsMAN it only requires the minimum configuration required to
allow it to establish connection with CAPsMAN. Functions that were conventionally executed
by an AP (like access control, client authentication) are now executed by CAPsMAN. The CAP
device now only has to provide the wireless link layer encryption/decryption.
Depending on configuration, data is either forwarded to CAPsMAN for centralized processing
(default) or forwarded locally at the CAP itself (#Local_Forwarding_Mode).
CAPsMAN features
Nstreme AP support
Nv2 AP support
TBA
CAPsMAN v2
NOTE: CAPsMAN v2 is NOT compatible with current CAPsMAN v1 (CAPsMAN v1 CAP
devices will not be able to connect to CAPsMAN v2 and CAPsMAN v2 CAP devices will not be
able to connect to CAPsMAN v1). It means that both CAPsMAN and CAP devices should have
wireless-cm2 package enabled/installed in order to make CAPsMAN v2 system to work.
If you want to try out the CAPsMAN v2 upgrade all the CAPs and the CAPsMAN to latest
RouterOS version and enable/install wireless-cm2 package.
CAPsMAN v2 features:
Requirements
CAPsMAN works on any RouterOS device from v6.11, wireless interfaces are not required
(since it manages the wireless interfaces of CAPs)
CAPsMAN v2 is working starting from RouterOS v6.22rc7.
CAP device should have at least Level4 RouterOS license
Limitations
unlimited CAPs (access points) supported by CAPsMAN
32 Radios per CAP
32 Virtual interfaces per master radio interface
Once CAP connects to suitable CAPsMAN and locks to it, it is reflected like this:
From now on CAP will only connect to CAPsMAN with this CommonName, until locking
requirement is cleared, by setting lock-to-caps-man=no. This approach needs to be used if it
is necessary to force CAP to lock to another CAPsMAN - by at first setting lock-to-caps-
man=no followed by lock-to-caps-man=yes.
Note that CAP can be manually "locked" to CAPsMAN by setting caps-man-certificate-
common-names.
Auto Certificates
To simplify CAPsMAN and CAP configuration when certificates are required (e.g. for automatic
locking feature), CAPsMAN can be configured to generate necessary certificates automatically
and CAP can be configured to request certificate from CAPsMAN.
Automatic certificates do not provide full public key infrastructure and are provided for
simple setups. If more complicated PKI is necessary - supporting proper certificate validity
periods, multiple-level CA certificates, certificate renewal - other means must be used, such as
manual certificate distribution or SCEP.
CAPsMAN has the following certificate settings:
certificate - this is CAPsMAN certificate, private key must be available for this certificate. If
set to none, CAPsMAN will operate in no-certificate mode and none of certificate requiring
features will work. If set to auto, CAPsMAN will attempt to issue certificate to itself using
CA certificate (see ca-certificate description). Note that CommonName automatically
issued certificate will be "CAPsMAN-<mac address>" and validity period for will be the
same as for CA certificate.
ca-certificate - this is CA certificate that CAPsMAN will use when issuing certificate for
itself if necessary (see certificate description) and when signing certificate requests from
CAPs. If set to none, CAPsMAN will not be able to issue certificate to itself or sign
certificate requests from CAPs. If set to auto, CAPsMAN will generate self-signed CA
certificate to use as CA certificate. CommonName for this certificate will take form
"CAPsMAN-CA-<mac address>" and validity period will be from jan/01/1970 until
jan/18/2038.
When CAPsMAN will auto-generate certificates, this will be reflected like this:
And certificates:
CAP can be configured to request certificate from CAPsMAN. In order for this to work, CAP
must be configured with setting certificate=request and CAPsMAN must have CA certificate
available (either specified in ca-certificate setting or auto-generated).
CAP will initially generate private key and certificate request with CommonName of form "CAP-
<mac address>". When CAP will establish connection with CAPsMAN, CAP will request
CAPsMAN to sign its certificate request. If this will succeed, CAPsMAN will send CA certificate
and newly issued certificate to CAP. CAP will import these certificates in its certificate store:
CAP Configuration
When an AP is configured to be controlled by CAPsMAN, configuration of the managed
wireless interfaces on the AP is ignored (exceptions: antenna-gain,antenna-mode). Instead, AP
accepts configuration for the managed interfaces from CAPsMAN.
Note: The CAP wireless interfaces that are managed by CAPsMAN and whose traffic is being
forwarded to CAPsMAN (ie. they are not in local forwarding mode), are shown as disabled,
with the note Managed by CAPsMAN. Those interfaces that are in local forwarding mode
(traffic is locally managed by CAP, and only management is done by CAPsMAN) are not
shown disabled, but the note Managed by CAPsMAN is shown
CAP behaviour of AP is configured in /interface wireless cap menu. It contains the following
settings:
Property
enabled (yes | no; Default: no) Disable or enable CAP fea
interfaces (list of interfaces; Default: empty) List of wireless interfaces
certificate (certificate name | none; Default: none) Certificate to use for authe
discovery-interfaces (list of interfaces; Default: empty) List of interfaces over whi
caps-man-addresses (list of IP addresses; Default: empty) List of Manager IP addres
caps-man-names (list of allowed CAPs Manager names; Default: empty) List of Manager names tha
caps-man-certificate-common-names (list of allowed CAPs Manager CommonNames; List of Manager certificate
Default: empty)
bridge (bridge interface; Default: none) Bridge to which interfaces
static-virtual (Static Virtual Interface; Default: no) CAP will create Static Vir
address will be the same. N
random between those inte
interface passphrase
interface->security passphrase
interface->configuration passphrase
interface->configuration->security passphrase
There are 2 types of interfaces on CAPsMAN - "master" and "slave". The master interface
holds the configuration for an actual wireless interface (radio), while a slave interface links to
the master interface and is intended to hold the configuration for a Virtual-AP (multiple SSID
support). There are settings that are meaningful only for master interface, i.e. mainly hardware
setup related settings such as radio channel settings. Note that in order for a radio to accept
clients, it's master interface needs to be enabled. Slave interfaces will become operational only
if enabled and the master interface is enabled.
Interfaces on CAPsMAN can be static or dynamic. Static interfaces are stored in RouterOS
configuration and will persist across reboots. Dynamic interfaces exist only while a particular
CAP is connected to CAPsMAN.
Radio Provisioning
CAPsMAN distinguishes between CAPs based on an identifier. The identifier is generated
based on the following rules:
if CAP provided a certificate, identifier is set to the Common Name field in the certificate
otherwise identifier is based on Base-MAC provided by CAP in the form:
'[XX:XX:XX:XX:XX:XX]'.
When the DTLS connection with CAP is successfully established (which means that CAP
identifier is known and valid), CAPsMAN makes sure there is no stale connection with CAP
using the same identifier. Currently connected CAPs are listed in /caps-man remote-
cap menu:
CAPsMAN distinguishes between actual wireless interfaces (radios) based on their builtin MAC
address (radio-mac). This implies that it is impossible to manage two radios with the same
MAC address on one CAPsMAN. Radios currently managed by CAPsMAN (provided by
connected CAPs) are listed in /caps-man radio menu:
When CAP connects, CAPsMAN at first tries to bind each CAP radio to CAPsMAN master
interface based on radio-mac. If an appropriate interface is found, radio gets set up using
master interface configuration and configuration of slave interfaces that refer to particular
master interface. At this moment interfaces (both master and slaves) are considered bound to
radio and radio is considered provisioned.
If no matching master interface for radio is found, CAPsMAN executes 'provisioning rules'.
Provisioning rules is an ordered list of rules that contain settings that specify which radio to
match and settings that specify what action to take if a radio matches.
Provisioning rules for matching radios are configured in /caps-man provisioning menu:
Property
action (create-disabled | create-enabled | create-dynamic-enabled | none; Default: none) Action to take if rule matc
create-disabled - crea
operational until the in
create-enabled - crea
create-dynamic-enab
operational;
none - do nothing, lea
comment (string; Default: ) Short description of the Pr
common-name-regexp (string; Default: ) Regular expression to mat
hw-supported-modes (a|a-turbo|ac|an|b|g|g-turbo|gn; Default: ) Match radios by supported
identity-regexp (string; Default: ) Regular expression to mat
ip-address-ranges (IpAddressRange[,IpAddressRanges] max 100x; Default: "") Match CAPs with IPs with
master-configuration (string; Default: ) If action specifies to creat
name-format (cap | identity | prefix | prefix-identity; Default: cap) specify the syntax of the C
Note: If no rule matches radio, then implicit default rule with action create-enabled and no
configurations set is executed.
For user's convenience there are commands that allow the re-execution of the provisioning
process for some radio or all radios provided by some AP:
and
Interface Configuration
CAPsMAN interfaces are managed in /caps-man interface menu:
Channel Groups
Channel group settings allows for the configuration of lists of radio channel related settings,
such as radio band, frequency, Tx Power extension channel and width.
Channel group settings are configured in the Channels profile menu /caps-man channels
Property
band (2ghz-b | 2ghz-b/g | 2ghz-b/g/n | 2ghz-onlyg | 2ghz-onlyn | 5ghz-a | 5ghz-a/n | 5ghz- Define operational radio fr
onlyn; Default: )
comment (string; Default: ) Short description of the Ch
extension-channel (Ce | Ceee | eC | eCee | eeCe | eeeC | disabled; Default: ) Extension channel configu
frequency (integer [0..4294967295]; Default: ) Channel frequency value i
name (string; Default: ) Descriptive name for the C
tx-power (integer [-30..40]; Default: ) Set TX Power for Card (in
width (; Default: ) Sets Channel Width in MH
save-selected (; Default: yes) Saves selected channel for
optimize is done for this C
Datapath Configuration
Datapath settings control data forwarding related aspects. On CAPsMAN datapath settings are
configured in datapath profile menu /caps-man datapath or directly in a configuration profile or
interface menu as settings with datapath. prefix.
There are 2 major forwarding modes:
local forwarding mode, where CAP is locally forwarding data to and from wireless interface
manager forwarding mode, where CAP sends to CAPsMAN all data received over wireless
and only sends out the wireless data received from CAPsMAN. In this mode even client-to-
client forwarding is controlled and performed by CAPsMAN.
Forwarding mode is configured on a per-interface basis - so if one CAP provides 2 radio
interfaces, one can be configured to operate in local forwarding mode and the other in
manager forwarding mode. The same applies to Virtual-AP interfaces - each can have different
forwarding mode from master interface or other Virtual-AP interfaces.
Most of the datapath settings are used only when in manager forwarding mode, because in
local forwarding mode CAPsMAN does not have control over data forwarding.
There are the following datapath settings:
bridge -- bridge interface to add interface to, as a bridge port, when enabled
bridge-cost -- bridge port cost to use when adding as bridge port
bridge-horizon -- bridge horizon to use when adding as bridge port
client-to-client-forwarding -- controls if client-to-client forwarding between wireless clients
connected to interface should be allowed, in local forwarding mode this function is
performed by CAP, otherwise it is performed by CAPsMAN.
local-forwarding -- controls forwarding mode
openflow-switch -- OpenFlow switch to add interface to, as port when enabled
vlan-id -- VLAN ID to assign to interface if vlan-mode enables use of VLAN tagging
vlan-mode -- VLAN tagging mode specifies if VLAN tag should be assigned to interface
(causes all received data to get tagged with VLAN tag and allows interface to only send out
data tagged with given tag)
Virtual-AP interfaces in local forwarding mode will appear as enabled and dynamic Virtual-AP
interfaces:
[admin@CAP] /interface> pr
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE MTU L2MTU MAX-
L2MTU
...
2 RS ;;; managed by CAPsMAN
;;; channel: 5180/20-Ceee/ac, SSID: master, local forwarding
wlan2 wlan 1500 1600
3 DRS ;;; managed by CAPsMAN
;;; SSID: slave, local forwarding
wlan6 wlan 1500 1600
...
[admin@CAP] /interface> wireless pr
Flags: X - disabled, R - running
...
2 R ;;; managed by CAPsMAN
;;; SSID: slave, local forwarding
name="wlan6" mtu=1500 mac-address=00:00:00:00:00:00 arp=enabled
interface-type=virtual-AP master-interface=wlan2
The fact that Virtual-AP interfaces are added as dynamic, somewhat limits static configuration
possibilities on CAP for data forwarding, such as assigning addresses to Virtual-AP interface.
This does not apply to master wireless interface.
To overcome this it is possible to use the static-virtual setting on the CAP which will create
Static Virtual Interfaces instead of Dynamic and 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. If two or more static interfaces will have the same MAC
address the configuration could be applied in random order.
To facilitate data forwarding configuration, CAP can be configured with bridge to which
interfaces are automatically added as ports when interfaces are enabled by CAPsMAN. This
can be done in /interface wireless capmenu.
...
1 X ;;; managed by CAPsMAN
;;; channel: 5180/20-Ceee/ac, SSID: master, manager forwarding
name="wlan2" mtu=1500 mac-address=00:03:7F:48:CC:07 arp=enabled
interface-type=Atheros AR9888 mode=ap-bridge ssid="merlin"
...
Virtual-AP interfaces are also created as 'disabled' and do not take part in data forwarding on
CAP.
Access List
Access list on CAPsMAN is an ordered list of rules that is used to allow/deny clients to connect
to any CAP under CAPsMAN control. When client attempts to connect to a CAP that is
controlled by CAPsMAN, CAP forwards that request to CAPsMAN. As a part of registration
process, CAPsMAN consults access list to determine if client should be allowed to connect.
The default behaviour of the access list is to allow connection.
Access list rules are processed one by one until matching rule is found. Then the action in the
matching rule is executed. If action specifies that client should be accepted, client is accepted,
potentially overriding it's default connection parameters with ones specified in access list rule.
Access list is configured in /caps-man access-list menu. There are the following parameters
for access list rules:
Registration Table
Registration table contains a list of clients that are connected to radios controlled by CAPsMAN
and is available in /caps-man registration-table menu:
[admin@CM] /caps-man> registration-table print
# INTERFACE MAC-ADDRESS UPTIME
RX-SIGNAL
0 cap1 00:03:7F:48:CC:0B 1h38m9s210ms
-36
Examples
Basic configuration with master and slave interface
Create security profile for WPA2 PSK, without specifying passphrase:
Create provisioning rule that matches any radio and creates dynamic interfaces using master-
cfg and slave-cfg:
Now when AP connects and is provisioned 2 dynamic interfaces (one master and one slave)
will get created:
[admin@CM] /caps-man interface> print detail
Flags: M - master, D - dynamic, B - bound, X - disabled, I - inactive,
R - running
0 MDB name="cap1" mtu=1500 l2mtu=2300 radio-mac=00:0C:42:1B:4E:F5
master-interface=none
configuration=master-cfg
Consider an AP, that does not support configured frequency connects and can not become
operational:
We can override channel settings for this particular radio in interface settings, without affecting
master-cfg profile:
Allow Specific MAC address range to match the Access-list, for example, match all the Apple
devices:
Configuring DHCP Server Option 138 for setting the CAPsMAN address on the CAP boards
/caps-man manager
set ca-certificate=auto certificate=auto
Print output:
CAPsMAN device first will generate CA-Certificate and then it will generate Certificate which
depends on CA-Certificate.
CAP device:
Set in CAP configuration to request certificate:
CAP will connect to CAPsMAN and request certificate. CAP will receive CA-Certificate form
CAPsMAN and another certificate will be created for use on CAP.
In Result
On CAP device in CAP menu Requested Certificate is set:
[admin@CAP] /interface wireless cap print
enabled: yes
interfaces: wlan1
certificate: request
lock-to-caps-man: no
discovery-interfaces: ether1
caps-man-addresses:
caps-man-names:
caps-man-certificate-common-names:
bridge: none
static-virtual: no
--> requested-certificate: CAP-D4CA6D7F45BA <--
Also, two certificates are gained and are seen in Certificate menu:
On CAPsMAN device in Certificate menu three certificates are created. CAPsMAN and
CAPsMAN-CA certificates, as well as a certificate which is issued to CAP:
/caps-man manager
set require-peer-certificate=yes
However, when you will want to add new CAP devices to your CAPsMAN network you will
have to set this option to no and then back to yes after CAP has gained certificates. Every time
you change this option CAPsMAN will drop all dynamic interfaces and CAPs will try to connect
again.
If you want to lock CAP to specific CAPsMAN and be sure it won't connect to other CAPsMANs
you should set option Lock To CAPsMAN to yes. Additionally, you can specify CAPsMAN to
lock to by setting CAPsMAN Certificate Common Names on CAP device:
/certificate
add name=CA-temp common-name=CA
add name=CAPsMAN-temp common-name=CAPsMAN
Now Sign the certifiace templates. First Sign the CA certificate and use CAPsMAN device IP
as CA CRL Host:
/certificate
sign CA-temp ca-crl-host=10.5.138.157 name=CA
sign CAPsMAN-temp ca=CA name=CAPsMAN
Alternatively, previous two steps can be done with auto setting in Certificate and CA-
Certificate option in CAPsMAN Manager menu, see the Fast and easy configuration.
Export CA certificate. You will have to Import it on CAP device. You can use Download ->
Drag&Drop to CAP device, in this example fetch command is used later from CAP device.
Using long passphrase is advisable - longer passphrase will take longer to crack if it gets into
the wrong hands:
/certificate
export-certificate CA export-passphrase=thelongerthebetterpassphrase
Create SCEP server which will be used to issue and grant certificates to CAP devices:
/certificate scep-server
add ca-cert=CA path=/scep/CAPsMAN
Set certificates in CAPsMAN Manager menu and set Require Peer Certificate to yes:
/caps-man manager
set ca-certificate=CA certificate=CAPsMAN
set require-peer-certificate=yes
At this point, only CAPs with a valid certificate will be able to connect.
CAP device
Download export of CA certificate from CAPsMAN device to CAP device. In this
example fetch is used, however, there are multiple other ways:
/certificate
add name=CAP1 common-name=CAP1
Ask CAPsMAN device to grant this certificate with a key using SCEP:
/certificate
add-scep template=CAP1 scep-url="http://10.5.138.157/scep/CAPsMAN"
You will have to return to CAPsMAN device to grant key to this certificate.
In CAP menu set just created certificate:
CAPsMAN device:
Return to CAPsMAN device to grant a key to CAP certificate in Certificate Request menu:
In Result
Now CAP should be able to connect to CAPsMAN, see in CAPsMAN interfaces if it connects.
In CAPsMAN device Certificate menu three certificates can be seen: CA, CAPsMAN, and the
one which is issued to CAP:
Manual:Loop Protect
Applies to RouterOS:v6.37+
Loop Protect
Loop protect feature can prevent Layer2 loops by sending loop protect protocol packets and
shutting down interfaces in case they receive loop protect packets originated from themself.
The feature works by checking source MAC address of received loop protect packet against
MAC addresses of loop protect enabled interfaces. If the match is found, loop protect disables
the interface which received the loop protect packet. Log message warns about this event and
interface is marked with a loop protect comment by system. RouterOS loop protect feature can
be used on bridged interfaces as well as on ethernet interfaces which are set for switching in
RouterBoard switch chips.
Loop protect works on ethernet, vlan, eoip and eoipv6 interfaces. It supports adjusting loop
protect packet sending interval and interface disable time. Configuration changes or expiration
of disable time resets loop protection on interface.
Properties
Property
loop-protect (on | off | default; Default: default) Enables or disables loop p
loop-protect-send-interval (time interval; Default: 5s) Sets how often loop protec
loop-protect-disable-time (time interval | 0; Default: 5m) Sets how long selected int
Read-only properties
Property
loop-protect-status (on | off | disable) on - loop-protect feat
off - loop-protect fea
disable - loop-prot
Manual:Interface/VLAN
< Manual:Interface
Contents
[hide]
1Summary
2802.1Q
3Q-in-Q
4Properties
5Setup examples
o 5.1Layer2 VLAN examples
5.1.1Port based VLAN tagging #1 (Trunk and Access ports)
5.1.2Port based VLAN tagging #2 (Trunk and Hybrid ports)
o 5.2Layer3 VLAN examples
5.2.1Simple VLAN routing
5.2.2InterVLAN routing
o 5.3RouterOS /32 and IP unnumbered addresses
Summary
Sub-menu: /interface vlan
Standards: IEEE 802.1Q
Virtual Local Area Network (VLAN) is a Layer 2 method that allows multiple Virtual LANs on a
single physical interface (ethernet, wireless, etc.), giving the ability to segregate LANs
efficiently.
You can use MikroTik RouterOS (as well as Cisco IOS, Linux and other router systems) to
mark these packets as well as to accept and route marked ones.
As VLAN works on OSI Layer 2, it can be used just as any other network interface without any
restrictions. VLAN successfully passes through regular Ethernet bridges.
You can also transport VLANs over wireless links and put multiple VLAN interfaces on a single
wireless interface. Note that as VLAN is not a full tunnel protocol (i.e., it does not have
additional fields to transport MAC addresses of sender and recipient), the same limitation
applies to bridging over VLAN as to bridging plain wireless interfaces. In other words, while
wireless clients may participate in VLANs put on wireless interfaces, it is not possible to have
VLAN put on a wireless interface in station mode bridged with any other interface.
802.1Q
The most commonly used protocol for Virtual LANs (VLANs) is IEEE 802.1Q. It is a
standardized encapsulation protocol that defines how to insert a four-byte VLAN identifier into
Ethernet header. (see Figure 12.1.)
Each VLAN is treated as a separate subnet. It means that by default, a host in a specific VLAN
cannot communicate with a host that is a member of another VLAN, although they are
connected in the same switch. So if you want inter-VLAN communication you need a router.
RouterOS supports up to 4095 VLAN interfaces, each with a unique VLAN ID, per interface.
VLAN priorities may also be used and manipulated.
When the VLAN extends over more than one switch, the inter-switch link has to become a
'trunk', where packets are tagged to indicate which VLAN they belong to. A trunk carries the
traffic of multiple VLANs; it is like a point-to-point link that carries tagged packets between
switches or between a switch and router.
Note: The IEEE 802.1Q standard has reserved VLAN IDs with special use cases, the following
VLAN IDs should not be used in generic VLAN setups: 0, 1, 4095
Q-in-Q
Original 802.1Q allows only one vlan header, Q-in-Q on the other hand allows two or more vlan
headers. In RouterOS Q-in-Q can be configured by adding one vlan interface over another.
Example:
/interface vlan
add name=vlan1 vlan-id=11 interface=ether1
add name=vlan2 vlan-id=12 interface=vlan1
If any packet is sent over 'vlan2' interface, two vlan tags will be added to ethernet header - '11'
and '12'.
Properties
Property
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) Address Resolution Protoc
Note: MTU should be set to 1500 bytes same as on Ethernet interfaces. But this may not work
with some Ethernet cards that do not support receiving/transmitting of full size Ethernet
packets with VLAN header added (1500 bytes data + 4 bytes VLAN header + 14 bytes
Ethernet header). In this situation MTU 1496 can be used, but note that this will cause packet
fragmentation if larger packets have to be sent over interface. At the same time remember that
MTU 1496 may cause problems if path MTU discovery is not working properly between source
and destination.
Setup examples
VLANs on Mikrotik environment are also described here: VLANs with bridging
Warning: These configurations are known to cause issues with other vendor devices,
especially in STP enabled network, you should use bridge VLAN filtering instead in case you
are using RouterOS v6.41 or newer. You can read more about this Here.
Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
Add necessary VLAN interfaces on ethernet interfaces to make them as VLAN trunk ports
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
R4:
[admin@MikroTik] ip address>
R4:
[admin@MikroTik] ip address>
At this point it should be possible to ping router R4 from router R2 and vice versa:
To make sure if VLAN setup is working properly, try to ping R1 from R2. If pings are timing out
then VLANs are successfully isolated.
"From R2 to R1:"
InterVLAN routing
If separate VLANs are implemented on a switch, then a router is required to provide
communication between VLANs. Switch works at OSI layer 2 so it uses only Ethernet header
to forward and does not check IP header. For this reason we must use the router that is
working as a gateway for each VLAN. Without a router, a host is unable to communicate
outside of its own VLAN. Routing process between VLANs described above is called inter-
VLAN communication.
To illustrate inter-VLAN communication, we will create a trunk that will carry traffic from three
VLANs (VLAN2 and VLAN3, VLAN4) across a single link between a Mikrotik router and a
manageable switch that supports VLAN
trunking.
Each VLAN has its own separate subnet (broadcast domain) as we see in figure above:
VLAN 2 – 10.10.20.0/24;
VLAN 3 – 10.10.30.0/24;
VLAN 4 – 10.10.40.0./24.
VLAN configuration on most switches is straightforward, basically we need to define which
ports are members of the VLANs and define a 'trunk' port that can carry tagged frames
between the switch and the router.
"Configuration example on MikroTik router:"
"Create VLAN interfaces:"
/interface vlan
add name=VLAN2 vlan-id=2 interface=ether1 disabled=no
add name=VLAN3 vlan-id=3 interface=ether1 disabled=no
add name=VLAN4 vlan-id=4 interface=ether1 disabled=no
/ip address
add address=10.10.20.1/24 interface=VLAN2
add address=10.10.30.1/24 interface=VLAN3
add address=10.10.40.1/24 interface=VLAN4
RouterOS /32 and IP unnumbered addresses
In RouterOS, to create a point-to-point tunnel with addresses you have to use address with a
network mask of '/32' that effectively brings you the same features as some vendors
unnumbered IP address.
There are 2 routers RouterA and RouterB where each is part of networks 10.22.0.0/24 and
10.23.0.0/24 respectively and to connect these routers using VLANs as a carrier with the
following configuration:
RouterA:
RouterB:
Manual:Interface/Bridge
< Manual:Interface
1Summary
2Bridge Interface Setup
o 2.1Properties
o 2.2Example
3Spanning Tree Protocol
4Bridge Settings
5Port Settings
o 5.1Example
6Interface lists
7Hosts Table
o 7.1Monitoring
o 7.2Static entries
8Bridge Monitoring
o 8.1Example
9Bridge Port Monitoring
o 9.1Example
10Bridge VLAN Filtering
o 10.1VLAN Example #1 (Trunk and Access Ports)
o 10.2VLAN Example #2 (Trunk and Hybrid Ports)
o 10.3VLAN Example #3 (InterVLAN Routing by Bridge)
o 10.4Management port
o 10.5VLAN Tunneling (Q-in-Q)
11IGMP Snooping
12Bridge Firewall
o 12.1Properties
12.1.1Notes
o 12.2Bridge Packet Filter
12.2.1Properties
o 12.3Bridge NAT
12.3.1Properties
Summary
Sub-menu: /interface bridge
Standards: IEEE802.1D
Ethernet-like networks (Ethernet, Ethernet over IP, IEEE802.11 in ap-bridge or bridge mode,
WDS, VLAN) can be connected together using MAC bridges. The bridge feature allows the
interconnection of hosts connected to separate LANs (using EoIP, geographically distributed
networks can be bridged as well if any kind of IP network interconnection exists between them)
as if they were attached to a single LAN. As bridges are transparent, they do not appear in
traceroute list, and no utility can make a distinction between a host working in one LAN and a
host working in another LAN if these LANs are bridged (depending on the way the LANs are
interconnected, latency and data rate between hosts may vary).
Network loops may emerge (intentionally or not) in complex topologies. Without any special
treatment, loops would prevent network from functioning normally, as they would lead to
avalanche-like packet multiplication. Each bridge runs an algorithm which calculates how the
loop can be prevented. STP and RSTP allows bridges to communicate with each other, so they
can negotiate a loop free topology. All other alternative connections that would otherwise form
loops, are put to standby, so that should the main connection fail, another connection could
take its place. This algorithm exchanges configuration messages (BPDU - Bridge Protocol
Data Unit) periodically, so that all bridges are updated with the newest information about
changes in network topology. (R)STP selects a root bridge which is responsible for network
reconfiguration, such as blocking and opening ports on other bridges. The root bridge is the
bridge with the lowest bridge ID.
To combine a number of networks into one bridge, a bridge interface should be created (later,
all the desired interfaces should be set up as its ports). One MAC address will be assigned to
all the bridged interfaces (the MAC address of first bridge port which comes up will be chosen
automatically).
Properties
Property
admin-mac (MAC address; Default: none) Static MAC address of t
ageing-time (time; Default: 00:05:00) How long a host's inform
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) Address Resolution Pro
Example
To add and enable a bridge interface that will forward all the protocols:
Warning: In RouterOS it is possible to set any value for bridge priority between 0 and 65535,
the IEEE 802.1W standard states that the bridge priority must be in steps of 4096. This can
cause incompatibility issues between devices that does not support such values. To avoid
compatibility issues, it is recommended to use only these priorities: 0, 4096, 8192, 12288,
16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440
STP has multiple variants, currently RouterOS supports STP, RSTP and MSTP. Depending on
needs, either one of them can be used, some devices are able to run some of these protocols
using hardware offloading, detailed information about which device support it can be found in
the Hardware Offloading section. STP is considered to be outdated and slow, it has been
almost entirely replaced in all network topologies by RSTP, which is backwards compatible
with STP. For network topologies that depend on VLANs, it is recommended to use MSTP
since it is a VLAN aware protocol and gives the ability to do load balancing per VLAN groups.
There are a lot of considerations that should be made when designing a STP enabled network,
more detailed case studies can be found in the Spanning Tree Protocol section.
Note: By the IEEE 802.1ad standard the BPDUs from bridges that comply with IEEE 802.1Q
are not compatible with IEEE 802.1ad bridges, this means that the same bridge VLAN protocol
should be used across all bridges in a single Layer2 domain, otherwise (R/M)STP will not
function properly.
Bridge Settings
Sub-menu: /interface bridge settings
Property
use-ip-firewall (yes | no; Default: no) Force bridged traffic to a
not apply to routed traffi
use-ip-firewall-for-pppoe (yes | no; Default: no) Send bridged un-encryp
Port Settings
Sub-menu: /interface bridge port
Example
To group ether1 and ether2 in the already created bridge1 bridge
Interface lists
Starting with RouterOS v6.41 it possible to add interface lists as a bridge port and sort them.
Interface lists are useful for creating simpler firewall rules, you can read more about interface
lists at the Interface List section. Below is an example how to add interface list to a bridge:
/interface list member
add interface=ether1 list=LAN1
add interface=ether2 list=LAN1
add interface=ether3 list=LAN2
add interface=ether4 list=LAN2
/interface bridge port
add bridge=bridge1 interface=LAN1
add bridge=bridge1 interface=LAN2
Ports from a interface list added to a bridge will show up as dynamic ports:
It is also possible to sort the order of lists in which they appear in the /interface bridge
port menu. This can be done using the move command. Below is an example how to sort
interface lists:
Note: The second parameter when moving interface lists is considered as "before id", the
second parameter specifies before which interface list should be the selected interface list
moved. When moving first interface list in place of the second interface list, then the command
will have no effect since the first list will be moved before the second list, which is the current
state either way.
Hosts Table
MAC addresses that have been learned on a bridge interface can be viewed in
the /interface bridge host menu. Below is a table of parameters and flags that can be
viewed.
Property
age (read-only: time) The time since the last p
bridge (read-only: name) The bridge the entry bel
dynamic (read-only: flag) Dynamically created ent
external-fdb (read-only: flag) Whether the host was le
local (read-only: flag) Whether the host entry i
mac-address (read-only: MAC address) Host's MAC address
on-interface (read-only: name) Which of the bridged int
Monitoring
To get the active hosts table:
Static entries
Since RouterOS v6.42 it is possible to add a static MAC address entry into the hosts table.
This can be used to forward a certain type of traffic through a specific port. Below is a table of
possible parameters that can be set when adding a static MAC address entry into the hosts
table.
Sub-menu: /interface bridge host
Property
bridge (name; Default: none) The bridge interface to w
disabled (yes | no; Default: no) Disables/enables static
interface (name; Default: none) Name of the interface.
mac-address (MAC address; Default: ) MAC address that will b
vid (integer: 1..4094; Default: ) VLAN ID for the staticall
For example, if it was required that all traffic destined to 4C:5E:0C:4D:12:43 is forwarded
only through ether2 , then the following commands can be used:
Bridge Monitoring
Sub-menu: /interface bridge monitor
Example
To monitor a bridge:
Disabled port -
Root port - a forw
Alternative por
Designated port
Backup port - a b
Example
To monitor a bridge port:
[admin@MikroTik] /interface bridge port> monitor 0
status: in-bridge
port-number: 1
role: designated-port
edge-port: no
edge-port-discovery: yes
point-to-point-port: no
external-fdb: no
sending-rstp: no
learning: yes
forwarding: yes
The main VLAN setting is vlan-filtering which globally controls vlan-awareness and
VLAN tag processing in the bridge. If vlan-filtering=no , bridge ignores VLAN tags, works
in a shared-VLAN-learning (SVL) mode and cannot modify VLAN tags of packets. Turning
on vlan-filtering enables all bridge VLAN related functionality and independent-VLAN-
learning (IVL) mode. Besides joining the ports for Layer2 forwarding, bridge itself is also an
interface therefore it has Port VLAN ID (pvid).
Property
frame-types (admit-all | admit-only-untagged-and-priority-tagged | admit-only-vlan- Specifies allowed ingres
tagged; Default: admit-all)
ingress-filtering (yes | no; Default: no) Enables or disables ingr
VLAN table. Should be u
vlan-filtering (yes | no; Default: no) Globally enables or disa
vlan-protocol (0x9100 | 802.1Q | 802.1ad; Default: 802.1Q) Changes the bridge VLA
pvid (integer 1..4094; Default: 1) Port VLAN ID (pvid) spe
IP and destined to a brid
Sub-menu: /interface bridge port
The bridge port settings related to VLAN filtering are described below.
Property
frame-types (admit-all | admit-only-untagged-and-priority-tagged | admit-only-vlan- Specifies allowed ingres
tagged; Default: admit-all)
ingress-filtering (yes | no; Default: no) Enables or disables ingr
table. Should be used w
pvid (integer 1..4094; Default: 1) Port VLAN ID (pvid) spe
Bridge VLAN table represents per-VLAN port mapping with an egress VLAN tag
action. tagged ports send out frames with a learned VLAN ID tag. untagged ports remove
VLAN tag before sending out frames if the learned VLAN ID matches the port pvid .
Property
bridge (name; Default: none) The bridge interface wh
disabled (yes | no; Default: no) Enables or disables Brid
tagged (interfaces; Default: none) Interface list with a VLA
E.g. tagged=ether1,e
Bridge Host table allows monitoring learned MAC addresses and when vlan-filtering is
enabled shows learned VLAN ID as well.
Note: Make sure you have added all needed interfaces to the bridge VLAN table when using
bridge VLAN filtering. For routing functions to work properly on the same device through ports
that use bridge VLAN filtering, you will need to allow access to the CPU from those ports, this
can be done by adding the bridge interface itself to the VLAN table, for tagged traffic you will
need to add the bridge interface as a tagged port and create a VLAN interface on the bridge
interface. Examples can be found at the Management port section.
Warning: When allowing access to the CPU, you are allowing access from a certain port to the
actual router/switch, this is not always desirable. Make sure you implement proper firewall filter
rules to secure your device when access to the CPU is allowed from a certain VLAN ID and
port, use firewall filter rules to allow access to only certain services.
Create a bridge with disabled vlan-filtering to avoid losing access to the router
before VLANs are completely configured.
/interface bridge
add name=bridge1 vlan-filtering=no
Add bridge ports and specify pvid for VLAN access ports to assign their untagged traffic
to the intended VLAN.
Add Bridge VLAN entries and specify tagged and untagged ports in them.
In the end, when VLAN configuration is complete, enable Bridge VLAN Filtering.
Create a bridge with disabled vlan-filtering to avoid losing access to the router
before VLANs are completely configured.
/interface bridge
add name=bridge1 vlan-filtering=no
Add bridge ports and specify pvid on hybrid VLAN ports to assign untagged traffic to the
intended VLAN.
Add Bridge VLAN entries and specify tagged and untagged ports in them. In this example
egress VLAN tagging is done on ether6,ether7,ether8 ports too, making them into hybrid
ports.
In the end, when VLAN configuration is complete, enable Bridge VLAN Filtering.
/interface bridge set bridge1 vlan-filtering=yes
Warning: The PVID value is set to all traffic that enters the bridge and adds the port
dynamically to the bridge VLAN table for VLAN ID that matches the PVID value. If you are
trying to isolate tagged traffic from untagged traffic, then make sure you have set a PVID to a
bridge port that is different from the bridge's PVID value, otherwise these ports will be
dynamically added to the bridge VLAN table and will be able to forward traffic from untagged
ports.
Create a bridge with disabled vlan-filtering to avoid losing access to the router
before VLANs are completely configured.
/interface bridge
add name=bridge1 vlan-filtering=no
Add bridge ports and specify pvid for VLAN access ports to assign their untagged traffic
to the intended VLAN.
Add Bridge VLAN entries and specify tagged and untagged ports in them. In this
example bridge1 interface is the VLAN trunk that will send traffic further to do InterVLAN
routing.
Configure VLAN interfaces on the bridge1 to allow handling of tagged VLAN traffic at
routing level and set IP addresses to ensure routing between VLANs as planned.
/interface vlan
add interface=bridge1 name=vlan200 vlan-id=200
add interface=bridge1 name=vlan300 vlan-id=300
add interface=bridge1 name=vlan400 vlan-id=400
/ip address
add address=20.0.0.1/24 interface=vlan200 network=20.0.0.0
add address=30.0.0.1/24 interface=vlan300 network=30.0.0.0
add address=40.0.0.1/24 interface=vlan400 network=40.0.0.0
In the end, when VLAN configuration is complete, enable Bridge VLAN Filtering.
Management port
There are multiple ways to setup management port on a device that uses bridge VLAN filtering.
Below are some of the most popular approaches to properly enable access to a router/switch.
Start by creating a bridge without VLAN filtering enabled:
/interface bridge
add name=bridge1 vlan-filtering=no
In case VLAN filtering will not be used and access with untagged traffic is desired
The only requirement is to create an IP address on the bridge interface.
/ip address
add address=192.168.99.1/24 interface=bridge1
In case VLAN filtering is used and access from trunk and/or access ports with tagged
traffic is desired
In this example VLAN 99 will be used to access the device, a VLAN interface on the bridge
must be created and an IP address must be assigned to it.
/interface vlan
add interface=bridge1 name=MGMT vlan-id=99
/ip address
add address=192.168.99.1/24 interface=MGMT
For example, if you want to allow access to the router/switch from access ports ether3,ether4
and from trunk port sfp-sfpplus1, then you must add this entry to the VLAN table:
In case VLAN filtering is used and access from trunk and/or access ports with untagged
traffic is desired
To allow untagged traffic to access the router/switch, start by creating an IP address on the
bridge interface.
/ip address
add address=192.168.88.1/24 interface=bridge1
It is required to add VLAN 1 to ports from which you want to allow the access to the
router/switch, for example, to allow access from access ports ether3,ether4 add this entry to
the VLAN table:
Make sure that PVID on the bridge interface matches the PVID value on these ports:
Note: If connection to the router/switch through an IP address is not required, then steps
adding this IP address can be skipped since connection to the router/switch through Layer2
protocols (e.g. MAC-telnet) will be working either way.
/interface bridge
add name=bridge1 vlan-filtering=no vlan-protocol=802.1ad
In this setup ether1 and ether2 are going to be access ports (untagged), use
the pvid parameter to tag all ingress traffic on each port, use the commands
on SW1 and SW2:
Specify tagged and untagged ports in the bridge VLAN table, use these commands
on SW1 and SW2:
When bridge VLAN table is configured, you can enable bridge VLAN filtering, use these
commands on SW1 and SW2
/interface bridge set bridge1 vlan-filtering=yes
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port. The
difference between 802.1Q VLAN protocol is that you must use a Service VLAN interface.
Service VLAN interfaces can be created as regular VLAN interface, but the use-service-
tag parameter toggles if the interface will use Service VLAN tag.
Note: Currently only CRS3xx series switches are capable of hardware offloading VLAN filtering
based on SVID (Service VLAN ID) tag when vlan-protocol is set to 802.1ad.
Warning: With 802.1Q VLAN protocol the bridge checks the outer VLAN tag if it is using
EtherType 0x8100 . If the bridge receives a packet with an outer tag that has a different
EtherType, it will mark the packet as untagged . Since RouterOS only checks the outer tag of
a packet, it is not possible to filter 802.1Q packets when 802.1ad protocol is used.
IGMP Snooping
IGMP Snooping which controls multicast streams and prevents multicast flooding is
implemented in RouterOS starting from version 6.41.
It's settings are placed in bridge menu and it works independently in every bridge interface.
Software driven implementation works on all devices with RouterOS but CRS1xx/2xx/3xx
series switches also support IGMP Snooping with hardware offloading.
ether2
ether1
bridge1 300 231.1.3.3
ether4
ether3
ether2
bridge1 400 229.10.10.4
ether4
ether3
bridge1 500 234.5.1.5
ether5
ether1
[admin@MikroTik] >
Bridge Firewall
Sub-menu: /interface bridge filter, /interface bridge nat
The bridge firewall implements packet filtering and thereby provides security functions that are
used to manage data flow to, from and through bridge.
Packet flow diagram shows how packets are processed through router. It is possible to force
bridge traffic to go through /ip firewall filter rules (see: Bridge Settings)
There are two bridge firewall tables:
Properties
Property
802.3-sap (integer; Default: ) DSAP (Destination Serv
network protocol entities
specified here to match
802.3-type (integer; Default: ) Ethernet protocol type, p
Attachment Point heade
0x809B.
action (accept | drop | jump | log | mark-packet | passthrough | return | set-priority; Action to take if packet i
Default: )
accept - accept the
drop - silently drop
jump - jump to the u
log - add a messag
>dst-ip:port and leng
mark-packet - pla
passthrough - if p
return - passes co
set-priority - se
transporting priority
arp-dst-address (IP address; Default: ) ARP destination IP addr
arp-dst-mac-address (MAC address; Default: ) ARP destination MAC a
arp-gratuitous (yes | no; Default: ) Matches ARP gratuitous
arp-hardware-type (integer; Default: 1) ARP hardware type. Thi
arp-opcode (arp-nak | drarp-error | drarp-reply | drarp-request | inarp-reply | inarp- ARP opcode (packet typ
request | reply | reply-reverse | request | request-reverse; Default: )
arp-nak - negative
drarp-error - Dy
drarp-reply - Dy
drarp-request -
inarp-reply - Inv
inarp-request -
reply - standard A
reply-reverse -
request - standard
request-reverse
be used by hosts to
arp-packet-type (integer 0..65535 | hex 0x0000-0xffff; Default: ) ARP Packet Type.
arp-src-address (IP address; Default: ) ARP source IP address.
arp-src-mac-address (MAC addres; Default: ) ARP source MAC addre
chain (text; Default: ) Bridge firewall chain, wh
dst-address (IP address; Default: ) Destination IP address (
dst-mac-address (MAC address; Default: ) Destination MAC addres
dst-port (integer 0..65535; Default: ) Destination port number
in-bridge (name; Default: ) Bridge interface through
in-interface (name; Default: ) Physical interface (i.e., b
in-interface-list (name; Default: ) Set of interfaces defined
count - maximum a
time - specifies the
burst - number of
broadcast - broad
host - packet is de
multicast - multic
other-host - pack
topology-change
their host tables and
topology-change
Notes
802.3 matchers are only consulted if the actual frame is compliant with IEEE 802.2 and
IEEE 802.3 standards (note: it is not the industry-standard Ethernet frame format used in
most networks worldwide!). These matchers are ignored for other packets.
This section describes bridge packet filter specific filtering options, that are specific
to '/interface bridge filter' .
Properties
Property
action (accept | drop | jump | log | mark-packet | passthrough | return | set-priority; Action to take if packet i
Default: accept)
accept - accept the
are processed in the
drop - silently drop
jump - jump to the c
log - ladd a messa
protocol, src-ip:port-
as passthrough
mark - mark the pac
passthrough - ign
packets
return - return to t
set-priority - se
transporting priority
Bridge NAT
Sub-menu: /interface bridge nat
This section describes bridge NAT options, that are specific to '/interface bridge nat' .
Properties
Property
action (accept | drop | jump | mark-packet | redirect | set-priority | arp-reply | dst-nat Action to take if packet i
| log | passthrough | return | src-nat; Default: accept)
accept - accept the
are processed in the
arp-reply - send
address (only valid i
drop - silently drop
dst-nat - change
jump - jump to the c
log - log the packe
mark - mark the pac
passthrough - ign
packets
redirect - redirec
return - return to t
set-priority - se
transporting priority
src-nat - change
You can check the STP status of a bridge port by using the /interface bridge port
monitor command, for example:
Note that root-bridge-id consists of the bridge priority and the bridge's MAC address, for
non-root bridges the root bridge will be shown as designated-bridge . One port can have
one role in a STP enabled network, below is a list of possible port roles:
root-port - port that is facing towards the root bridge and will be used to forward traffic
from/to the root bridge.
alternate-port - port that is facing towards root bridge, but is not going to forward traffic (a
backup for root port).
backup-port - port that is facing away from the root bridge, but is not going to forward
traffic (a backup for non-root port).
designated-port - port that is facing away from the root bridge and is going to forward
traffic .
disabled-port - disabled or inactive port.
Note: When using bridges that are set to use 802.1Q as VLAN protocol, they will send out
BPDUs to 01:80:C2:00:00:00, which are used by MSTP, RSTP and STP. When using 802.1ad
as bridge VLAN protocol, the BPDUs are not compatible with 802.1Q bridges and they are sent
to 01:80:C2:00:00:08. (R/M)STP will not function properly if there are different bridge VLAN
protocols across the Layer2 network.
Default values
When creating a bridge or adding a port to a bridge the following are the default values that are
assigned by RouterOS:
Election process
To properly configure STP in your network you need to understand the election process and
which parameters are involved in which order. In RouterOS the root bridge will be elected
based on the smallest priority and the smallest MAC address in this particular order:
Note: Make sure you are using path cost and priority on the right ports. For example, setting
path cost on a ports that are in a root bridge has no effect, only port priority has effect on them.
Path cost has effect on ports that are facing towards the root bridge and port priority has effect
on ports that are facing away from the root bridge.
Warning: In RouterOS it is possible to set any value for bridge priority between 0 and 65535,
the IEEE 802.1W standard states that the bridge priority must be in steps of 4096. This can
cause incompatibility issues between devices that does not support such values. To avoid
incompatibility issues, it is recommended to use only these priorities: 0, 4096, 8192, 12288,
16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440
Note: When electing a root port the path cost will be checked first. If the path cost for multiple
paths is the same, then port priority is checked. If port priority is the same, then bridge port ID
is checked, port with the lowest values will be elected as a root port. Make sure you take into
account the election process when designing your network with STP enabled.
Example
/interface bridge
add name=bridge priority=0x1000
/interface bridge port
add bridge=bridge interface=ether1 priority=0x60
add bridge=bridge interface=ether2 priority=0x50
add bridge=bridge interface=ether3 priority=0x40
add bridge=bridge interface=ether4 priority=0x30
add bridge=bridge interface=ether5
/interface bridge
add name=bridge priority=0x2000
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
/interface bridge
add name=bridge priority=0x3000
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
/interface bridge
add name=bridge priority=0x4000
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2 path-cost=20
add bridge=bridge interface=ether3
In this example SW1 is the root bridge since it has the lowest bridge
priority. SW2 and SW3 has ether1,ether2 connected to the root bridge and ether3 is connected
to SW4. When all switches are working properly, the traffic will be flowing from ServerA
through SW1_ether2, through SW2, through SW4 to ServerB. In case of SW1 failure,
the SW2 becomes the root bridge because of the next lowest priority. Below is a list of ports
and their role for each switch:
Note: By the 802.1W recommendations, you should use bridge priorities in steps of 4096. To
set a recommended priority it is more convenient to use hexadecimal notation, for example, 0
is 0x0000, 4096 is 0x1000, 8192 is 0x2000 and so on (0..F).
Multiple Spanning Tree Protocol
Since RouterOS v6.41 it is possible to enable Multiple Spanning Tree Protocol (MSTP) on a
bridge interface to ensure loop-free topology across multiple VLANs, MSTP can also provide
Layer2 redundancy and can be used as a load balancing technique for VLANs since it has the
ability to have different paths across different VLANs. MSTP is operating very similarly to
(R)STP and many concepts from (R)STP can be applied to MSTP and it is highly
recommended to understand the principles behind (R)STP before using MSTP, but there are
some differences that must be taken into account when designing a MSTP enabled network.
In case (R)STP is used, the BPDUs are sent across all physical interfaces in a bridge to
determine loops and stop ports from being able to forward traffic, if it causes a loop. In case
there is a loop inside a certain VLAN, (R)STP might not be able to detect it. Some STP variants
solve this problem by running a STP instance on every single VLAN (PVST), but this has been
proven to inefficient and some STP variants solve this problem by running a single STP
instance across all VLANs (CST), but it lacks the possibility to do load balancing for each
VLAN or VLAN group. MSTP tends to solve both problems by using MST instances that can
define a group of VLANs (VLAN mapping) that can be used for load balancing and
redundancy, this means that each VLAN group can have a different root bridge and a different
path. Note that it is beneficial to group multiple VLANs in a single instance to reduce the
amount of CPU cycles for each network topology change.
Warning: In RouterOS with MSTP enabled the bridge priority is the CIST's root bridge priority,
as stated in the IEEE 802.1Q standard the bridge priority must be in steps of 4096, the 12
lowest bits are ignored. These are valid bridge priorities: 0, 4096, 8192, 12288, 16384, 20480,
24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440. When setting an
invalid bridge priority, RouterOS will warn you about it and trunk the value to a valid value, but
will save the original value in the configuration since invalid bridge priority values can still be
used in (R)STP between devices running RouterOS, though it is recommended to use valid a
bridge priority instead.
MSTP Regions
MSTP works in groups called regions, for each region there will be a regional root bridge and
between regions there will be a root bridge elected. MSTP will use Internal Spanning Tree
(IST) to build the network topology inside a region and Common Spanning Tree (CST) outside
a region to build the network topology between multiple regions, MSTP combines these two
protocols into Common and Internal Spanning Tree (CIST), which holds information about
topology inside a region and between regions. From CST's perspective a region will seemingly
be as a single virtual bridge, because of this MSTP is considered very scalable for large
networks. In order for bridges to be in the same region, their configuration must match, BPDUs
will not include VLAN mappings since they can be large, rather a computed hash is being
transmitted. If a bridge receives a BPDU through a port and the configuration does not match,
then MSTP will consider that port as a boundary port and that it can be used to reach other
regions. Below is a list of parameters that need to match in order for MSTP to consider a
BPDU from the same region:
Region name
Region revision
VLAN mappings to MST Instance IDs (computed hash)
It is possible to create MSTP enabled network without regions, though to be able to do load
balancing per VLAN group it is required for a bridge to receive a BPDU from a bridge that is
connected to it with the same parameters mentioned above. In RouterOS the default region
name is empty and region revision is 0, which are valid values, but you must make sure that
they match in order to get multiple bridges in a single MSTP region. A region cannot exist if
their bridges are scattered over the network, these bridges must be connected at least in one
way, in which they can send and receive BPDUs without leaving the region, for example, if a
bridge with different region related parameters is between two bridges that have the same
region related parameters, then there will exist at least 3 different MSTP regions.
Note: Since MSTP requires VLAN filtering on the bridge interface to be enabled, then make
sure that you have allowed all required VLAN IDs in /interface bridge vlan ,
otherwise the traffic will not be forwarded and it might seem as MSTP misconfigured, although
this is a VLAN filtering misconfiguration.
Election process
The election process in MSTP can be divided into two sections, intra region and inter region.
For MSTP to work properly there will always need to be a regional root, that is the root bridge
inside a region, and a CIST root, that is the root bridge between regions. A regional root is the
root bridge inside a region, regional root bridge will be needed to properly set up load
balancing for VLAN groups inside a region. CIST root will be used to configure which ports will
be alternate/backups ports (inactive) and which ports will be root ports (active).
Note: Between regions there is no load balancing per VLAN group, root port election process
and port blocking between MSTP regions is done the same way as in (R)STP. If CIST has
blocked a port that is inside a MSTP region to prevent traffic loops between MSTP regions,
then this port can still be active for IST to do load balancing per VLAN group inside a MSTP
region.
The following parameters are involved to elect a regional root bridge or root ports inside a
MSTP region:
Property
priority (integer: 0..65535 decimal format or 0x0000-0xffff hex format; Default: 32768 / /interface bridge
0x8000)
internal-path-cost (integer: 1..200000000; Default: 10) /interface bridge
priority (integer: 0..240; Default: 128) /interface bridge
root bridge.
internal-path-cost (integer: 1..200000000; Default: 10) /interface bridge
MSTP region.
The following parameters are involved to elect a CIST root bridge or CIST root ports:
Property
priority (integer: 0..65535 decimal format or 0x0000-0xffff hex format; Default: 32768 / /interface bridge,
0x8000)
priority (integer: 0..240; Default: 128) /interface bridge
path-cost (integer: 1..200000000; Default: 10) /interface bridge
Note: The sequence of parameters in which MSTP checks to elect root bridge/ports are the
same as in (R)STP, you can read more about it at the (R)STP Election Process section.
MST Instance
Sub-menu: /interface bridge msti
This section is used to group multiple VLAN IDs to a single instance to create a different root
bridge for each VLAN group inside a MSTP region.
Property
bridge (text; Default: ) Bridge to which assign a M
identifier (integer: 1..31; Default: ) MST instance identifier.
priority (integer: 0..65535 decimal format or 0x0000-0xffff hex format; Default: 32768 / MST instance priority, use
0x8000)
vlan-mapping (integer: 1..4094; Default: ) The list of VLAN IDs to a
mapping=100-115,120
MST Override
Sub-menu: /interface bridge port mst-override
This section is used to select desired path for each VLAN mapping inside a MSTP region.
Property
disabled (yes | no; Default: no) Whether entry is disabled.
internal-path-cost (integer: 1..200000000; Default: 10) Path cost for a MST instan
path cost is preferred.
identifier (integer: 1..31; Default: ) MST instance identifier.
priority (integer: 0..240; Default: 128) The priority a MST instanc
is preferred.
interface (name; Default: ) Name of the port on which
Monitoring
Similarly to (R)STP, it is also possible to monitor MSTP status. By monitoring the bridge
interface itself it possible to see the current CIST root bridge and the current regional root
bridge for MSTI0, it is also possible to see the computed hash of MST Instance identifiers and
VLAN mappings, this is useful when making sure that certain bridges are in the same MSTP
region. Below you can find an example to monitoring a MSTP bridge:
In MSTP it is possible to monitor the MST Instance, this is useful to determine the current
regional root bridge for a certain MST Instance and VLAN group, below you can find an
example to monitor a MST Instance:
It is also possible to monitor a certain MST Override entry, this is useful to determine the port
role for a certain MST Instance when configuring root ports and alternate/backup ports in a
MSTP region, below you can find an example to monitor a MST Override entry:
Example
Lets say that we need to design a topology and configure MSTP in a way that VLAN 10,20 will
be forwarded in one path, but VLAN 30,40 will be forwarded in a different path, while all other
VLAN IDs will be forwarded in one of those paths. This can easily be done by setting up MST
Instances and assigning port path costs, below you can find a network topology that needs to
do load balancing per VLAN group with 3 separate regions as an example:
Topology of a MSTP enabled network with load balancing per VLAN group
Start by adding each interface to a bridge, initially you should create a (R)STP bridge without
VLAN filtering enabled, this is to prevent loosing access to the CPU. Each device in this
example is named by the region that it is in (Rx) and a device number (_x). For larger networks
configuring MSTP can confusing because of the amount of links and devices, we recommend
using The Dude to monitor and design a network topology.
Use the following commands on R1_1, R1_3, R2_1, R2_3, R3_1, R3_3:
/interface bridge
add name=bridge protocol-mode=rstp vlan-filtering=no
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
/interface bridge
add name=bridge protocol-mode=rstp vlan-filtering=no
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
Make sure you allow the required VLAN IDs on these devices, here we will consider that
each device will receive tagged traffic that needs to be load balanced per VLAN group, use
these commands on R1_1, R1_3, R2_1, R2_3, R3_1, R3_3:
Note: Make sure you add all the needed VLAN IDs and ports to the bridge VLAN table,
otherwise your device will not forward all required VLANs and/or you will loose access to the
device. You can read about how to set up management ports with bridge VLAN filtering at
the Management port section.
We need to assign a region name for each bridge that we want to be in a single MSTP region,
you can also specify the region revision, but it is optional, though they need to match. In this
example if all bridges will have the same region name, then they will all be in a single MSTP
bridge. In this case we want to separate a group of 3 bridges in a different MSTP region to do
load balancing per VLAN group and to create diversity and scalability.
Set appropriate region name (and region revision) for each bridge, use the following
commands on each device (change the region name!):
/interface bridge
set bridge region-name=Rx region-revision=1
After we have created 3 different MSTP regions, we need to decide which device is going to be
a regional root for each VLAN group. For consistency we are going to set the first device (_1)
in each region as the regional root for VLAN 10,20 and the third device (_3) in each region as
the regional root for VLAN 30,40. This can be done by creating a MST Instance for each VLAN
group and assigning a bridge priority to it. The MST Instance identifier is only relevant inside a
MSTP region, outside a MSTP region these identifiers can be different and mapped to a
different VLAN group.
Now we need to override the port path-cost and/or port priority for each MST Instance. This
can be done by adding a MST-Override entry for each port and each MST Instance. To
achieve that for a certain MST Instance the traffic flow path is different, we simply need to
make sure that the port path cost and/or priority is larger. We can either increase the port path
cost or either decrease the port path cost to ports that are facing towards the regional root
bridge. It doesn't matter if you increase or decrease all values, it is important that at the end
one port's path cost is larger than the other's.
In this case for VLAN 10,20 to reach the third device from the first device it would choose
between ether1 and ether2, one port will be blocked and set as an alternate port, ether1 will
have path cost as 5+9=14 and ether2 will have path cost as 10 , ether2 will be elected as the
root port for MSTI1 on the third device. In case for VLAN 30,40 to reach the first device from
the third device, ether1 will have path cost as 5+9=14 and ether2 will have path cost as 15 ,
ether1 will be elected as the root port for MSTI2 on the third device.
Now we can configure the root ports for MSTI0, in which will fall under all VLANs that are not
assigned to a specific MST Instance, like in our example VLAN 10,20 and VLAN 30,40. To
configure this special MST Instance, you will need to specify internal-path-cost to a
bridge port. This value is only relevant to MSTP regions, it does not have any effect outside a
MSTP region. In this example will choose that all unknown VLANs will be forwarded over the
same path as VLAN 30,40, we will simply increase the path cost on one of the ports.
At this point a single region MSTP can be considered as configured and in general MSTP is
fully functional. It is highly recommended to configure the CIST part, but for testing purposes it
can be left with the default values. Before doing any tests, you need to enable MSTP on all
bridges.
/interface bridge
set bridge protocol-mode=mstp vlan-filtering=yes
When MSTP regions have been configured, you can check if they are properly configured by
forwarding traffic, for example, send tagged traffic from the first device to the third device and
change the VLAN ID for the tagged traffic to observe different paths based on VLAN ID. When
this is working as expected, then you can continue to configure CIST related parameters to
elect a CIST root bridge and CIST root ports. For consistency we will choose the first device in
the first region to be the CIST root bridge and to ensure the consistency in case of failure we
can set a higher priority to all other bridges.
/interface bridge
set bridge priority=0x1000
/interface bridge
set bridge priority=0x2000
...
/interface bridge
set bridge priority=0x9000
We also need to elect a root port on each bridge, for simplicity we will choose the port that is
closest to Ŗ1_1 as the root port and has the least hops. At this point the procedure to elect root
ports is the same as the procedure in (R)STP.
Applies to RouterOS:v6.0 +
Contents
[hide]
1Introduction
2Features
o 2.1Port Switching
2.1.1Bridge Hardware Offloading
2.1.2Switch All Ports Feature
o 2.2Port Mirroring
o 2.3Hosts Table
o 2.4VLAN Table
o 2.5Rule Table
o 2.6Port isolation
o 2.7Statistics
3Setup Examples
o 3.1VLAN Example 1 (Trunk and Access Ports)
o 3.2VLAN Example 2 (Trunk and Hybrid Ports)
o 3.3Management port configuration
3.3.1Tagged
3.3.2Untagged
3.3.3Untagged from tagged port
o 3.4Spanning Tree Protocol
Introduction
There are several types of switch chips on Routerboards and they have a different set of
features. Most of them (from now on "Other") have only basic "Port Switching" feature, but
there are few with more features:
Capabilities of switch chips:
Feature QCA8337 Atheros8327 Atheros8316 Atheros822
Host table 2048 entries 2048 entries 2048 entries 1024 entries
Vlan table 4096 entries 4096 entries 4096 entries 4096 entries
RouterBoard
RB1100AHx4
RB3011 series
RB OmniTik ac series
RB951Ui-2nD (hAP); RB952Ui-5ac2nD (hAP ac lite); RB750r2 (hEX lite); RB750UPr2 (hEX PoE lite); RB750P-PBr2 (PowerB
(OmniTIK 5); RBOmniTikUPA-5HnDr2 (OmniTIK 5 PoE)
RB750Gr2 (hEX); RB962UiGS-5HacT2HnT (hAP ac); RB960PGS (hEX PoE); RB960PGS-PB (PowerBox Pro)
RB953GS
RB850Gx2
RB2011 series
cAP ac
RB1100AH
RB1100AHx2
CCR1009 series
RB493G
RB435G
RB450G
RB433GL
RB750G
RB1200
RB1100
RB750
RB750UP
RB751U-2HnD
RB951-2n
RB951Ui-2HnD
RB433 series
RB450
RB493 series
RB816
Command line config is under /interface ethernet switch menu. This menu contains a
list of all switch chips present in system, and some sub-menus as well. /interface
ethernet switch menu list item represents a switch chip in system:
Features
Port Switching
Switching feature allows wire speed traffic passing among a group of ports, like the ports were
a regular ethernet switch. You configure this feature by setting a "master-port" property to one
ore more ports in /interface ethernet menu. A 'master' port will be the port through which
the RouterOS will communicate to all ports in the group. Interfaces for which the 'master' port is
specified become inactive - no traffic is received on them and no traffic can be sent out.
For example consider a router with five ethernet interfaces:
And you configure a switch containing three ports ether3, ether4 and ether5:
ether3 is now the master port of the group. Note: you can see that previously a link was
detected only on ether5, but now as the ether3 is a 'master' the running flag is propagated to
master port.
In essence this configuration is the same as if you had a RouterBoard with 3 ethernet
interfaces with ether3 connected to ethernet switch that has 4 ports:
A more general diagram of RouterBoard with switch chip that has 5 port switch chip:
Here you can see that, a packet that gets received by one of the ports always passes through
the switch logic at first. Switch logic decides to which ports the packet should be going to.
Passing packet 'up' or giving it to RouterOS is also called sending it to switch chips 'cpu' port.
That means that at the point switch forwards the packet to cpu port the packet starts to get
processed by RouterOS as some interfaces incoming packet. While the packet does not have
to go to cpu port it is handled entirely by switch logic and does not require any cpu cycles and
happen at wire speed for any frame size.
Bridge Hardware Offloading
Since RouterOS v6.41 there are user interface changes which convert RouterBoard master-
port configuration into a bridge with hardware offloading. From now on bridges will handle all
Layer2 forwarding and the use of switch chip ( hw-offload ) will automatically turn on if
appropriate conditions are met. The rest of RouterOS Switch features remain untouched in
usual menus. By default all newly created bridge ports have hw=yes option and it allows
enabling of hw-offload when possible. If such functionality is not required, it can be disabled
by hw=no on bridge port to have completely software operated bridging.
Note: Downgrading to previous RouterOS versions will not restore master-port configuration.
The bridge with no hw-offload will appear instead and master-port configuration will have to be
redone from the beginning.
Following table states what features currently in v6.41 keeps bridge hardware offloading
enabled on certain RouterBoard and switch chip models.
Notes:
CRS3xx series + + + + + +
CRS1xx/CRS2xx
+ + - + - -
series
[QCA8337] + + - - - -
[AR8327] + + - - - -
[AR8227] + + - - - -
RouterBoard/[Switc Features in Bridge Bridge Bridge IGMP Bridge VLAN Bon
h Chip] Model Switch menu STP/RSTP MSTP Snooping Filtering ding
[AR8316] + + - - - -
[AR7240] + + - - - -
[MT7621] + - - - - -
RB1100AHx4
+ - - - - -
[RTL8367]
[ICPlus175D] + - - - - -
Port switching with bridge configuration and enabled hw-offload since v6.41
switch-all-ports=yes/no -
"yes" means ether1 is part of switch and supports switch grouping, and all other advanced
Atheros8316/Atheros8327 features including extended statistics ( /interface ethernet
print stats ).
"no" means ether1 is not part of switch, effectively making it as stand alone ethernet port, this
way increasing its throughput to other ports in bridged, and routed mode, but removing the
switching possibility on this port.
Port Mirroring
Port mirroring lets switch 'sniff' all traffic that is going in and out of one port (mirror-source) and
send a copy of those packets out of some other port (mirror-target). This feature can be used
to easily set up a 'tap' device that receives all traffic that goes in/out of some specific port. Note
that mirror-source and mirror-target ports have to belong to same switch. (See which port
belong to which switch in /interface ethernet menu). Also mirror-target can have a
special 'cpu' value, which means that 'sniffed' packets should be sent out of switch chips cpu
port. Port mirroring happens independently of switching groups that have or have not been set
up.
Warning: If you set mirror-source as a Ethernet port for a device with at least two switch chips
and these mirror-source ports are in a single bridge while mirror-target for both switch chips are
set to send the packets to the CPU, then this will result in a loop, which can make your device
inaccessible.
Hosts Table
Basically the hosts table represents switch chips internal mac address to port mapping. It can
contain two kinds of entries: dynamic and static. Dynamic entries get added automatically, this
is also called a learning process: when switch chip receives a packet from certain port, it adds
the packets source mac address X and port it received the packet from to host table, so when
a packet comes in with destination mac address X it knows to which port it should forward the
packet. If the destination mac address is not present in host table then it forwards the packet to
all ports in the group. Dynamic entries take about 5 minutes to time out. Learning is enabled
only on ports that are configured as part of switch group. So you won't see dynamic entries if
you have not specified some 'master-ports'. Also you can add static entries that take over
dynamic if dynamic entry with same mac-address already exists. Also by adding a static entry
you get access to some more functionality that is controlled via following params:
disabled - ignore vlan table, treat packet with vlan tags just as if they did not contain a vlan
tag;
fallback - the default mode - handle packets with vlan tag that is not present in vlan table
just like packets without vlan tag. Packets with vlan tags that are present in vlan table, but
incoming port does not match any port in vlan table entry does not get dropped.
check - drop packets with vlan tag that is not present in vlan table. Packets with vlan tags
that are present in vlan table, but incoming port does not match any port in vlan table entry
does not get dropped.
secure - drop packets with vlan tag that is not present in vlan table. Packets with vlan tags
that are present in vlan table, but incoming port does not match any port in vlan table entry
get dropped.
Vlan tag id based forwarding takes into account the MAC addresses dynamically learned or
manually added in the host table. QCA8337 and AR8327 switch-chips also support
Independent VLAN learning (IVL) which does the learning based on both MAC addresses and
VLAN IDs thus allowing the same MAC to be used in multiple VLANs. The option
"independent-learning" in VLAN table entries enables this feature.
Packets without vlan tag are treated just like if they had a vlan tag with port default-vlan-
id. This means that if "vlan-mode=check or secure" to be able to forward packets without vlan
tags you have to add a special entry to vlan table with the same vlan id set according
to default-vlan-id.
Vlan-header option (configured in /interface ethernet switch port ) sets the VLAN tag
mode on egress port. Starting from RouterOS version 6 this option works with QCA8337,
AR8316, AR8327, AR8227 and AR7240 switch chips and takes the following values:
ports - match port that packet came in from (multiple ports allowed);
ip conditions
dst-address - match by destination ip and mask;
src-address - match by source ip and mask;
dscp - match by ip dscp field;
protocol - match by ip protocol;
ipv6 conditions
dst-address6 - match by destination ip and mask;
src-address6 - match by source ip and mask;
flow-label - match by ipv6 flow label;
traffic-class - match by ipv6 traffic class;
protocol - match by ip protocol;
L4 conditions
src-port - match by tcp/udp source port range;
dst-port - match by tcp/udp destination port range;
IPv4 and IPv6 specific conditions cannot be present in same rule. Menu contains ordered list of
rules just like in /ip firewall filter . Due to the fact that the rule table is processed
entirely in switch chips hardware there is limitation to how many rules you may have.
Depending on the amount of conditions (MAC layer, IP layer, IPv6, L4 layer) you use in your
rules the amount of active rules may vary from 8 to 32 for Atheros8316 switch chip and from 24
to 96 for Atheros8327/QCA8337 switch chip. You can always do /interface ethernet
switch rule print after modifying your rule set to see that no rules at the end of the list
are 'invalid' which means those rules did not fit into the switch chip.
Port isolation
Since RouterOS v6.43rc11 it is possible to create an uplink port and isolated ports. Such a
configuration allows each device connected to a switch port to be isolated from other ports and
these isolated ports are only capable of communicating with other devices through the uplink
port. This kind of configuration can also be called Private VLAN configuration, the Switch will
forward all Ethernet frames directly to the uplink port allowing the Router to filter unwanted
packets and limit access between devices that are behind switch ports.
Switch port isolation
To configure switch port isolation, you need to switch all required ports:
/interface bridge
add name=bridge1 protocol-mode=none
/interface bridge port
add interface=sfp1 bridge=bridge1 hw=yes
add interface=ether1 bridge=bridge1 hw=yes
add interface=ether2 bridge=bridge1 hw=yes
add interface=ether3 bridge=bridge1 hw=yes
Override the egress port for each switch port that needs to be isolated (excluding the uplink
port):
Note: It is possible to set multiple uplink ports for a single switch chip, this can be done by
specifying multiple interfaces and separating them with a comma.
Statistics
Some switch chips are capable of reporting statistics, this can be useful to monitor how many
packets are sent to the CPU from the built-in switch chip. These statistics can also be used to
monitor CPU Flow Control. You can find an example of switch chip's statistics below:
name: switch1
driver-rx-byte: 221 369 701
driver-rx-packet: 1 802 975
driver-tx-byte: 42 621 969
driver-tx-packet: 310 485
rx-bytes: 414 588 529
rx-packet: 2 851 236
rx-too-short: 0
rx-too-long: 0
rx-broadcast: 1 040 309
rx-pause: 0
rx-multicast: 486 321
rx-fcs-error: 0
rx-align-error: 0
rx-fragment: 0
rx-control: 0
rx-unknown-op: 0
rx-length-error: 0
rx-code-error: 0
rx-carrier-error: 0
rx-jabber: 0
rx-drop: 0
tx-bytes: 44 071 621
tx-packet: 312 597
tx-too-short: 0
tx-too-long: 8 397
tx-broadcast: 2 518
tx-pause: 2 112
tx-multicast: 7 142
tx-excessive-collision: 0
tx-multiple-collision: 0
tx-single-collision: 0
tx-excessive-deferred: 0
tx-deferred: 0
tx-late-collision: 0
tx-total-collision: 0
tx-drop: 0
tx-jabber: 0
tx-fcs-error: 0
tx-control: 2 112
tx-fragment: 0
tx-rx-64: 6 646
tx-rx-65-127: 1 509 891
tx-rx-128-255: 1 458 299
tx-rx-256-511: 178 975
tx-rx-512-1023: 953
tx-rx-1024-1518: 672
tx-rx-1519-max: 0
Some devices have multiple CPU cores that are directly connected to a built-in switch chip
using separate data lanes. These devices can report which data lane was used to forward the
packet from or to the CPU port from the switch chip. For such devices an extra line is added for
each row, the first line represents data that was sent using the first data lane, the second line
represent data that was sent using the second data line and so on. You can find an example of
switch chip's statistics for a device with multiple data lanes connecting the CPU and the built-in
switch chip:
Setup Examples
Note: Make sure you have added all needed interfaces to the VLAN table when using secure
vlan-mode. For routing functions to work properly on the same device through ports that use
secure vlan-mode, you will need to allow access to the CPU from those ports, this can be done
by adding the switchX-cpu interface itself to the VLAN table. Examples can be found at
the Management port section.
Warning: When allowing access to the CPU, you are allowing access from a certain port to the
actual router/switch, this is not always desirable. Make sure you implement proper firewall filter
rules to secure your device when access to the CPU is allowed from a certain VLAN ID and
port, use firewall filter rules to allow access to only certain services.
Note: It is possible to use the built-in switch chip and the CPU at the same time to create a
Switch-Router setup, where a device acts as a switch and as a router at the same time. You
can find a configuration example in theSwitch-Router guide.
Create a group of switched ports by selecting one master-port and setting it for other ports.
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether5 hw=yes
Add VLAN table entries to allow frames with specific VLAN IDs between ports.
Assign "vlan-mode" and "vlan-header" mode for each port and also "default-vlan-id" on
ingress for each access port.
Setting "vlan-mode=secure" ensures strict use of VLAN table.
Setting "vlan-header=always-strip" for access ports removes VLAN header from frame when it
leaves the switch chip.
Setting "vlan-header=add-if-missing" for trunk port adds VLAN header to untagged frames.
"Default-vlan-id" specifies what VLAN ID is added for untagged ingress traffic of the access
port.
/interface ethernet
set ether3 master-port=ether2
set ether4 master-port=ether2
set ether5 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether5 hw=yes
Add VLAN table entries to allow frames with specific VLAN IDs between ports.
In switch port menu set "vlan-mode" on all ports and also "default-vlan-id" on planned
hybrid ports.
"Vlan-mode=secure" will ensure strict use of VLAN table.
"Default-vlan-id" will define VLAN for untagged ingress traffic on port.
In Gigabit switch chips when "vlan-mode=secure", it ignores switch port "vlan-header" options.
VLAN table entries handle all the egress tagging/untagging and works as "vlan-header=leave-
as-is" on all ports.
It means what comes in tagged, goes out tagged as well, only "default-vlan-id" frames are
untagged at the egress of port.
/interface ethernet
set ether2 master-port=ether1
/interface bridge
add name=bridge1 protocol-mode=none
/interface bridge port
add interface=ether1 bridge=bridge1 hw=yes
add interface=ether2 bridge=bridge1 hw=yes
In these examples it will be assumed that ether1 is the trunk port and ether2 is the access
port, for configuration as the following:
Tagged
In order to make the device accessible only from a certain VLAN, you need to create a new
VLAN interface on the bridge/master-port interface and assign an IP address to it:
/interface vlan
add name=MGMT vlan-id=99 interface=bridge1
/ip address
add address=192.168.99.1/24 interface=MGMT
Note: Only specify trunk ports in this VLAN table entry, it is not possible to allow access to the
CPU with tagged traffic through an access port since the access port will tag all ingress traffic
with the specified default-vlan-id value.
When VLAN table is configured, you can enable vlan-mode=secure to limit access to the
CPU:
Untagged
In order to make the device accessible from the access port, create a VLAN interface with the
same VLAN ID as set in default-vlan-id , for example VLAN 100, and add an IP address
to it:
/interface vlan
add name=VLAN100 vlan-id=100 interface=bridge1
/ip address
add address=192.168.100.1/24 interface=VLAN100
Specify which access (untagged) ports are allowed to access the CPU:
Warning: Most commonly an access (untagged) port is accompanied with a trunk (tagged)
port. In case of untagged access to the CPU, you are forced to specify both the access port
and the trunk port, this gives access to the CPU from the trunk port as well. Not always this is
desired and Firewall might be required on top of VLAN filtering.
When VLAN table is configured, you can enable vlan-mode=secure to limit access to the
CPU:
/ip address
add address=10.0.0.1/24 interface=bridge1
Specify the trunk port to be able to access the CPU for the default-vlan-id for the trunk
port, by default it is set to 1:
When VLAN table is configured, you can enable vlan-mode=secure to limit access to the
CPU:
/interface ethernet
set ether2 master-port=ether1
set ether3 master-port=ether1
set ether4 master-port=ether1
Slave ports are dynamically added to the bridge only to show STP status. Forwarding
through switched ports still are handled by hardware switch chip.
Applies to RouterOS:v6.12 +
Contents
[hide]
1Summary
2Cloud Router Switch models
3Cloud Router Switch configuration examples
4Abbreviations and Explanations
5Port Switching
o 5.1Bridge Hardware Offloading
6Global Settings
7Port Settings
8Forwarding Databases
o 8.1Unicast FDB
o 8.2Multicast FDB
o 8.3Reserved FDB
9VLAN
o 9.1VLAN Table
o 9.2Egress VLAN Tag
o 9.3Ingress/Egress VLAN Translation
o 9.4Protocol Based VLAN
o 9.5MAC Based VLAN
o 9.61:1 VLAN Switching
10Port Isolation/Leakage
11Trunking
12Quality of Service
o 12.1Shaper
o 12.2Ingress Port Policer
o 12.3QoS Group
o 12.4DSCP QoS Map
o 12.5DSCP To DSCP Map
o 12.6Policer QoS Map
13Access Control List
o 13.1ACL
o 13.2ACL Policer
Summary
The Cloud Router Switch series are highly integrated switches with high performance MIPS
CPU and feature-rich packet processor. The CRS switches can be designed into various
Ethernet applications including unmanaged switch, Layer 2 managed switch, carrier switch and
wireless/wired unified packet processing.
Warning: This article applies to CRS1xx and CRS2xx series switches and not to CRS3xx
series switches. For CRS3xx series devices read the CRS3xx series switches manual.
Features
CRS10
400M
5-5S- QCA-8511 - - + 9204
Hz
FB
CRS10
400M
6-1C- QCA-8511 - - + 9204
Hz
5S
CRS11
400M
2-8G- QCA-8511 - - + 9204
Hz
4S
CRS21
400M
0-8G- QCA-8519 - + + 9204
Hz
2S+
CRS21
2-1G- 400M
QCA-8519 - + + 9204
10S- Hz
1S+
CRS22
400M
6-24G- QCA-8519 - + + 9204
Hz
2S+
CRS12
QCA- 600M
5-24G- - - - 4064
8513L Hz
1S
Switch Wirele SFP+ Access Control Jumbo Frame
Model CPU
Chip ss port List (Bytes)
CRS12
5-24G- QCA- 600M
+ - - 4064
1S- 8513L Hz
2HnD
CRS10
9-8G- QCA- 600M
+ - - 4064
1S- 8513L Hz
2HnD
And there are configured 3 switch groups: 1) ether2, ether3, ether4, ether5, ether6; 2) ether13,
ether14, ether15, ether16, ether17, ether18, ether19, ether20; 3) ether21, ether22, ether23,
ether24, sfp1.
Ports ether1, ether7-ether12 are not switched in this example, they remain as independent
router ports.
In essence this configuration is the same as if you had a RouterBoard with 10 Ethernet
interfaces and 3 switches:
CRS Port Switching Logic
Note: Dynamic reserved VLAN entries (VLAN4091; VLAN4090; VLAN4089; etc.) are created
in CRS switch when switched port groups are added by setting new master-ports. These
VLANs are necessary for internal operation and have lower precedence than user configured
VLANs.
Note: Multiple master-port configuration is designed as fast and simple port isolation solution,
but it limits a part of VLAN functionality supported by CRS switch-chip. For advanced
configurations use one master-port within CRS switch chip for all ports, configure VLANs and
isolate port groups with port isolation profile configuration.
Note: Downgrading to previous RouterOS versions will not restore master-port configuration.
The bridge with no hw-offload will appear instead and master-port configuration will have to be
redone from the beginning.
Following table states what features currently in v6.41 keep bridge hardware offloading
enabled on certain RouterBoard and switch chip models.
Notes:
CRS3xx series + + + + + +
CRS1xx/CRS2xx
+ + - + - -
series
[QCA8337] + + - - - -
Bridge Bridge Bridge
RouterBoard/[Sw Features in Bridge Bon
STP/RST IGMP VLAN
itch Chip] Model Switch menu MSTP ding
P Snooping Filtering
[AR8327] + + - - - -
[AR8227] + + - - - -
[AR8316] + + - - - -
[AR7240] + + - - - -
[MT7621] + - - - - -
RB1100AHx4
+ - - - - -
[RTL8367]
[ICPlus175D] + - - - - -
Port switching with bridge configuration and enabled hw-offload since v6.41
Global Settings
Sub-menu: /interface ethernet switch
CRS switch chip is configurable from the /interface ethernet switch console menu.
Property
multicast-lookup-mode Lo
(dst-ip-and-vid-for-ipv4 | dst-mac-and-vid-always;
Default:dst-ip-and-vid-for-ipv4)
Property
drop-if-invalid-or-src-port- Po
-not-member-of-vlan-on-ports
(ports; Default: none)
Property
bypass-vlan-ingress-filter-for (protocols; Default: none) Pr
pr
ea
Property
Port Settings
Sub-menu: /interface ethernet switch port
Property
!isolation-leakage-profile-override)
isolation-leakage-profile (0..31;)
so
br
Property
Property
Property
Property
per-queue-scheduling (Scheduling-type:Weight; Se
qu
Default: wrr-group0:1,wrr-group0:2,wrr-group0:4,wrr-group0:8,wrr-group0:16,wrr-group0:32,
wrr-group0:64,wrr-group0:128)
Property
Property
an
an
Forwarding Databases
Unicast FDB
port (port) Ma
Multicast FDB
CRS125 switch-chip supports up to 1024 entries in MFDB for multicast forwarding. For each
multicast packet, destination MAC or destination IP lookup is performed in MFDB. MFDB
entries are not automatically learnt and can only be configured.
Property
ports (ports) Me
Reserved FDB
Cloud Router Switch supports 256 RFDB entries. Each RFDB entry can store either Layer2
unicast or multicast MAC address with specific commands.
Property
VLAN
VLAN Table
The VLAN table supports 4096 VLAN entries for storing VLAN member information as well as
other VLAN information such as QoS, isolation, forced VLAN, learning, and mirroring.
Property
ports (ports) Me
Egress packets can be assigned different VLAN tag format. The VLAN tags can be removed,
added, or remained as is when the packet is sent to the egress port (destination port). Each
port has dedicated control on the egress VLAN tag format. The tag formats include:
Untagged
Tagged
Unmodified
The Egress VLAN Tag table includes 4096 entries for VLAN tagging selection.
Property
tagged-ports (ports) Po
vlan-id (0..4095) VL
Property
ports (ports) Ma
Below is a table of traffic that triggers a rule that has a certain VLAN format set, note that traffic
that is tagged with VLAN ID 0 is a special case that is also taken into account.
Property
any Ac
priority-tagged-or-tagged Ac
tagged Ac
untagged-or-tagged Ac
Protocol Based VLAN table is used to assign VID and QoS attributes to related protocol packet
per port.
Property
ports (ports) Ma
MAC Based VLAN table is used to assign VLAN based on source MAC.
Property
Note: All CRS1xx/2xx series switches support up to 1024 MAC Based VLAN table entries.
1:1 VLAN switching can be used to replace the regular L2 bridging for matched packets. When
a packet hits an 1:1 VLAN switching table entry, the destination port information in the entry is
assigned to the packet. The matched destination information in UFDB and MFDB entry no
longer applies to the packet.
Property
dst-port (port) De
Port Isolation/Leakage
Sub-menu: /interface ethernet switch port-isolation
The CRS switches support flexible multi-level isolation features, which can be used for user
access control, traffic engineering and advanced security and network management. The
isolation features provide an organized fabric structure allowing user to easily program and
control the access by port, MAC address, VLAN, protocol, flow and frame type. The following
isolation and leakage features are supported:
Port-level isolation
MAC-level isolation
VLAN-level isolation
Protocol-level isolation
Flow-level isolation
Free combination of the above
Port-level isolation supports different control schemes on source port and destination port.
Each entry can be programmed with access control for either source port or destination port.
When the entry is programmed with source port access control, the entry is
applied to the ingress packets.
When the entry is programmed with destination port access control, the entry
is applied to the egress packets.
Port leakage allows bypassing egress VLAN filtering on the port. Leaky port is allowed to
access other ports for various applications such as security, network control and management.
Note: When both isolation and leakage is applied to the same port, the port is isolated.
Property
Trunking
Sub-menu: /interface ethernet switch trunk
The Trunking in the Cloud Router Switches provides static link aggregation groups with
hardware automatic failover and load balancing. IEEE802.3ad and IEEE802.1ax compatible
Link Aggregation Control Protocol is not supported yet. Up to 8 Trunk groups are supported
with up to 8 Trunk member ports per Trunk group. CRS Port Trunking calculates transmit-hash
based on all following parameters: L2 src-dst MAC + L3 src-dst IP + L4 src-dst Port.
Property
member-ports (ports) Me
Quality of Service
Shaper
Property
port (port) Ph
Property
port (port) Ph
rate (integer) Ma
QoS Group
The global QoS group table is used for VLAN-based, Protocol-based and MAC-based QoS
group assignment configuration.
Property
dei (0..1) Th
pcp (0..7) Th
priority (0..15) Th
The global DSCP to DSCP mapping table is used for mapping from the packet's original DSCP
to new DSCP value configured in the table.
Property
new-dscp (0..63) Th
Property
Note: See Summary section for Access Control List supported Cloud Router Switch devices.
Access Control List contains of ingress policy and egress policy engines and allows to
configure up to 128 policy rules (limited by RouterOS). It is advanced tool for wire-speed
packet filtering, forwarding, shaping and modifying based on Layer2, Layer3 and Layer4
protocol header field conditions.
ACL
src-ports (ports,trunks) Ma
dst-ports (ports,trunks) Ma
custom-fields
lookup-vid (0..4095) VL
service-vid (0-4095) Ma
service-pcp (0..7) Ma
service-dei (0..1) Ma
customer-vid (0-4095) Ma
customer-pcp (0..7) Ma
customer-dei (0..1) Ma
priority (0..15) Ma
ACL condition part for IPv4 and IPv6 related fields of packets.
Property
ip-src (IPv4/0..32) Ma
ip-dst (IPv4/0..32) Ma
ip-protocol (tcp | udp | udp-lite | other) IP
src-l3-port (0-65535) Ma
dst-l3-port (0-65535) Ma
dscp (0..63) Ma
ecn (0..3) Ma
ipv6-src (IPv6/0..128) Ma
ipv6-dst (IPv6/0..128) Ma
flow-id (0..63)
new-dst-ports (ports,trunks) If a
policer (policer) Ap
src-mac-learn (yes | no) W
new-service-vid (0..4095) Ne
new-service-pcp (0..7) Ne
new-service-dei (0..1) Ne
new-customer-vid (0..4095) Ne
new-customer-pcp (0..7) Ne
new-customer-dei (0..1) Ne
new-dscp (0..63) Ne
new-priority (0..15) Ne
new-flow-id (0..63)
Property
yellow-rate (integer) Ma
Applies to RouterOS:v6.41 +
Contents
[hide]
1Summary
o 1.1Features
o 1.2Models
o 1.3Abbreviations
2Port Switching
o 2.1Example
3Host Table
o 3.1Example
4VLAN
o 4.1VLAN Filtering
o 4.2VLAN Table
o 4.3Setup examples
4.3.1Port Based VLAN
4.3.2MAC Based VLAN
4.3.3Protocol Based VLAN
4.3.4VLAN Tunneling (Q-in-Q)
4.3.5Ingress VLAN translation
5(R/M)STP
6Bonding
7Port isolation
8IGMP Snooping
9Mirroring
10Quality of Service (QoS)
11Traffic Storm Control
12MPLS hardware offloading
13Switch Rules (ACL)
14Port Security
15Dual Boot
16Configuring SwOS using RouterOS
17See also
Summary
The Cloud Router Switch series are highly integrated switches with high performance ARM
CPU and feature-rich packet processor. The CRS switches can be designed into various
Ethernet applications including unmanaged switch, Layer 2 managed switch, carrier switch and
wired unified packet processing.
Warning: This article applies to CRS3xx series switches and not to CRS1xx/CRS2xx series
switches.
Features
Features
Forwarding Configurable ports for switching or routing
Full non-blocking wirespeed switching
Up to 16k MAC entries in Unicast FDB for Layer 2 u
Forwarding Databases works based on IVL
Jumbo frame support
IGMP Snooping support
Mirroring Various types of mirroring:
Port based mirroring
VLAN based mirroring
MAC based mirroring
Models
This table clarifies main differences between Cloud Router Switch models.
CRS32
Marvell- 800M
6-24G- 1 - + + 10218
98DX3236 Hz
2S+
CRS32
Marvell- 800M
8-24P- 1 - + + 10218
98DX3236 Hz
4S+
CRS32
8-4C- Marvell- 800M
1 - + + 10218
20S- 98DX3236 Hz
4S+
CRS31
Marvell- 800M
7-1G- 2 - + + 10218
98DX8216 Hz
16S+
Abbreviations
FDB - Forwarding Database
MDB - Multicast Database
SVL - Shared VLAN Learning
IVL - Independent VLAN Learning
PVID - Port VLAN ID
ACL - Access Control List
CVID - Customer VLAN ID
SVID - Service VLAN ID
Port Switching
Since v6.41 bridges will handle all Layer2 forwarding and the use of switch chip ( hw-offload )
will automatically turn on if appropriate conditions are met. The rest of RouterOS Switch
features remain untouched in usual menus. By default all newly created bridge ports
have hw=yes option and it allows enabling of hw-offload when possible. If such
functionality is not required, it can be disabled by hw=no on bridge port to have completely
software operated bridging.
Note: Downgrading to previous RouterOS versions will not restore master-port configuration.
The bridge with no hw-offload will appear instead and master-port configuration will have to be
redone from the beginning.
Example
Use the command lines below to create a bridge and add ports to it. On CRS3xx using other
bridge protocol modes will also enable hardware offloading.
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
Make sure that hardware offloading is enabled. If H flag is available next to the desired
interface, then hardware offloading is active on that port. If hardware offloading flag is not
shown, then make sure you haven't enabled features that disable hardware offloading.
Note: Currently it is possible to create only one bridge with hardware offloading on CRS3xx
series devices. Use the hw parameter to select which bridge will use hardware offloading.
Note: On CRS3xx series switches bridge STP/RSTP/MSTP, IGMP Snooping and VLAN
filtering settings don't affect hardware offloading, since RouterOS v6.42 Bonding interfaces are
also hardware offloaded.
Host Table
Sub-menu: /interface bridge host
Property
age (read-only: time) The time since the last pac
bridge (read-only: name) The bridge the entry belon
external-fdb (read-only: flag) Whether the host was learn
local (read-only: flag) Whether the host entry is o
mac-address (read-only: MAC address) Host's MAC address
on-interface (read-only: name) Which of the bridged inter
Example
Use this command to get the active host table:
VLAN
Since RouterOS v6.41 bridges provides VLAN aware Layer2 forwarding and VLAN tag
modifications within the bridge. This set of features makes bridge operation more like a
traditional Ethernet switch and allows to overcome Spanning Tree compatibilty issues
compared to configuration when tunnel-like VLAN interfaces are bridged. Bridge VLAN Filtering
configuration is highly recommended to comply with STP (802.1D), RSTP (802.1w) standards
and is mandatory to enable MSTP (802.1s) support in RouterOS.
VLAN Filtering
The main VLAN setting is vlan-filtering which globally controls vlan-awareness and
VLAN tag processing in the bridge. If vlan-filtering=no , bridge ignores VLAN tags, works
in a shared-VLAN-learning (SVL) mode and cannot modify VLAN tags of packets. Turning
on vlan-filtering enables all bridge VLAN related functionality and independent-VLAN-
learning (IVL) mode. Besides joining the ports for Layer2 forwarding, bridge itself is also an
interface therefore it has Port VLAN ID (pvid).
Note: Since RouterOS v6.41 all switching related parameters are moved to the bridge section.
On CRS3xx series devices VLAN switching must be configured under the bridge section as
well, this will not limit the device's performance, CRS3xx is designed to use the built-in switch
chip to work with bridge VLAN filtering, you are able to achieve full non-blocking wire-speed
switching performance while using bridges and bridge VLAN filtering. Make sure that all bridge
ports have the "H" flag, which indicates that the device is using the switch chip to forward
packets.
Property
vlan-filtering (yes | no; Default: no) Gl
pvid (1..4094; Default: 1) Po
fro
Property
frame-types (admit-all | admit-only-untagged-and-priority-tagged | admit-only-vlan-tagged; Default: admit-all) Sp
ingress-filtering (yes | no; Default: no) En
bri
pvid (1..4094; Default: 1) Po
VLAN Table
Bridge VLAN table represents per-VLAN port mapping with an egress VLAN tag
action. tagged ports send out frames with a learned VLAN ID tag. untagged ports remove
VLAN tag before sending out frames if the learned VLAN ID matches the port pvid .
Property
bridge (name) Th
disabled (yes | no; Default: no) En
tagged (interfaces; Default: none) Int
E.
vlan-ids (1..4094) Th
va
Setup examples
Port Based VLAN
The configuration for CRS3xx switches is described in the Bridge VLAN FIltering section.
Note: It is possible to use the built-in switch chip and the CPU at the same time to create a
Switch-Router setup, where a device acts as a switch and as a router at the same time. You
can find a configuration example in the CRS-Router guide.
Note: The CRS3xx Switch Rule table is used for MAC Based VLAN functionality, it supports up
to 128 entries.
/interface bridge
add name=bridge1 vlan-filtering=yes
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
Note: The CRS3xx Switch Rule table is used for Protocol Based VLAN functionality, it supports
up to 128 entries.
/interface bridge
add name=bridge1 vlan-filtering=yes
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Add VLANs in the Bridge VLAN table and specify ports.
/interface bridge
add name=bridge1 vlan-filtering=no
/interface bridge port
add interface=ether1 bridge=bridge1 hw=yes
add interface=ether2 bridge=bridge1 hw=yes
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
(R/M)STP
Network loops may emerge (intentionally or not) in complex topologies. Without any special
treatment, loops would prevent network from functioning normally, as they would lead to
avalanche-like packet multiplication. Each bridge runs an algorithm which calculates how the
loop can be prevented. STP and RSTP allows bridges to communicate with each other, so they
can negotiate a loop free topology. All other alternative connections that would otherwise form
loops, are put to standby, so that should the main connection fail, another connection could
take its place. This algorithm exchanges configuration messages (BPDU - Bridge Protocol
Data Unit) periodically, so that all bridges are updated with the newest information about
changes in network topology. (R/M)STP selects a root bridge which is responsible for network
reconfiguration, such as blocking and opening ports on other bridges. The root bridge is the
bridge with the lowest bridge ID.
As of RouterOS v6.41 all CRS3xx series switches support (R/M)STP bridge protocol mode and
hardware offloading simultaneously, meaning that it possible to use the switch chip's built-in
VLAN filtering function in conjunction with bridge's Spanning Tree Protocol features and
forward packets at wire-speed. There are a lot of considerations that should be made when
designing a STP enabled network, more detailed case studies can be found in the Spanning
Tree Protocol section.
Property
protocol-mode (mstp | none | rstp | stp; Default: rstp)
Bonding
Since RouterOS v6.42 all CRS3xx series switches support hardware offloading with bonding
interfaces. Only 802.3ad and balance-xor bonding modes are hardware offloaded, other
bonding modes will use the CPU's resources. You can find more information about the bonding
interfaces in the Bonding Interface section. If 802.3ad mode is used, then LACP (Link
Aggregation Control Protocol) is supported.
To create a hardware offloaded bonding interface, you must create a bonding interface with a
supported bonding mode:
/interface bonding
add mode=802.3ad name=bond1 slaves=ether1,ether2
/interface bridge
add name=bridge
/interface bridge port
add bridge=bridge interface=bond1 hw=yes
add bridge=bridge interface=ether3 hw=yes
add bridge=bridge interface=ether4 hw=yes
Note: Don't add interfaces to a bridge that are already in a bond, RouterOS will not allow you
to add an interface that is already a slave to a bridge as there is no need to do it since a
bonding interface already contains the slave interfaces.
Make sure that the bonding interface is hardware offloaded by checking the "H" flag:
Note: The built-in switch chip will always use Layer2+Layer3+Layer4 for transmit hash policy,
changing the transmit hash policy manually will have no effect.
Port isolation
Since RouterOS v6.43rc11 is it possible to create a Private VLAN setup on CRS3xx series
switches, example can be found in the Switch chip port isolation manual page.
IGMP Snooping
IGMP Snooping which controls multicast streams and prevents multicast flooding is
implemented in RouterOS starting from version 6.41. It's settings are placed in bridge menu
and it works independently in every bridge interface. Software driven implementation works on
all devices with RouterOS but CRS1xx/2xx/3xx series switches also support IGMP Snooping
with hardware offloading.
ether2
ether1
bridge1 300 231.1.3.3
ether4
ether3
ether2
bridge1 400 229.10.10.4
ether4
ether3
bridge1 500 234.5.1.5
ether5
ether1
Mirroring
Mirroring lets the switch 'sniff' all traffic that is going in a switch chip and send a copy of those
packets out to another port (mirror-target). This feature can be used to easily set up a 'tap'
device that allows you to inspect the traffic on your network on a traffic analyzer device. It is
possible to set up a simple port based mirroring where, but it is also possible to setup more
complex mirroring based on various parameters. Note that mirror-target port has to belong to
same switch. (See which port belong to which switch in /interface ethernet menu). Also
mirror-target can have a special 'cpu' value, which means that 'sniffed' packets will be sent out
of switch chips cpu port. There are many possibilities that can be used to mirror certain traffic,
below you can find most common mirroring examples:
/interface bridge
set bridge1 vlan-filtering=yes
/interface ethernet switch
set switch1 mirror-target=ether3 mirror-source=none
/interface ethernet switch rule
add mirror=yes ports=ether1 switch=switch1 vlan-id=11
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
IP Based Mirroring
There are other options as well, check the ACL section to find out all possible parameters that
can be used to match packets.
/interface bridge
set bridge1 vlan-filtering=yes
/interface ethernet switch rule
add ports=ether1 switch=switch1 vlan-id=11 rate=10M
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
There are other options as well, check the ACL section to find out all possible parameters that
can be used to match packets.
Note: The CRS3xx Switch Rule table is used for QoS functionality, it supports up to 128
entries.
Note: The storm control parameter is specified in percentage (%) of the link speed. If your link
speed is 1Gbps, then specifying storm-rate as 10 will allow only 100Mbps of broadcast,
unknown multicast and/or unknown unicast traffic to be forwarded.
Property
limit-broadcasts (yes | no; Default: yes) Limit broadcast traffic on
limit-unknown-multicasts (yes | no; Default: no) Limit unknown multicast t
limit-unknown-unicasts (yes | no; Default: no) Limit unknown unicast tra
storm-rate (integer 0..100; Default: 100) Amount of broadcast, unk
Warning: Devices with Marvell-98DX3236 switch chip cannot distinguish unknown multicast
traffic from all multicast traffic. For example, CRS326-24G-2S+ will limit all multicast traffic
when limit-unknown-multicasts and storm-rate is used. For other devices, for
example, CRS317-1G-16S+ the limit-unknown-multicasts parameter will limit only
unknown multicast traffic (addresses that are not present in /interface bridge mdb
For example, to limit 1% (10Mbps) of broadcast and unknown unicast traffic on ether1
(1Gbps), use the following commands:
Note: Currently only CRS317-1G-16S+ using RouterOS v6.41 and newer is capable of
hardware offloading certain MPLS functions. CRS317-1G-16S+ built-in switch chip is not
capable of popping MPLS labels from packets, in a PE-P-PE setup you either have to use
explicit null or disable TTL propagation in MPLS network to achieve hardware offloading.
Property
copy-to-cpu (no | yes; Default: no) Cl
disabled (yes | no; Default: no) En
dscp (0..63) M
dst-address (IP address/Mask) M
dst-address6 (IPv6 address/Mask) M
dst-mac-address (MAC address/Mask) M
dst-port (0..65535) M
flow-label (0..1048575) M
mac-protocol (802.2 | arp | homeplug-av | ip | ipv6 | ipx | lldp | loop-protect | mpls-multicast | mpls-unicast | M
packing-compr | packing-simple | pppoe | pppoe-discovery | rarp | service-vlan | vlan | or 0..65535 | or 0x0000-0xffff)
mirror (no | yes) Cl
new-dst-ports (ports) Ch
pa
on
new-vlan-id (0..4095) Ch
new-vlan-priority (0..7) Ch
ports (ports) M
protocol (dccp | ddp | egp | encap | etherip | ggp | gre | hmp | icmp | icmpv6 | idpr-cmtp | igmp | ipencap | ipip | M
ipsec-ah | ipsec-esp | ipv6 | ipv6-frag | ipv6-nonxt | ipv6-opts | ipv6-route | iso-tp4 | l2tp | ospf | pim | pup | rdp | rspf |
rsvp | sctp | st | tcp | udp | udp-lite | vmtp | vrrp | xns-idp | xtp | or 0..255)
redirect-to-cpu (no | yes) Ch
src-address (IP address/Mask) M
src-address6 (IPv6 address/Mask) M
src-mac-address (MAC address/Mask) M
src-port (0..65535) M
switch (switch group) M
traffic-class (0..255) M
vlan-id (0..4095) M
Action parameters:
copy-to-cpu
redirect-to-cpu
mirror
new-dst-ports (can be used to drop packets)
new-vlan-id
new-vlan-priority
rate
Conditional parameters:
Layer2 conditions:
dst-mac-address
mac-protocol
src-mac-address
vlan-id
vlan-header
vlan-priority
Layer3 conditions:
dscp
protocol
IPv4 conditions:
dst-address
src-address
IPv6 conditions:
dst-address6
flow-label
src-address6
traffic-class
Layer4 conditions:
dst-port
src-port
Note: For VLAN related matchers or VLAN related action parameters to work, you need to
enable vlan-filtering on the bridge interface and make sure that hardware offloading is
enabled on those ports, otherwise these parameters will not have any effect.
Warning: When vlan-protocol is set to 802.1Q, then VLAN related ACL rules are
relevant to 0x8100 (CVID) packets, this includes vlan-id and new-vlan-id .
When vlan-protocol is set to 802.1ad, then ACL rules are relevant to 0x88A8 (SVID)
packets. For example, with 802.1Q the vlan-id matcher will match CVID packets, but with
802.1ad the vlan-id matcher will match SVID packets.
Port Security
It is possible to limit allowed MAC addresses on a single switch port on CRS3xx series
switches. For example, to allow 64:D1:54:81:EF:8E start by switching multiple ports
together, in this example 64:D1:54:81:EF:8E is going to be located behind ether1.
Create an ACL rule to allow the given MAC address and drop all other traffic on ether1 (for
ingress traffic):
Switch all required ports together, disable MAC learning and disable unknown unicast
flooding on ether1:
/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes learn=no unknown-unicast-
flood=no
add bridge=bridge1 interface=ether2 hw=yes
Dual Boot
“Dual boot” feature allows you to choose which operating system you prefer to use, RouterOS
or SwOS. Device operating system could be changed using:
Note: By setting a static IP address you are not changing the IP address acquisition process,
which is DHCP with fallback by default. This means that the configured static IP
address will become active only when there is going to be no DHCP servers in the same
broadcast domain.
Note: The upgrade command will automatically install the latest available SwOS version, make
sure that your device has access to the Internet in order for the upgrade process to work
properly.
Applies to RouterOS:v6.41 +
Contents
[hide]
1Introduction
2CRS3xx series switches
3CRS1xx/CRS2xx series switches
4Other devices with built-in switch chip
5Other devices without a built-in switch chip
Introduction
Many MikroTik devices come with a built-in switch chips that usually have an option to do
VLAN switching on a hardware level, this means that you can achieve wire-speed performance
using VLANs if a proper configuration method is used. The configuration method changes
across different models, this guide will focus on setting up a basic trunk/access port setup with
a management port from the trunk port using different devices with the right configuration to
achieve best performance and to fully utilize the available hardware components.
Warning: Not all devices with a switch chip are capable of VLAN switching on a hardware
level, check the supported features for each switch chip, the compatibility table can be
found Here. If a device has VLAN table support, then it is capable of VLAN switching using
the built-in switch chip. You can check the device's switch chip either in the provided link or by
using /interface ethernet switch print
/interface bridge
add name=bridge1 protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
/interface ethernet switch vlan
add ports=ether1,ether2 switch=switch1 vlan-id=20
add ports=ether1,ether3 switch=switch1 vlan-id=30
add ports=ether1,switch1-cpu switch=switch1 vlan-id=99
/interface vlan
add interface=bridge1 vlan-id=99 name=MGMT
/ip address
add address=192.168.99.1/24 interface=MGMT
/interface ethernet switch port
set ether1 vlan-mode=secure vlan-header=add-if-missing
set ether2 vlan-mode=secure vlan-header=always-strip default-vlan-id=20
set ether3 vlan-mode=secure vlan-header=always-strip default-vlan-id=30
set switch1-cpu vlan-header=leave-as-is vlan-mode=secure
Note: This type of configuration should be used on RouterBOARD series devices, this includes
RB4xx, RB9xx, RB2011, RB3011, hAP, hEX, cAP and other devices.
/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1 hw=no
add bridge=bridge1 interface=ether2 hw=no pvid=20
add bridge=bridge1 interface=ether3 hw=no pvid=30
/interface bridge vlan
add bridge=bridge1 tagged=ether1 untagged=ether2,ether3 vlan-ids=20,30
add bridge=bridge1 tagged=ether1,bridge1 vlan-ids=99
/interface vlan
add interface=bridge1 vlan-id=99 name=MGMT
/ip address
add address=192.168.99.1/24 interface=MGMT
/interface bridge
set bridge1 vlan-filtering=yes
Manual:Layer2 misconfiguration
Applies to RouterOS:v6.41 +
Contents
[hide]
1Introduction
2Bridges on a single switch chip
o 2.1Configuration
o 2.2Problem
o 2.3Symptoms
o 2.4Solution
3Packet flow with hardware offloading and MAC learning
o 3.1Configuration
o 3.2Problem
o 3.3Symptoms
o 3.4Solution
4LAG interfaces and load balancing
o 4.1Configuration
o 4.2Problem
o 4.3Symptoms
o 4.4Solution
5VLAN interface on a slave interface
o 5.1Configuration
o 5.2Problem
o 5.3Symptoms
o 5.4Solution
6VLAN on a bridge in a bridge
o 6.1Configuration
o 6.2Problem
o 6.3Symptoms
o 6.4Solution
7VLAN in bridge with a physical interface
o 7.1Configuration
o 7.2Problem
o 7.3Symptoms
o 7.4Solution
8Bridged VLAN on physical interfaces
o 8.1Configuration
o 8.2Problem
o 8.3Symptoms
o 8.4Solution
9Bridge VLAN filtering on non-CRS3xx
o 9.1Configuration
o 9.2Problem
o 9.3Symptoms
o 9.4Solution
10MTU on master interface
o 10.1Configuration
o 10.2Problem
o 10.3Symptoms
o 10.4Solution
11MTU inconsistency
o 11.1Configuration
o 11.2Problem
o 11.3Symptoms
o 11.4Solution
12Bridge and reserved MAC addresses
o 12.1Configuration
o 12.2Problem
o 12.3Symptoms
o 12.4Solution
13Bandwidth testing
o 13.1Problem
o 13.2Symptoms
o 13.3Solution
14Bridge split-horizon usage
o 14.1Configuration
o 14.2Problem
o 14.3Symptoms
o 14.4Solution
Introduction
There are certain configuration that are known to have major flaws by design and should be
avoided by all means possible. Misconfigured Layer2 can sometimes cause hard to detect
network errors, random performance drops, certain segments of a network to be unreachable,
certain networking services to be malfunctioning or a complete network failure. This page will
contain some common and not so very common configurations that will cause issues in your
network.
Configuration
/interface bridge
add name=bridge1
add name=bridge2
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge2 interface=ether3
add bridge=bridge2 interface=ether4
Problem
After a simple performance test you might notice that one bridge is capable of forwarding traffic
at wire-speed while the second, third, ... bridge is not able to forward as much data as the first
bridge. Another symptom might be that there exists a huge latency for packets that need to be
routed. After a quick inspection you might notice that the CPU is always at full load, this is
because hardware offloading is not available on all bridges, but is available only on one bridge.
By checking the hardware offloading status you will notice that only one bridge has it active:
The reason why only one bridge has the hardware offloading flag available is because the
device does not support port isolation. If port isolation is not supported, then only one bridge
will be able to offload the traffic to the switch chip.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Not all device devices support port isolation, currently only CRS1xx/CRS2xx series devices
support it and only 7 isolated and hardware offloaded bridges are supported at the same time,
other devices will have to use the CPU to forward the packets on other bridges. This is usually
a hardware limitation and a different device might be required. Bridge split horizon parameter is
a software feature that disables hardware offloading and when using bridge filter rules you
need to enable forward all packets to the CPU, which requires the hardware offloading to be
disabled. You can control which bridge will be hardware offloaded with the hw=yes flag and by
setting hw=no to other bridges, for example:
Sometimes it is possible to restructure a network topology to use VLANs, which is the proper
way to isolate Layer2 networks.
Configuration
/interface bridge
add name=bridge
/interface bridge port
add bridge=bridge hw=yes interface=ether1
add bridge=bridge hw=yes interface=ether2
Problem
When hardware offloading is enabled, all packets are being processed by the built-in switch
chip, all MikroTik devices using a built-in switch chip are capable of MAC learning which makes
a switch a smart switch. The function of a smart switch is not to flood traffic to ports that are not
supposed to receive certain packets, because of MAC learning the switch chip will learn on
which ports a certain MAC address is located, the switch chip will send packets that are
destined to this address directly without flooding the packet to all ports. If the destination MAC
address is not known, then the packet is flooded to all ports, broadcast packets are always
flooded to all ports. Devices that have a switch chip have a port called switch-cpu port, this is
the port on which packets that are destined to the CPU will be received on. Because of this
behaviour packets that are destined to a learned MAC address are not sent to the CPU and
are not visible with /tool sniffer , this can be sometimes misleading since traffic is not
visible, but rx-bytes/tx-bytes counters are increasing, this behaviour is similar
to FastPath.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Packets with a destination MAC address that has been learned will not be sent to the CPU
since the packets are not not being flooded to all ports. If you do need to send certain packets
to the CPU for packet analyser or for Firewall, then it is possible to copy or redirect the packet
to the CPU by using ACL rules. Below is an example how to send a copy of packets that are
meant for 4C:5E:0C:4D:12:4B:
Note: If the packet is sent to the CPU, then the packet must be processed by the CPU, this
increases the CPU load.
LACP topology
Configuration
The following configuration is relevant to SW1 and SW2:
/interface bonding
add mode=802.3ad name=bond1 slaves=ether1,ether2
/interface bridge port
add bridge=bridge interface=bond1
add bridge=bridge interface=sfp-sfpplus1
Problem
After initial tests you immediately notice that the your network throughput never exceeds the
1Gbps limit even though the CPU load on the servers is low as well as on the network nodes
(switches in this case), but the throughput is still limited to only 1Gbps. The reason behind this
is because LACP (802.ad) uses transmit hash policy in order to determine if traffic can be
balanced over multiple LAG members, in this case a LAG interface does not create a 2Gbps
interface, but rather an interface that can balance traffic over multiple slave interface whenever
it is possible. For each packet a transmit hash is generated, this determines through which
LAG member will the packet be sent, this is needed in order to avoid packets being out of
order, there is an option to select the transmit hash policy, usually there is an option to choose
between Layer2 (MAC), Layer3 (IP) and Layer4 (Port), in RouterOS this can be selected by
using the transmit-hash-policy parameter. In this case the transmit hash is the same
since you are sending packets to the same destination MAC address, as well as the same IP
address and Iperf uses the same port as well, this generates the same transmit hash for all
packets and load balancing between LAG members is not possible. Note that now always
packets will get balanced over LAG members even though the destination is different, this is
because the standardized transmit hash policy can generate the same transmit hash for
different destinations, for example, 192.168.0.1/192.168.0.2 will get balanced, but
192.168.0.2/192.168.0.4 will NOT get balanced in case layer2-and-3 transmit hash policy is
used and the destination MAC address is the same.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Choose the proper transmit hash policy and test your network's throughput properly. The
simplest way to test such setups is to use multiple destinations, for example, instead of
sending data to just one server, rather send data to multiple servers, this will generate a
different transmit hash for each packet and will make load balancing across LAG members
possible. For some setups you might want to change the bonding interface mode to increase
the total throughput, for UDP traffic balance-rr mode might be sufficient, but can cause
issues for TCP traffic, you can read more about selecting the right mode for your setup Here.
VLAN interface on a slave interface
Consider the following scenario, you have created a bridge and you want a DHCP Server to
give out IP addresses only to a certain tagged VLAN traffic, for this reason you have created a
VLAN interface, specified a VLAN ID and created a DHCP Server on it, but for some reasons it
is not working properly.
Configuration
/interface bridge
add name=bridge
/interface bridge port
add interface=ether1 bridge=bridge
add interface=ether2 bridge=bridge
/interface vlan
add name=VLAN99 interface=ether1 vlan-id=99
/ip pool
add name=VLAN99_POOL range=192.168.99.100-192.168.99.200
/ip address add address=192.168.99.1/24 interface=VLAN99
/ip dhcp-server
add interface=VLAN99 address-pool=VLAN99_POOL disabled=no
/ip dhcp-server network
add address=192.168.99.0/24 gateway=192.168.99.1 dns-
server=192.168.99.1
Problem
When you add an interface to a bridge, the bridge becomes the master interface and all bridge
ports become slave ports, this means that all traffic that is received on a bridge port is captured
by the bridge interface and all traffic is forwarded to the CPU using the bridge interface instead
of the physical interface. As a result VLAN interface that is created on a slave interface will
never capture any traffic at all since it is immediately forwarded to the master interface before
any packet processing is being done. Usual side effect is that some DHCP clients receive IP
addresses and some don't.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Change the interface on which the VLAN interface will be listening for traffic, change it to the
master interface:
Configuration
/interface bridge
add name=bridge1
add name=bridge2
/interface vlan
add interface=bridge1 name=VLAN vlan-id=99
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge2 interface=VLAN
add bridge=bridge2 interface=ether3
Problem
Packets coming from ether3 will be sent out tagged and traffic won't be flooded
through ether1 and ether2, but if another port is added to bridge2, then traffic will be flooded.
Similar issue arises when traffic needs to be sent from ether1 to ether3 since MAC learning is
only possible between bridge ports and not interfaces that are created on top of the bridge
interface. As a result unicast traffic will be flooded to ether2 and ether3. If a device
behind ether3 is using (R)STP, then ether1 and ether2 will send out tagged BPDUs. Because
of the broken MAC learning functionality and broken (R)STP this setup and configuration must
be avoided. It is also known that in some setups this kind of configuration can prevent you from
connecting to the device by using MAC telnet.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Use bridge VLAN filtering. The proper way to tag traffic is to assign a VLAN ID whenever traffic
enters a bridge, this behaviour can easily be achieved by specifying PVID value for a bridge
port and specifying which ports are tagged (trunk) ports and which are untagged (access)
ports. Below is an example how such setup should have been configured:
/interface bridge
add name=bridge vlan-filtering=yes
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3 pvid=99
/interface bridge vlan
add bridge=bridge tagged=ether1 untagged=ether3 vlan-ids=99
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
Configuration
/interface vlan
add interface=ether1 name=VLAN99 vlan-id=99
/interface bridge
add name=bridge
/interface bridge port
add interface=ether2 bridge=bridge
add interface=VLAN99 bridge=bridge
Problem
This setup and configuration will work on most cases, but it violates the IEEE 802.1W standard
when (R)STP is used. If this is the only device in your Layer2 domain, then this should not
cause problems, but problems can arise when there are other vendor switches. The reason for
this is that (R)STP on a bridge interface is enabled by default and BPDUs coming
from ether1 will be sent out tagged since everything sent into ether1 will be sent out
through ether2 as tagged traffic, not all switches can understand tagged BPDUs. Precautions
should be made with this configuration in a more complex network where there are multiple
network topologies for certain (group of) VLANs, this is relevant to MSTP and PVSTP(+) with
mixed vendor devices. In a ring-like topology with multiple network topologies for certain
VLANs, one port from the switch will be blocked, but in MSTP and PVSTP(+) a path can be
opened for a certain VLAN, in such a situation it is possible that devices that don't support
PVSTP(+) will untag the BPDUs and forward the BPDU, as a result the switch will receive its
own packet, trigger a loop detection and block a port, this can happen to other protocols as
well, but (R)STP is the most common case. If a switch is using a BPDU guard function, then
this type of configuration can trigger it and cause a port to be blocked by STP. It has been
reported that this type of configuration can prevent traffic from being forwarded over certain
bridge ports over time when using 6.41 or later.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
To avoid compatibility issues you should use bridge VLAN filtering. Below you can find an
example how the same traffic tagging effect can be achieved with a bridge VLAN filtering
configuration:
/interface bridge
add name=bridge vlan-filtering=yes
/interface bridge port
add bridge=bridge interface=ether1 pvid=99
add bridge=bridge interface=ether2
/interface bridge vlan
add bridge=bridge tagged=ether2 untagged=ether1 vlan-ids=99
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
Configuration
Only the router part is relevant to this case, switch configuration doesn't really matter as long
as ports are switched. Router configuration can be found bellow:
/interface bridge
add name=bridge10
add name=bridge20
/interface vlan
add interface=ether1 name=ether1_v10 vlan-id=10
add interface=ether1 name=ether1_v20 vlan-id=20
add interface=ether2 name=ether2_v10 vlan-id=10
add interface=ether2 name=ether2_v20 vlan-id=20
/interface bridge port
add bridge=bridge10 interface=ether1_v10
add bridge=bridge10 interface=ether2_v10
add bridge=bridge20 interface=ether1_v20
add bridge=bridge20 interface=ether2_v20
Problem
You might notice that the network is having some weird delays or even the network is
unresponsive, you might notice that there is a loop detected (packet received with own MAC
address) and some traffic is being generated out of nowhere. The problem occurs because a
broadcast packet that is coming from either one of the VLAN interface created on
the Router will be sent out the physical interface, packet will be forwarded through the physical
interface, through a switch and will be received back on a different physical interface, in this
case broadcast packets sent out ether1_v10 will be received on ether2, packet will be
captured by ether2_v10, which is bridged with ether1_v10 and will get forwarded again the
same path (loop). (R)STP might not always detect this loop since (R)STP is not aware of any
VLANs, a loop does not exist with untagged traffic, but exists with tagged traffic. In this
scenario it is quite obvious to spot the loop, but in more complex setups it is not always easy to
detect the network design flaw. Sometimes this network design flaw might get unnoticed for a
very long time if your network does not use broadcast traffic, usually Nieghbor Discovery
Protocol is broadcasting packets from the VLAN interface and will usually trigger a loop
detection in such a setup. Sometimes it is useful to capture the packet that triggered a loop
detection, this can by using sniffer and analysing the packet capture file:
/tool sniffer
set filter-mac-address=4C:5E:0C:4D:12:44/FF:FF:FF:FF:FF:FF \
filter-interface=ether1 filter-direction=rx file-name=loop_packet.pcap
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Partial solution is to use Multiple Spanning Tree Protocol across the whole network, but it is
required to use bridge VLAN filtering in order to make all bridges compatible with IEEE 802.1W
and IEEE 802.1Q.
/interface bridge
add name=bridge vlan-filtering=yes
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
/interface bridge vlan
add bridge=bridge tagged=ether1,ether2,bridge vlan-ids=10,20
/interface vlan
add name=vlan10 interface=bridge vlan-id=10
add name=vlan20 interface=bridge vlan-id=20
Even though rewriting your configuration to use bridge VLAN filtering will fix loop occurrence
because of broadcast traffic that is coming from a VLAN interface, there still might exist loops
with tagged unknown unicast or broadcast traffic. To make sure that loops don't exist with
tagged and untagged traffic you should consider implementing MSTP in your network instead
of (R)STP.
Warning: By enabling vlan-filtering you will be filtering out traffic destined to the CPU,
before enabling VLAN filtering you should make sure that you set up a Management port
Configuration
/interface bridge
add name=bridge vlan-filtering=yes
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2 pvid=20
add bridge=bridge interface=ether3 pvid=30
add bridge=bridge interface=ether4 pvid=40
/interface bridge vlan
add bridge=bridge1 tagged=ether1 untagged=ether2 vlan-ids=20
add bridge=bridge1 tagged=ether1 untagged=ether3 vlan-ids=30
add bridge=bridge1 tagged=ether1 untagged=ether4 vlan-ids=40
Problem
For example, you use this configuration on a CRS1xx/CRS2xx series device and you started to
notice that the CPU usage is very high and when running a performance test to check the
network's throughput you notice that the total throughput is only a fraction of the wire-speed
performance that it should easily reach. The cause of the problem is that not all devices
support bridge VLAN filtering on a hardware level. All devices are able to be configured with
bridge VLAN filtering, but only few of them will be able to offload the traffic to the switch chip. If
improper configuration method is used on a device with a built-in switch chip, then the CPU will
be used to forward the traffic.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Before using bridge VLAN filtering check if your device supports it at the hardware level, table
with compatibility can be found at the Bridge Hardware Offloading section. Each type of device
currently requires a different configuration method, below is a list of which configuration should
be used on a device in order to use benefits of hardware offloading:
Configuration
/interface bridge
add name=bridge
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
/interface vlan
add interface=bridge name=VLAN99 vlan-id=99
Problem
As soon as you try to increase the MTU size on the VLAN interface, you receive an error that
RouterOS Could not set MTU. This can happen when you are trying to set MTU larger than
the L2MTU. In this case you need to increase the L2MTU size on all slave interfaces, which will
update the L2MTU size on the bridge interface. After this has been done, you will be able to set
a larger MTU on the VLAN interface. The same principle applies to bonding interfaces. You
can increase the MTU on interfaces like VLAN, MPLS, VPLS, Bonding and other interfaces
only when all physical slave interfaces have proper L2MTU set.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Increase the L2MTU on slave interfaces before changing the MTU on a master interface.
/interface ethernet
set ether1,ether2 l2mtu=9018
/interface vlan
set VLAN99 mtu=9000
MTU inconsistency
Consider the following scenario, you have multiple devices in your network, most of them are
used as a switch/bridge in your network and there are certain endpoints that are supposed to
receive and process traffic. To decrease the overhead in your network, you have decided to
increase the MTU size so you set a larger MTU size on both endpoints, but you start to notice
that some packets are being dropped.
Configuration
In this case both endpoints can be any type of device, we will assume that they are both Linux
servers that are supposed to transfer large amount of data. In such a scenario you would have
probably set something similar to this on ServerA and ServerB:
And on your Switch you have probably have set something similar to this:
/interface bridge
add name=bridge
/interface bridge port
add interface=ether1 bridge=bridge
add interface=ether2 bridge=bridge
Problem
This is a very simplified problem, but in larger networks this might not be very easy to detect.
For instance, ping might be working since a generic ping packet will be 70 bytes long (14 bytes
for Ethernet header, 20 bytes for IPv4 header, 8 bytes for ICMP header, 28 bytes for ICMP
payload), but data transfer might not work properly. The reason why some packets might not
get forwarded is that MikroTik devices running RouterOS by default has MTU set to 1500 and
L2MTU set to something around 1580 bytes (depends on the device), but the Ethernet
interface will silently drop anything that does not fit into the L2MTU size. Note that L2MTU
parameter is not relevant to x86 or CHR devices. For a device that is only supposed to forward
packets, there is no need to increase the MTU size, it is only required to increase the L2MTU
size, RouterOS will not allow you to increase the MTU size that is larger than the L2MTU size.
If you require the packet to be received on the interface and the device needs to process this
packet rather than just forwarding it, for example, in case of routing, then it is required to
increase the L2MTU and the MTU size, but you can leave the MTU size on the interface to the
default value if you are using only IP traffic (that supports packet fragmentation) and don't mind
that packets are being fragmented. You can use the ping utility to make sure that all devices
are able to forward jumbo frames:
/ping 192.168.88.1 size=9000 do-not-fragment
Remember that the L2MTU and MTU size needs to be larger or equal to the ping packet size
on the device from which and to which you are sending a ping packet, since ping (ICMP) is IP
traffic that is sent out from a interface over Layer3.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Web pages are not able to load up, but ping works properly
Tunnels dropping traffic
Specific protocols are broken
Large packet loss
Solution
Increase the L2MTU size on your Switch:
/interface ethernet
set ether1,ether2 l2mtu=9000
In case your traffic is encapsulated (VLAN, VPN, MPLS, VPLS or other), then you might need
to consider setting even a larger L2MTU size. In this scenario it is not needed to increase the
MTU size for the reason described above.
Note: Full frame MTU is not the same as L2MTU. L2MTU size does not include the Ethernet
header (14 bytes) and the CRC checksum (FCS) field. The FCS field is stripped by the
Ethernet's driver and RouterOS will never show the extra 4 bytes to any packet. For example, if
a you set MTU and L2MTU to 9000, then the full frame MTU is 9014 bytes long, this can also
be observed when sniffing packets with /tool sniffer quick
Configuration
For both devices DeviceA and DeviceB there should be a very similar configuration.
/interface bridge
add name=bridge1 protocol-mode=rstp
/interface bridge port
add interface=ether1 bridge=bridge1
add interface=eoip1 bridge=bridge1
Problem
Both devices are able to communicate with each other, but some protocols do not work
properly. The reason is that as soon as you use any STP variant (STP, RSTP, MSTP), you
make the bridge compliant with IEEE 802.1D and IEEE 802.1Q, these standards recommend
that packets that are destined to 01:80:C2:XX:XX:XX should NOT be forwarded. In cases
where there are only 2 ports added to a bridge (R/M)STP should not be used since a loop
cannot occur from 2 interfaces and if a loop does occur, the cause is elsewhere and should be
fixed on a different bridge. Since (R/M)STP is not needed in transparent bridge setups, it can
be disabled. As soon as (R/M)STP is disabled, the RouterOS bridge is not compliant with IEEE
802.1D and IEEE 802.1Q and therefore will forward packets that are destined
to 01:80:C2:XX:XX:XX.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Solution
Since RouterOS v6.43rc13 it is possible to partly disable compliance with IEEE 802.1D and
IEEE 802.1Q, this can be done by changing the bridge protocol mode.
/interface bridge
set bridge1 protocol-mode=none
Warning: The 802.1x standard is meant to be used between a switch and a client directly. If it
is possible to connect a device between the switch and the client, then this creates a security
threat. For this reason it is not recommended to disable the compliance with IEEE 802.1D and
IEEE 802.1Q, but rather design a proper network topology.
Bandwidth testing
Consider the following scenario, you set up a link between two devices, this can be any link, an
Ethernet cable, a Wireless link, a tunnel or any other connection. You decide that you want to
test the link's bandwidth, but for convenience reasons you decide to start testing the link the
same devices that are running the link.
Problem
As soon as you start Bandwidth test or Traffic generator you notice that the throughput is much
smaller than expected. For very powerful routers, which should be able to forward many
Gigabits per second (Gbps) you notice that only a few Gigabits per second gets forwarded.
The reason why this is happening is because of the testing method you are using, you should
never test throughput on a router while using the same router for generating traffic, this is
especially true when using Bandwidth test since it is only able to generate traffic on a single
CPU core and also applies when using Traffic-generator, though it can run on multiple cores,
but you are still adding a load on the CPU that reduces the total throughput.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Low throughput
High CPU usage on one CPU core
Solution
Use a proper testing method. Don't use Bandwidth-test to test large capacity links and don't run
any tool that generates traffic on the same device you are testing. Design your network
properly so you can attach devices that will generate and receive traffic on both ends. If you
are familiar with Iperf, then this concept should be clear. Remember that in real world a router
or a switch does not generate traffic, a server/client generates the traffic while a router/switch
forwards the traffic (and does some manipulations to the traffic in appropriate cases).
Proper way to test bandwidth or throughput
Configuration
/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 horizon=1 hw=no interface=ether1
add bridge=bridge1 horizon=2 hw=no interface=ether2
add bridge=bridge1 horizon=3 hw=no interface=ether3
add bridge=bridge1 horizon=4 hw=no interface=ether4
Problem
After setting the bridge split-horizon on each port, you start to notice that each port is still able
to send data between each other. The reason for this is misuse of bridge split-horizon. A bridge
port is only not able to communicate with ports that are in the same horizon, for example,
horizon=1 is not able to communicate with horizon=1, but is able to communicate with
horizon=2, horizon=3 and so on.
Symptoms
Below is a list of possible symptoms that might be as a result of this kind of a misconfiguration:
Traffic is being forwarded on different bridge split-horizons
Solution
Set a proper value as the bridge split-horizon. In case you want to isolate each port from each
other (common scenario for PPPoE setups) and each port is only able to communicate with the
bridge port itself, then all ports must be in the same bridge split-horizon.
Manual:Switch Router
Applies to RouterOS:v6.41 +
Contents
[hide]
1Port switching
2DHCP and NAT
3VLAN switching
4Isolated VLANs
Many MikroTik's devices come with a built-in switch chip that can be used to greatly improve
overall throughput when configured properly. Devices with a switch chip can be used as a
router and a switch at the same time, this gives you the possibility to use a single device
instead of multiple devices for your network.
Switch-router topology
Warning: Not all devices are designed to handle large amounts of traffic through the CPU, for
this reason be very careful when designing your network since large amounts of traffic that are
passing through the CPU will overload it. Functions that depend on the CPU (for example, NAT
and DHCP) will not work properly when the CPU is overloaded.
Note: This guide is meant for devices that have a switch chip and are capable of using the
switch chip's VLAN table, make sure that your device has hardware support for this feature,
feature list per switch chip can be found here. For CRS series devices you should check
the CRS Router guide, this guide should be used for devices that don't have a built-in switch
chip as well (should be configured like CRS3xx series switches).
Port switching
For this type of setup to work, you must switch all required ports together:
/interface bridge
add name=bridge1 protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
/interface vlan
add interface=bridge1 name=VLAN10 vlan-id=10
add interface=bridge1 name=VLAN20 vlan-id=20
/ip address
add address=192.168.10.1/24 interface=VLAN10
add address=192.168.20.1/24 interface=VLAN20
/ip pool
add name=POOL10 ranges=192.168.10.100-192.168.10.200
add name=POOL20 ranges=192.168.20.100-192.168.20.200
/ip dhcp-server
add address-pool=POOL10 disabled=no interface=VLAN10 name=DHCP10
add address-pool=POOL20 disabled=no interface=VLAN20 name=DHCP20
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=8.8.8.8 gateway=192.168.10.1
add address=192.168.20.0/24 dns-server=8.8.8.8 gateway=192.168.20.1
VLAN switching
Add each port to the VLAN table and allow these ports to access the CPU in order to make
DHCP and routing to work:
Specify each port to be as an access port, enable secure VLAN mode on each port and on the
switch1-cpu port:
Isolated VLANs
In case your devices has a rule table, then you can limit access between VLANs on a hardware
level. As soon as you add an IP address on the VLAN interface you enable interVLAN routing,
but this can be limited on a hardware level yet preserving DHCP Server and other router
related services' functionality. To do so, use these ACL rules:
And you are done! With this type of configuration you can achieve isolated port groups using
VLANs.
Vvvvvv
Applies to RouterOS:v6.32 +
Contents
[hide]
1Summary
2Port switching
3Port trunking
4Management IP
5Bonding
6Port based VLAN
7Invalid VLAN filtering
8InterVLAN routing
9DHCP-Server
10Jumbo frames
11See also
Summary
This page will show how to configure multiple switches to use port trunking and port based
VLANs, it will also show a working example with a DHCP-Server, interVLAN routing,
management IP and invalid VLAN filtering configuration.
Warning: This article applies to CRS1xx and CRS2xx series switches and not to CRS3xx
series switches. For a similar setup for CRS3xx series switches you can check the CRS3xx
VLANs with Bonds guide.
CRS1xx/CRS2xx port trunking with port based VLANs
Note: Configuration is written for CRS125-24G-1S and CRS226-24G-2S+, but will work on
other CRS1xx/CRS2xx series switches as well.
In this setup SwitchA and SwitchC will tag all traffic from ports ether3-ether6 to VLAN ID 10,
ether7-ether12 to VLAN ID 20, ether13-ether18 to VLAN ID 30, ether19-ether24 to VLAN ID
40. SwitchB will tag all traffic from ports ether9-ether12 to VLAN ID 10, ether13-ether16 to
VLAN ID 20, ether17-ether20 to VLAN ID 30, ether21-ether24 to VLAN ID 40. Management will
only be possible if user is connecting with tagged traffic with VLAN ID 99. SFP port is not used
in this setup at all, consider disabling it if not being used.
Port switching
All switches in this setup require that all used ports are switched together. Use these
commands on SwitchA, SwitchB, SwitchC:
/interface ethernet
set [ find default-name=ether2 ] master-port=ether1
set [ find default-name=ether3 ] master-port=ether1
set [ find default-name=ether4 ] master-port=ether1
set [ find default-name=ether5 ] master-port=ether1
set [ find default-name=ether6 ] master-port=ether1
set [ find default-name=ether7 ] master-port=ether1
set [ find default-name=ether8 ] master-port=ether1
set [ find default-name=ether9 ] master-port=ether1
set [ find default-name=ether10 ] master-port=ether1
set [ find default-name=ether11 ] master-port=ether1
set [ find default-name=ether12 ] master-port=ether1
set [ find default-name=ether13 ] master-port=ether1
set [ find default-name=ether14 ] master-port=ether1
set [ find default-name=ether15 ] master-port=ether1
set [ find default-name=ether16 ] master-port=ether1
set [ find default-name=ether17 ] master-port=ether1
set [ find default-name=ether18 ] master-port=ether1
set [ find default-name=ether19 ] master-port=ether1
set [ find default-name=ether20 ] master-port=ether1
set [ find default-name=ether21 ] master-port=ether1
set [ find default-name=ether22 ] master-port=ether1
set [ find default-name=ether23 ] master-port=ether1
set [ find default-name=ether24 ] master-port=ether1
Disable SFP interface for security reasons (in case it is not being used):
In case using RouterOS 6.41+, a bridge must be created instead with disabled RSTP and
IGMP Snooping and no VLAN filtering:
/interface bridge
add name=bridge protocol-mode=none igmp-snooping=no vlan-filtering=no
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=ether6
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10
add bridge=bridge interface=ether11
add bridge=bridge interface=ether12
add bridge=bridge interface=ether13
add bridge=bridge interface=ether14
add bridge=bridge interface=ether15
add bridge=bridge interface=ether16
add bridge=bridge interface=ether17
add bridge=bridge interface=ether18
add bridge=bridge interface=ether19
add bridge=bridge interface=ether20
add bridge=bridge interface=ether21
add bridge=bridge interface=ether22
add bridge=bridge interface=ether23
add bridge=bridge interface=ether24
add bridge=bridge interface=sfp1
Note: If required, it is possible to use STP/RSTP and IGMP Snooping with hardware
offloading, make sure your device supports it.
Port trunking
Port trunking is used when a larger amount of bandwidth is required, this is done by creating a
static link aggregation group, which also provides hardware automatic failover and load
balancing for CRS1xx/CRS2xx series switches. By adding two 1Gbps interfaces to a trunk, you
can increase the theoretical bandwidth limit to 2Gbps. Make sure that all trunked interfaces are
linked to the same speed rates.
Note: CRS1xx/CRS2xx series switches aggregate traffic using the built-in Switch Chip without
using CPU resources, to route the traffic a router with a powerful CPU is required to handle the
aggregated traffic.
To create a 2Gbps port trunk from ether1 and ether2 between SwitchA, SwitchB and SwitchC,
use these commands on SwitchA and SwitchC:
To create a 4Gbps port trunk from ether1,ether2,ether3,ether4 between SWitchB and the
Router, use these commands on SwitchB:
On SwitchB ether5 and ether6 will be used to connect with SwitchA at 2Gbps and
ether7,ether8 will be used to connect with SwitchC at 2Gbps. Use these command
on SwitchB:
Management IP
It is very useful to create a management interface and assign an IP address to it in order to
preserve access to the switch. This is also very useful when updating your switches since such
traffic to the switch will be blocked when enabling invalid VLAN filtering.
Create a VLAN interface on SwitchA, SwitchB, SwitchC:
/interface vlan
add interface=ether1 name=Vlan99 vlan-id=99
Note: VLAN interface must be created on the master-port interface since it is the only interface
that will be able to communicate the CPU.
For this guide we are going to use these addresses for each device:
Address Device
192.168.99.1 Router
192.168.99.2 SwitchA
192.168.99.3 SwitchB
192.168.99.4 SwitchC
Add an IP address for each device on the VLAN interface (change X to appropriate number):
/ip address
add address=192.168.99.X/24 interface=Vlan99
Don't forget to add the default gateway and specify a DNS server:
/ip route
add gateway=192.168.99.1
/ip dns
set servers=192.168.99.1
/ip address
add address=192.168.99.1/24 interface=Vlan99
Bonding
Unlike CRS1xx/CRS2xx series switches that use the built-in Switch Chip to create a
aggregated link group, a router will use the CPU to create the aggregated link group.
To create a bonding interface for ether1,ether2,ether3,ether4, use these commands on
the Router:
/interface bonding
add mode=balance-xor name=bond1 slaves=ether1,ether2,ether3,ether4\
transmit-hash-policy=layer-2-and-3
Warning: Don't use bonding interfaces on CRS1xx/CRS2xx series devices, bonding interface
does NOT use the built-in Switch Chip to create aggregated link group and will overload the
CPU instantly. For CRS series device use only port trunking.
Now a VLAN interface can be created on the newly created bonding interface for management
and assign an IP address to it, use these commands on the Router:
/interface vlan
add interface=bond1 name=Vlan99 vlan-id=99
/ip address
add address=192.168.99.1/24 interface=Vlan99
Similarly add entries to the Egress VLAN tag table for SwitchB, use these commands
on SwitchB:
Note: Management VLAN ID is not addedd to Egress VLAN tag table since a VLAN interface
has been already created that will only send out tagged traffic either way.
Specify for each Ethernet interface a VLAN ID that will be assigned for a device that uses the
port, use these commands for SwitchA and SwitchC:
Similarly specify a VLAN ID for each Ethernet interface on SwitchB, use these commands
on SwitchB:
It is required add allowed VLAN IDs to the VLAN table in order for VLAN filtering to work
properly. Specify each VLAN ID and each port that is allowed to forward a certain VLAN ID.
Use trunk ports instead of physical Ethernet interfaces. Use these commands
on SwitchA and SwitchC:
Similarly add entries to the VLAN table for SwitchB, use the commands on SwitchB:
Note: It is required to specify switch1-cpu port in the VLAN table in order to allow access
the the previously created VLAN interface for management purposes.
Warning: Double check if port based VLANs are set up properly. If a mistake was made, you
might loose access to the switch and it can only be regained by resetting theconfiguration or by
using the serial console.
To enable invalid VLAN filtering, use these commands on SwitchA, SwitchB, SwitchC:
InterVLAN routing
To create InterVLAN routing, VLAN interface for each customer VLAN ID must be created on
the router and must have an IP address assigned to it. The VLAN interface must be created on
the bonding interface created previously.
Use these commands on the Router:
/interface vlan
add interface=bond1 name=Vlan10 vlan-id=10
add interface=bond1 name=Vlan20 vlan-id=20
add interface=bond1 name=Vlan30 vlan-id=30
add interface=bond1 name=Vlan40 vlan-id=40
/ip address
add address=192.168.10.1/24 interface=Vlan10
add address=192.168.20.1/24 interface=Vlan20
add address=192.168.30.1/24 interface=Vlan30
add address=192.168.40.1/24 interface=Vlan40
Note: These commands are required for DHCP-Server. In case interVLAN routing is not
desired but a DHCP-Server on a single router is required, then use Firewall Filter to block
access between different subnets.
DHCP-Server
To get the DHCP-Server working for each VLAN ID, the server must be set up on the
previously created VLAN interfaces (one server for each VLAN ID). Preferably each VLAN ID
should have its own subnet and its own IP pool. DNS Server could be specified as the router's
IP address for particular VLAN ID or a global DNS Server could be used, but this address must
be reachable.
To set up the DHCP-Server, use these commands on the Router:
/ip pool
add name=Vlan10_pool ranges=192.168.10.100-192.168.10.200
add name=Vlan20_pool ranges=192.168.20.100-192.168.20.200
add name=Vlan30_pool ranges=192.168.30.100-192.168.30.200
add name=Vlan40_pool ranges=192.168.40.100-192.168.40.200
/ip dhcp-server
add address-pool=Vlan10_pool disabled=no interface=Vlan10
name=Vlan10_DHCP
add address-pool=Vlan20_pool disabled=no interface=Vlan20
name=Vlan20_DHCP
add address-pool=Vlan30_pool disabled=no interface=Vlan30
name=Vlan30_DHCP
add address-pool=Vlan40_pool disabled=no interface=Vlan40
name=Vlan40_DHCP
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1
gateway=192.168.10.1
add address=192.168.20.0/24 dns-server=192.168.20.1
gateway=192.168.20.1
add address=192.168.30.0/24 dns-server=192.168.30.1
gateway=192.168.30.1
add address=192.168.40.0/24 dns-server=192.168.40.1
gateway=192.168.40.1
In case the router's DNS Server is being used, don't forget to allow remote requests and make
sure DNS Servers are configured on the router. Use these commands on the Router:
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
Warning: Make sure to secure your local DNS Server with Firewall from the outside when
using allow-remote-requests set to yes since your DNS Server can be used for
DDoS attacks if it is accessible from the Internet by anyone.
Don't forget to create NAT, assuming that sfp-sfpplus1 is used as WAN port, use these
commands on the Router:
Jumbo frames
One can increase the total throughput in such a setup by enabling jumbo frames. This reduces
the packet overhead by increasing the Maximum Transmission Unit (MTU). If a device in your
network does not support jumbo frames, then it will not benefit from a larger MTU. Usually the
whole network does not support jumbo frames, but you can still benefit when sending data
between devices that support jumbo frames, including all switches in the path.
In this case, if clients behind SwitchA and client behind SwitchC supports jumbo frames, then
enabling jumbo frames will be beneficial. Before enabling jumbo frames, determine the MAX-
L2MTU by using this command:
[admin@MikroTik] > /interface> print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE ACTUAL-MTU L2MTU
MAX-L2MTU
0 R ether1 ether 1500 1580
4064
When MAX-L2MTU is determined, choose the MTU size depending on the traffic on your
network, use this command on SwitchA, SwitchB and SwitchC:
/interface ethernet
set [ find ] l2mtu=4064 mtu=4040
Note: Don't forget to change the MTU on your client devices too, otherwise above mentioned
settings will not have any effect.
See also
Bonding
CRS examples
CRS features
Switch Chip Features
IP/DNS
NAT examples
Firewall filter examples
VLAN
MTU on RouterBOARD
[ Top | Back to Content ]
Contents
[hide]
1Summary
2Port switching
3Bonding
4Management IP
5Invalid VLAN filtering
6InterVLAN routing
7DHCP-Server
8Jumbo frames
9See also
Summary
This page will show how to configure multiple switches to use bonding interfaces and port
based VLANs, it will also show a working example with a DHCP-Server, interVLAN routing,
management IP and invalid VLAN filtering configuration.
Warning: This article applies to CRS3xx series devices and not CRS1xx/CRS2xx. For a
similar setup for CRS1xx/CRS2xx series switches you can check CRS1xx/2xx VLANs with
Trunks guide.
CRS3xx bonds and port based VLANs
Note: For this network topology we will be using two CRS326-24G-2S+, one CRS317-1G-
16S+ and one CCR1072-1G-8S+, but same principles can be applied to any CRS3xx series
devices and a router.
In this setup SwitchA and SwitchC will tag all traffic from ports ether1-ether8 to VLAN ID 10,
ether9-ether16 to VLAN ID 20, ether17-ether24 to VLAN ID 30. Management will only be
possible if user is connecting with tagged traffic with VLAN ID 99 from ether1 on SwitchA or
SwitchB, connecting to all devices will also be possible from the router using tagged traffic with
VLAN ID 99. SFP+ ports in this setup are going to be used as VLAN trunk ports while being in
a bond to create a LAG interface.
Port switching
All switches in this setup require that all used ports are switched together (except for ports that
are going to be part of a bonding interface). Use these commands on SwitchA and SwitchC:
/interface bridge
add name=bridge vlan-filtering=no
/interface bridge port
add bridge=bridge interface=ether1 pvid=10
add bridge=bridge interface=ether2 pvid=10
add bridge=bridge interface=ether3 pvid=10
add bridge=bridge interface=ether4 pvid=10
add bridge=bridge interface=ether5 pvid=10
add bridge=bridge interface=ether6 pvid=10
add bridge=bridge interface=ether7 pvid=10
add bridge=bridge interface=ether8 pvid=10
add bridge=bridge interface=ether9 pvid=20
add bridge=bridge interface=ether10 pvid=20
add bridge=bridge interface=ether11 pvid=20
add bridge=bridge interface=ether12 pvid=20
add bridge=bridge interface=ether13 pvid=20
add bridge=bridge interface=ether14 pvid=20
add bridge=bridge interface=ether15 pvid=20
add bridge=bridge interface=ether16 pvid=20
add bridge=bridge interface=ether17 pvid=30
add bridge=bridge interface=ether18 pvid=30
add bridge=bridge interface=ether19 pvid=30
add bridge=bridge interface=ether20 pvid=30
add bridge=bridge interface=ether21 pvid=30
add bridge=bridge interface=ether22 pvid=30
add bridge=bridge interface=ether23 pvid=30
add bridge=bridge interface=ether24 pvid=30
Note: If required, it is possible to use STP/RSTP/MSTP and IGMP Snooping with hardware
offloading, make sure your device supports it.
Warning: In this setup vlan-filtering is required, but it should be disabled while you are
setting up the device. If you create a bridge with vlan-filtering enabled at the
beginning, then you might loose access to the switch while you are configuring it. It is
recommended to enable vlan-filtering only when management port and bridge VLAN
table is configured.
Bonding
Bonding interfaces are used when a larger amount of bandwidth is required, this is done by
creating a link aggregation group, which also provides hardware automatic failover and load
balancing for CRS3xx series switches. By adding two 10Gbps interfaces to a bonding, you can
increase the theoretical bandwidth limit to 20Gbps. Make sure that all bonded interfaces are
linked to the same speed rates.
Note: CRS3xx series switches aggregate traffic using the built-in Switch Chip without using
CPU resources, to route the traffic a router with a powerful CPU is required to handle the
aggregated traffic.
To create a 20Gbps bonding interface from sfp-sfpplus1 and sfp-sfpplus2 between SwitchA to
SwitchB and between SwitchC to SwitchB, use these commands on SwitchA and SwitchC:
/interface bonding
add mode=802.3ad name=bond_1-2 slaves=sfp-sfpplus1,sfp-sfpplus2
To create a 40Gbps bonding interface between SwitchB and the Router and 20Gbps bonding
interfaces between SwitchA and SwitchC, use these commands on SwitchB:
/interface bonding
add mode=802.3ad name=bond_1-2 slaves=sfp-sfpplus1,sfp-sfpplus2
add mode=802.3ad name=bond_3-4 slaves=sfp-sfpplus3,sfp-sfpplus4
add mode=802.3ad name=bond_5-6-7-8 slaves=sfp-sfpplus5,sfp-
sfpplus6,sfp-sfpplus7,sfp-sfpplus8
When all the bonding interfaces are create, they must be added as a bridge port. Use these
commands on SwitchA and SwitchB:
Add all bonding interfaces to a single bridge on SwitchB by using these commands
on SwitchB:
In our case the Router needs a software based bonding interface, use these commands
on Router:
/interface bonding
add mode=802.3ad name=bond_1-2-3-4 slaves=sfp-sfpplus1,sfp-
sfpplus2,sfp-sfpplus3,sfp-sfpplus4
Management IP
It is very useful to create a management interface and assign an IP address to it in order to
preserve access to the switch. This is also very useful when updating your switches since such
traffic to the switch will be blocked when enabling invalid VLAN filtering.
Create a VLAN interface on SwitchA, SwitchB and SwitchC:
/interface vlan
add interface=bridge name=MGMT vlan-id=99
The Router needs the VLAN interface to be created on the bonding interface, use these
commands to create a VLAN interface on Router':
/interface vlan
add interface=bond_1-2-3-4 name=MGMT vlan-id=99
Note: VLAN interface must be created on the bridge interface since it is the only interface that
will be able to communicate the CPU.
For this guide we are going to use these addresses for each device:
Address Device
192.168.99.1 Router
192.168.99.2 SwitchA
192.168.99.3 SwitchB
192.168.99.4 SwitchC
Add an IP address for each device on the VLAN interface (change X to appropriate number):
/ip address
add address=192.168.99.X/24 interface=MGMT
Don't forget to add the default gateway and specify a DNS server:
/ip route
add gateway=192.168.99.1
/ip dns
set servers=192.168.99.1
/ip address
add address=192.168.99.1/24 interface=MGMT
There is an exception for frame types on SwitchA and SwitchB, in this setup access to
management port is required from ether1, bonding interfaces require that only tagged traffic
can be forwarded. Use these commands on SwitchA and SwitchC:
On SwitchB only tagged packets should be forwarded, use these commands on SwitchB:
It is required to setup bridge VLAN table. In this network setup we need to allow VLAN 10 on
ether1-ether8, VLAN 20 on ether9-ether16, VLAN 30 on ether17-ether24, VLAN 10,20,30,99
on bond_1-2 and a special case for ether1 to allow to forward VLAN 99 on SwitchA and
SwitchC. Use these commands on SwitchA and SwitchC:
Similarly it is required to setup bridge VLAN table for SwitchB. Use these commands
on SwitchB:
When everything is configured, VLAN filtering can be enabled. Use these commands
on SwitchA, SwitchB and SwitchC:
/interface bridge
set bridge vlan-filtering=yes
Warning: Double check if port based VLANs are set up properly. If a mistake was made, you
might loose access to the switch and it can only be regained by resetting the configuration or
by using the serial console.
InterVLAN routing
To create InterVLAN routing, VLAN interface for each customer VLAN ID must be created on
the router and must have an IP address assigned to it. The VLAN interface must be created on
the bonding interface created previously.
Use these commands on the Router:
/interface vlan
add interface=bond_1-2-3-4 name=VLAN10 vlan-id=10
add interface=bond_1-2-3-4 name=VLAN20 vlan-id=20
add interface=bond_1-2-3-4 name=VLAN30 vlan-id=30
/ip address
add address=192.168.10.1/24 interface=VLAN10
add address=192.168.20.1/24 interface=VLAN20
add address=192.168.30.1/24 interface=VLAN30
Note: These commands are required for DHCP-Server. In case interVLAN routing is not
desired but a DHCP-Server on a single router is required, then use Firewall Filter to block
access between different subnets.
DHCP-Server
To get the DHCP-Server working for each VLAN ID, the server must be set up on the
previously created VLAN interfaces (one server for each VLAN ID). Preferably each VLAN ID
should have its own subnet and its own IP pool. DNS Server could be specified as the router's
IP address for particular VLAN ID or a global DNS Server could be used, but this address must
be reachable.
To set up the DHCP-Server, use these commands on the Router:
/ip pool
add name=VLAN10_POOL ranges=192.168.10.100-192.168.10.200
add name=VLAN20_POOL ranges=192.168.20.100-192.168.20.200
add name=VLAN30_POOL ranges=192.168.30.100-192.168.30.200
/ip dhcp-server
add address-pool=VLAN10_POOL disabled=no interface=VLAN10
name=VLAN10_DHCP
add address-pool=VLAN20_POOL disabled=no interface=VLAN20
name=VLAN20_DHCP
add address-pool=VLAN30_POOL disabled=no interface=VLAN30
name=VLAN30_DHCP
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1
gateway=192.168.10.1
add address=192.168.20.0/24 dns-server=192.168.20.1
gateway=192.168.20.1
add address=192.168.30.0/24 dns-server=192.168.30.1
gateway=192.168.30.1
In case the router's DNS Server is being used, don't forget to allow remote requests and make
sure DNS Servers are configured on the router. Use these commands on the Router:
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
Warning: Make sure to secure your local DNS Server with Firewall from the outside when
using allow-remote-requests set to yes since your DNS Server can be used for
DDoS attacks if it is accessible from the Internet by anyone.
Don't forget to create NAT, assuming that sfp-sfpplus8 is used as WAN port, use these
commands on the Router:
/ip firewall nat
add action=masquerade chain=srcnat out-interface=sfp-sfpplus8
Jumbo frames
One can increase the total throughput in such a setup by enabling jumbo frames. This reduces
the packet overhead by increasing the Maximum Transmission Unit (MTU). If a device in your
network does not support jumbo frames, then it will not benefit from a larger MTU. Usually the
whole network does not support jumbo frames, but you can still benefit when sending data
between devices that support jumbo frames, including all switches in the path.
In this case, if clients behind SwitchA and client behind SwitchC supports jumbo frames, then
enabling jumbo frames will be beneficial. Before enabling jumbo frames, determine the MAX-
L2MTU by using this command:
When MAX-L2MTU is determined, choose the MTU size depending on the traffic on your
network, use this command on SwitchA, SwitchB and SwitchC:
/interface ethernet
set [ find ] l2mtu=4064 mtu=4040
Note: Don't forget to change the MTU on your client devices too, otherwise above mentioned
settings will not have any effect.
See also
Bonding
CRS3xx manual
Switch Chip Features
IP/DNS
NAT examples
Firewall filter examples
VLAN
MTU on RouterBOARD
[ Top | Back to Content ]
Manual:Interface/Bonding
< Manual:Interface
Applies to RouterOS:v3, v4
Contents
[hide]
1Summary
2Specifications
3Quick Setup Guide
4Link monitoring
o 4.1ARP Monitoring
o 4.2MII monitoring
5Bonding modes
o 5.1802.3ad
o 5.2balance-rr
o 5.3active-backup
o 5.4balance-xor
o 5.5broadcast
o 5.6balance-tlb
o 5.7balance-alb
6Property Description
7Notes
8See also
Summary
Bonding is a technology that allows aggregation of multiple ethernet-like interfaces into a single
virtual link, thus getting higher data rates and providing failover.
Specifications
Packages required: system
License required: Level1
Submenu level: /interface bonding
Standards and Technologies: None
Hardware usage: Not significant
Make sure that you do not have IP addresses on interfaces which will be enslaved for
bonding interface!
Add bonding interface on Router1:
And on Router2:
Note: bonding interface needs a couple of seconds to get connectivity with its peer.
Link monitoring
It is critical that one of the available link monitoring options is enabled. In the above example, if
one of the bonded links were to fail, the bonding driver will still continue to send packets over
the failed link which will lead to network degradation. Bonding in RouterOS currently supports
two schemes for monitoring a link state of slave devices: MII and ARP monitoring. It is not
possible to use both methods at the same time due to restrictions in the bonding driver.
ARP Monitoring
ARP monitoring sends ARP queries and uses the response as an indication that the link is
operational. This also gives assurance that traffic is actually flowing over the links. If balance-rr
and balance-xor modes are set, then the switch should be configured to evenly distribute
packets across all links. Otherwise all replies from the ARP targets will be received on the
same link which could cause other links to fail. ARP monitoring is enabled by setting three
properties link-monitoring, arp-ip-targets and arp-interval. Meaning of each
option is described later in this article. It is possible to specify multiple ARP targets that can be
useful in High Availability setups. If only one target is set, the target itself may go down. Having
additional targets increases the reliability of the ARP monitoring.
Enable ARP monitoring
We will not change arp-interval value in our example, RouterOS sets arp-interval to
100ms by default.
Unplug one of the cables to test if the link monitoring works correctly, you will notice some ping
timeouts until arp monitoring detects link failure.
MII monitoring
MII monitoring monitors only the state of the local interface. MII Type 1 - device driver
determines whether link is up or down. If device driver does not support this option then link will
appear as always up. Main disadvantage is that MII monitoring can't tell if the link can actually
pass packets or not, even if the link is detected as being up.
MII monitoring is configured by setting the variables link-monitoring mode and mii-
interval.
Enable MII Type1 monitoring:
Bonding modes
802.3ad
802.3ad mode is an IEEE standard also called LACP (Link Aggregation Control Protocol). It
includes automatic configuration of the aggregates, so minimal configuration of the switch is
needed. This standard also mandates that frames will be delivered in order and connections
should not see mis-ordering of packets. The standard also mandates that all devices in the
aggregate must operate at the same speed and duplex mode and works only with MII link
monitoring.
LACP balances outgoing traffic across the active ports based on hashed protocol header
information and accepts incoming traffic from any active port. The hash includes the Ethernet
source and destination address and if available, the VLAN tag, and the IPv4/IPv6 source and
destination address. How this is calculated depends on transmit-hash-policy parameter.
Note: layer-3-and-4 transmit hash mode is not fully compatible with LACP. More details
can be found in https://www.kernel.org/doc/Documentation/networking/bonding.txt
Configuration example
Example connects two ethernet interfaces on a router to the Edimax switch as a single, load
balanced and fault tolerant link. More interfaces can be added to increase throughput and fault
tolerance. Since frame ordering is mandatory on Ethernet links then any traffic between two
devices always flows over the same physical link limiting the maximum speed to that of one
interface. The transmit algorithm attempts to use as much information as it can to distinguish
different traffic flows and balance across the available interfaces.
Router R1 configuration:
Configuration on a switch:
TRK1 LACP
TRK2 Disable
TRK3 Disable
TRK4 Disable
TRK5 Disable
TRK6 Disable
TRK7 Disable
Notice that LACP is enabled on first trunk group (TRK1) and switch ports on first trunk group
are bound with 'v' flag. In our case port 2 and port4 will run LACP.
Verify if LACP is working: On the switch we should first verify if LACP protocol is enabled and
running:
After that we can ensure that LACP negotiated with our router. If you don't see both ports on
the list then something is wrong and LACP is not going to work.
Intelligent Switch : LACP Group Status
==================
Group
[Actor] [Partner]
Priority: 1 65535
After we verified that switch successfully negotiated LACP with our router, we can start traffic
from Client1 and Client2 to the Server and check how traffic is evenly forwarded through both
bonding slaves:
Note: On some switches you need to set correct link aggregation protocol, to make balancing
work in both directions
balance-rr
If this mode is set, packets are transmitted in sequential order from the first available slave to
the last.
Balance-rr is the only mode that will send packets across multiple interfaces that belong to the
same TCP/IP connection.
When utilizing multiple sending and multiple receiving links, packets are often received out of
order, which result in segment retransmission, for other protocols such as UDP it is not a
problem if client software can tolerate out-of-order packets.
If switch is used to aggregate links together, then appropriate switch port configuration is
required, however many switches do not support balance-rr.
Quick setup guide demonstrates use of the balance-rr bonding mode. As you can see, it is
quite simple to set up. Balance-rr is also useful for bonding several wireless links, however it
requires equal bandwidth for all bonded links. If bandwidth of one bonded link drops, then total
bandwidth of bond will be equal to the bandwidth of the slowest bonded link.
active-backup
This mode uses only one active slave to transmit packets. The additional slave only becomes
active if the primary slave fails. The MAC address of the bonding interface is presented onto
the active port to avoid confusing the switch. Active-backup is the best choice in high
availability setups with multiple switches that are interconnected.
Note: ARP monitoring in this mode will not work correctly if both routers are directly connected.
In such setups mii-type1 or mii-type2 monitoring must be used or a switch should be put
between routers.
balance-xor
This mode balances outgoing traffic across the active ports based on the hashed protocol
header information and accepts incoming traffic from any active port. Mode is very similar
to LACP except that it is not standardized and works with layer-3-and-4 hash policy.
broadcast
When ports are configured with broadcast mode, all slave ports transmit the same packets to
the destination to provide fault tolerance. This mode does not provide load balancing.
balance-tlb
This mode balances outgoing traffic by peer. Each link can be a different speed and duplex
mode and no specific switch configuration is required as for the other modes. Downside of this
mode is that only MII link monitoring is supported and incoming traffic is not balanced.
Incoming traffic will use the link that is configured as "primary".
Configuration example
Lets assume than router has two links - ether1 max bandwidth is 10Mbps and ether2 max
bandwidth is 5Mbps.
First link has more bandwidth so we set it as primary link
Image above illustrates how balance-tlb mode works. As you can see router can
communicate to all the clients connected to the switch with a total bandwidth of both links
(15Mbps). But as you already know, balance-tlb is not balancing incoming traffic. In our
example clients can communicate to router with total bandwidth of primary link which is
10Mbps in our configuration.
balance-alb
Mode is basically the same as balance-tlb but incoming traffic is also balanced. Only
additional downside of this mode is that it requires device driver capability to change MAC
address. Most of the cheap cards do not support this mode.
Image above illustrates how balance-alb mode works. Compared to balance-tlb mode,
traffic from clients can also use the secondary link to communicate with the router.
Property Description
Property
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) A
N
mii-interval (time; Default: 00:00:00.100) h
mode (802.3ad | active-backup | balance-alb | balance-rr | balance-tlb | balance-xor | broadcast; Default: balance-rr) S
mtu (integer; Default: 1500) M
name (string; Default: ) d
primary (string; Default: ) I
w
slaves (string; Default: none) a
up-delay (time; Default: 00:00:00) if
V
transmit-hash-policy (layer-2 | layer-2-and-3 | layer-3-and-4; Default: layer-2) S
Notes
Link failure detection and failover is working significantly better with expensive network cards,
for example, made by Intel, then with more cheap ones. On Intel cards for example, failover is
taking place in less than a second after link loss, while on some other cards, it may require up
to 20 seconds. Also, the Active load balancing ( mode=balance-alb ) does not work on some
cheap cards.
Manual:Bonding Examples
(Redirected from Bonding Examples)
Contents
[hide]
Getting started
Bonding could be used only on OSI layer 2 (Ethernet level) connections. Thus we need to
create EoIP interfaces on each of the wireless links. This is done as follows:
on router R1:
and on router R2
The second step is to add bonding interface and specify EoIP interfaces as slaves:
R1:
R2
R1:
R2
R1:
R2
You should see that traffic is distributed equally across both EoIP interfaces:
Link Monitoring
It is easy to notice that with the configuration above as soon as any of individual link fails, the
bonding interface throughput collapses. That's because no link monitoring is performed,
consequently, the bonding driver is unaware of problems with the underlying links. Enabling
link monitoring is a must in most bonding configurations. To enable ARP link monitoring, do the
following:
R1:
R2
Manual:Interface/Bonding
< Manual:Interface
Applies to RouterOS:v3, v4
Contents
[hide]
1Summary
2Specifications
3Quick Setup Guide
4Link monitoring
o 4.1ARP Monitoring
o 4.2MII monitoring
5Bonding modes
o 5.1802.3ad
o 5.2balance-rr
o 5.3active-backup
o 5.4balance-xor
o 5.5broadcast
o 5.6balance-tlb
o 5.7balance-alb
6Property Description
7Notes
8See also
Summary
Bonding is a technology that allows aggregation of multiple ethernet-like interfaces into a single
virtual link, thus getting higher data rates and providing failover.
Specifications
Packages required: system
License required: Level1
Submenu level: /interface bonding
Standards and Technologies: None
Hardware usage: Not significant
Make sure that you do not have IP addresses on interfaces which will be enslaved for
bonding interface!
Add bonding interface on Router1:
Note: bonding interface needs a couple of seconds to get connectivity with its peer.
Link monitoring
It is critical that one of the available link monitoring options is enabled. In the above example, if
one of the bonded links were to fail, the bonding driver will still continue to send packets over
the failed link which will lead to network degradation. Bonding in RouterOS currently supports
two schemes for monitoring a link state of slave devices: MII and ARP monitoring. It is not
possible to use both methods at the same time due to restrictions in the bonding driver.
ARP Monitoring
ARP monitoring sends ARP queries and uses the response as an indication that the link is
operational. This also gives assurance that traffic is actually flowing over the links. If balance-rr
and balance-xor modes are set, then the switch should be configured to evenly distribute
packets across all links. Otherwise all replies from the ARP targets will be received on the
same link which could cause other links to fail. ARP monitoring is enabled by setting three
properties link-monitoring, arp-ip-targets and arp-interval. Meaning of each
option is described later in this article. It is possible to specify multiple ARP targets that can be
useful in High Availability setups. If only one target is set, the target itself may go down. Having
additional targets increases the reliability of the ARP monitoring.
Enable ARP monitoring
We will not change arp-interval value in our example, RouterOS sets arp-interval to
100ms by default.
Unplug one of the cables to test if the link monitoring works correctly, you will notice some ping
timeouts until arp monitoring detects link failure.
MII monitoring
MII monitoring monitors only the state of the local interface. MII Type 1 - device driver
determines whether link is up or down. If device driver does not support this option then link will
appear as always up. Main disadvantage is that MII monitoring can't tell if the link can actually
pass packets or not, even if the link is detected as being up.
MII monitoring is configured by setting the variables link-monitoring mode and mii-
interval.
Enable MII Type1 monitoring:
Bonding modes
802.3ad
802.3ad mode is an IEEE standard also called LACP (Link Aggregation Control Protocol). It
includes automatic configuration of the aggregates, so minimal configuration of the switch is
needed. This standard also mandates that frames will be delivered in order and connections
should not see mis-ordering of packets. The standard also mandates that all devices in the
aggregate must operate at the same speed and duplex mode and works only with MII link
monitoring.
LACP balances outgoing traffic across the active ports based on hashed protocol header
information and accepts incoming traffic from any active port. The hash includes the Ethernet
source and destination address and if available, the VLAN tag, and the IPv4/IPv6 source and
destination address. How this is calculated depends on transmit-hash-policy parameter.
Note: layer-3-and-4 transmit hash mode is not fully compatible with LACP. More details
can be found in https://www.kernel.org/doc/Documentation/networking/bonding.txt
Configuration example
Example connects two ethernet interfaces on a router to the Edimax switch as a single, load
balanced and fault tolerant link. More interfaces can be added to increase throughput and fault
tolerance. Since frame ordering is mandatory on Ethernet links then any traffic between two
devices always flows over the same physical link limiting the maximum speed to that of one
interface. The transmit algorithm attempts to use as much information as it can to distinguish
different traffic flows and balance across the available interfaces.
Router R1 configuration:
Configuration on a switch:
TRK1 LACP
TRK2 Disable
TRK3 Disable
TRK4 Disable
TRK5 Disable
TRK6 Disable
TRK7 Disable
Notice that LACP is enabled on first trunk group (TRK1) and switch ports on first trunk group
are bound with 'v' flag. In our case port 2 and port4 will run LACP.
Verify if LACP is working: On the switch we should first verify if LACP protocol is enabled and
running:
After that we can ensure that LACP negotiated with our router. If you don't see both ports on
the list then something is wrong and LACP is not going to work.
Group
[Actor] [Partner]
Priority: 1 65535
After we verified that switch successfully negotiated LACP with our router, we can start traffic
from Client1 and Client2 to the Server and check how traffic is evenly forwarded through both
bonding slaves:
Note: On some switches you need to set correct link aggregation protocol, to make balancing
work in both directions
balance-rr
If this mode is set, packets are transmitted in sequential order from the first available slave to
the last.
Balance-rr is the only mode that will send packets across multiple interfaces that belong to the
same TCP/IP connection.
When utilizing multiple sending and multiple receiving links, packets are often received out of
order, which result in segment retransmission, for other protocols such as UDP it is not a
problem if client software can tolerate out-of-order packets.
If switch is used to aggregate links together, then appropriate switch port configuration is
required, however many switches do not support balance-rr.
Quick setup guide demonstrates use of the balance-rr bonding mode. As you can see, it is
quite simple to set up. Balance-rr is also useful for bonding several wireless links, however it
requires equal bandwidth for all bonded links. If bandwidth of one bonded link drops, then total
bandwidth of bond will be equal to the bandwidth of the slowest bonded link.
active-backup
This mode uses only one active slave to transmit packets. The additional slave only becomes
active if the primary slave fails. The MAC address of the bonding interface is presented onto
the active port to avoid confusing the switch. Active-backup is the best choice in high
availability setups with multiple switches that are interconnected.
Note: ARP monitoring in this mode will not work correctly if both routers are directly connected.
In such setups mii-type1 or mii-type2 monitoring must be used or a switch should be put
between routers.
balance-xor
This mode balances outgoing traffic across the active ports based on the hashed protocol
header information and accepts incoming traffic from any active port. Mode is very similar
to LACP except that it is not standardized and works with layer-3-and-4 hash policy.
broadcast
When ports are configured with broadcast mode, all slave ports transmit the same packets to
the destination to provide fault tolerance. This mode does not provide load balancing.
balance-tlb
This mode balances outgoing traffic by peer. Each link can be a different speed and duplex
mode and no specific switch configuration is required as for the other modes. Downside of this
mode is that only MII link monitoring is supported and incoming traffic is not balanced.
Incoming traffic will use the link that is configured as "primary".
Configuration example
Lets assume than router has two links - ether1 max bandwidth is 10Mbps and ether2 max
bandwidth is 5Mbps.
First link has more bandwidth so we set it as primary link
Image above illustrates how balance-tlb mode works. As you can see router can
communicate to all the clients connected to the switch with a total bandwidth of both links
(15Mbps). But as you already know, balance-tlb is not balancing incoming traffic. In our
example clients can communicate to router with total bandwidth of primary link which is
10Mbps in our configuration.
balance-alb
Mode is basically the same as balance-tlb but incoming traffic is also balanced. Only
additional downside of this mode is that it requires device driver capability to change MAC
address. Most of the cheap cards do not support this mode.
Image above illustrates how balance-alb mode works. Compared to balance-tlb mode,
traffic from clients can also use the secondary link to communicate with the router.
Property Description
Property
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) A
Manual:IP/DNS
< Manual:IP
Applies to RouterOS:v4.6
DNS cache is used to minimize DNS requests to an external DNS server as well as to
minimize DNS resolution time. This is a simple DNS cache with local items.
Contents
[hide]
1Specifications
2Description
3DNS Cache Setup
o 3.1Properties
o 3.2Example
4Cache Monitoring
o 4.1Description
o 4.2Property Description
5All DNS Entries
o 5.1Description
o 5.2Property Description
6Static DNS Entries
o 6.1Description
o 6.2Property Description
o 6.3Notes
7Flushing DNS cache
o 7.1Command Description
o 7.2Example
8See Also
Specifications
Packages required: system
License required: Level1
Submenu level: /ip dns
Standards and Technologies: DNS
Hardware usage: Not significant
Description
A MikroTik router with DNS feature enabled can be set as a DNS server for any DNS-
compliant client. Moreover, MikroTik router can be specified as a primary DNS server under its
dhcp-server settings. When the remote requests are enabled, the MikroTik router responds to
TCP and UDP DNS requests on port 53.
DNS facility is used to provide domain name resolution for router itself as well as for the clients
connected to it.
Properties
Property
Read-only Properties
Property
When both static and dynamic servers are set, static server entries are more preferred,
however it does not indicate that static server will always be used (for example, previously
query was received from dynamic server, but static was added later, then dynamic entry will be
preferred).
Note: If allow-remote-requests is used make sure that you limit access to your server over
TCP and UDP protocol.
Example
To set 159.148.60.2 as the primary DNS server and allow the router to be used as a DNS
server, do the following:
Cache Monitoring
Submenu level: /ip dns cache
Description
This menu provides a list with all address (DNS type "A") records stored on the server
Property Description
Property Desciption
data (read-only: DNS data field. IP address for type "A" records. Other record types may have
text) different contents of the data field (like hostname or arbitrary text)
Notes
Reverse DNS lookup (Address to Name) of the regular expression entries is not possible. You
can, however, add an additional plain record with the same IP address and specify some name
for it.
Remember that the meaning of a dot (.) in regular expressions is any character, so the
expression should be escaped properly. For example, if you need to match anything within
example.com domain but not all the domains that just end with example.com,
like www.another-example.com, use name=".*\\.example\\.com"
Regular expression matching is significantly slower than of the plain entries, so it is advised to
minimize the number of regular expression rules and optimize the expressions themselves.
Example
To add a static DNS entry for www.example.com to be resolved to 10.0.0.1 IP address:
For more information how to use regex, read wiki page below.
Example
[admin@MikroTik] ip dns> cache flush
[admin@MikroTik] ip dns> print
servers: 159.148.60.2
allow-remote-requests: yes
cache-size: 2048 KiB
cache-max-ttl: 1w
cache-used: 10 KiB
[admin@MikroTik] ip dns>
Contents
1History
2Syntax
3Character classes
4Collating symbols
5Equivalence classes
6External links
7Use in Tools
History[edit]
Traditional Unix regular expression syntax followed common conventions that often differed
from tool to tool. The POSIX Basic Regular Expressions syntax was developed by the IEEE,
together with an extended variant called Extended Regular Expression syntax. These
standards were designed mostly to provide backward compatibility with the traditional Simple
Regular Expressions syntax, providing a common standard which has since been adopted as
the default syntax of many Unix regular expression tools.
Syntax[edit]
In POSIX Basic Regular Expression syntax, most characters are treated as literals — they
match only themselves (e.g., a matches "a"). The exceptions, listed below, are
called metacharacters or metasequences.
Metacharacter Description
. Matches any single character (many applications exclude newlines, and exactly
which characters are considered newlines is flavor, character encoding, and
platform specific, but it is safe to assume that the line feed character is included).
Within POSIX bracket expressions, the dot character matches a literal dot. For
example, a.c matches "abc", etc., but [a.c] matches only "a", ".", or "c".
The - character is treated as a literal character if it is the last or the first character
within the brackets: [abc-] , [-abc] . The ] character can be included in a
bracket expression if it is the first character: []abc] . The bracket expression may
also contain character classes, equivalence classes, and collating characters.
[^ ] Matches a single character that is not contained within the brackets. For
example, [^abc] matches any character other than "a", "b", or "c", and [^a-
z] matches any single character that is not a lowercase letter from "a" to "z".
These forms can be mixed: [^abcx-z] matches any character other than "a",
"b", "c", "x", "y", or "z".
The - character is treated as a literal character if it is the last character or the first
characted after ^ : [^abc-] , [^-abc] . The ] character is treated as a literal
character if it is the first character after ^ : [^]abc] . The expression may also
contain character classes, equivalence classes, and collating characters.
^ Matches the starting position within the string, if it is the first character of the
regular expression.
$ Matches the ending position of the string, if it is the last character of the regular
expression.
* Matches the preceding element zero or more times. For example, ab*c matches
"ac", "abc", "abbbc", etc. [xyz]* matches "", "x", "y", "z", "zx", "zyx", "xyzzy",
and so on.
BRE: \{m\} Matches the preceding element exactly m times. For example, a\{3\} matches
ERE: {m} only "aaa".
BRE: \{m,\} Matches the preceding element at least m times. For example, a\{3,\} matches
ERE: {m,} "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", and so on.
BRE: \{m,n\} Matches the preceding element at least m and not more than n times. For
ERE: {m,n} example, a\{3,5\} matches only "aaa", "aaaa", and "aaaaa". This is not found
in a few older instances of regular expressions.
BRE: \( \) Defines a subexpression. It is treated as a single element. For
ERE: ( ) example, ab* matches "a", "ab", "abb" and so on, while \(ab\)* matches "",
"ab", "abab", "ababab", and so on. The string matched within the parentheses can
be recalled later (see the next entry, \n ). A subexpression is also called a marked
subexpression, a block or a capturing group.
BRE only: \n Matches what the nth marked subexpression matched, where n is a digit from 1 to
9. This construct is theoretically irregular (an expression with this construct does
not obey the mathematical definition of regular expression), and was not adopted
in the POSIX ERE syntax.
Examples:
.at matches any three-character string ending with "at", including "hat", "cat", and "bat".
[hc]at matches "hat" and "cat".
[^b]at matches all strings matched by .at except "bat".
^[hc]at matches "hat" and "cat", but only at the beginning of the string or line.
[hc]at$ matches "hat" and "cat", but only at the end of the string or line.
\[.\] matches any single character surrounded by "[" and "]" since the brackets are
escaped, for example: "[a]" and "[b]".
Character classes[edit]
The POSIX standard defines some classes or categories of characters as shown below. These
classes are used within brackets.
[:graph:] [^ [:cntrl:]] graphic characters (all characters which have graphic representation)
For example,
Equivalence classes[edit]
Equivalence classes, like character classes and collating symbols, are used in brackets and
have the form [=a=] . They stand for any character which is equivalent to the given. According
to the standard[1],
For example, if 'a', 'à', and 'â' belong to the same equivalence class, then "[[=a=]b]", "[[=à=]b]",
and "[[=â=]b]" are each equivalent to "[aàâb]".
Equivalence classes, like collating symbols, are defined by the locale.
9. Regular Expressions
Regular Expressions (REs) provide a mechanism to select specific strings from a set of
character strings.
The concatenated set of one or more BREs or EREs that make up the pattern specified
for string selection.
matched
Matching shall be based on the bit pattern used for encoding the character, not on the
graphic representation of the character. This means that if a character set contains two
or more encodings for a graphic symbol, or if the strings searched contain text
encoded in more than one codeset, no attempt is made to search for any other
representation of the encoded symbol. If that is required, the user can specify
equivalence classes containing all variations of the desired graphic symbol.
The search for a matching sequence starts at the beginning of a string and stops when
the first sequence matching the expression is found, where "first" is defined to mean
"begins earliest in the string". If the pattern permits a variable number of matching
characters and thus there is more than one such sequence starting at that point, the
longest such sequence is matched. For example, the BRE "bb*" matches the second to
fourth characters of the string "abbbc", and the
ERE "(wee|week)(knights|night)" matches all ten characters of the
string "weeknights".
Consistent with the whole match being the longest of the leftmost matches, each
subpattern, from left to right, shall match the longest possible string. For this purpose,
a null string shall be considered to be longer than no match at all. For example,
matching the BRE "\(.*\).*" against "abcdef", the
subexpression "(\1)" is "abcdef", and matching the BRE "\(a*\)*" against "bc", the
subexpression "(\1)" is the null string.
A BRE or ERE that shall match either a single character or a single collating element.
Only a BRE or ERE of this type that includes a bracket expression (see RE Bracket
Expression) can match a collating element.
Such a BRE or ERE is made up from a BRE (ERE) matching a single character and BRE
(ERE) special characters.
invalid
This section uses the term "invalid" for certain constructs or conditions. Invalid REs
shall cause the utility or function using the RE to generate an error condition. When
invalid is not used, violations of the specified syntax or semantics for REs produce
undefined results: this may entail an error, enabling an extended syntax for that RE, or
using the construct in error as literal characters to be matched. For example, the BRE
construct "\{1,2,3\}" does not comply with the grammar. A conforming application
cannot rely on it producing an error nor matching the literal characters "\{1,2,3\}".
The use of regular expressions is generally associated with text processing. REs (BREs
and EREs) operate on text strings; that is, zero or more characters followed by an end-
of-string delimiter (typically NUL). Some utilities employing regular expressions limit
the processing to lines; that is, zero or more characters followed by a <newline>. In
the regular expression processing described in IEEE Std 1003.1-2001, the <newline>
is regarded as an ordinary character and both a period and a non-matching list can
match one. The Shell and Utilities volume of IEEE Std 1003.1-2001 specifies within the
individual descriptions of those standard utilities employing regular expressions
whether they permit matching of <newline>s; if not stated otherwise, the use of literal
<newline>s or any escape sequence equivalent produces undefined results. Those
utilities (like grep) that do not allow <newline>s to match are responsible for
eliminating any <newline> from strings before matching against the RE.
The regcomp() function in the System Interfaces volume of IEEE Std 1003.1-2001,
however, can provide support for such processing without violating the rules of this
section.
The interfaces specified in IEEE Std 1003.1-2001 do not permit the inclusion of a NUL
character in an RE or in the string to be matched. If during the operation of a standard
utility a NUL is included in the text designated to be matched, that NUL may designate
the end of the text string for the purposes of matching.
When a standard utility or function that uses regular expressions specifies that pattern
matching shall be performed without regard to the case (uppercase or lowercase) of
either data or patterns, then when each character in the string is matched against the
pattern, not only the character, but also its case counterpart (if any), shall be
matched. This definition of case-insensitive processing is intended to allow matching of
multi-character collating elements as well as characters, as each character in the string
is matched using both its cases. For example, in a locale where "Ch" is a multi-
character collating element and where a matching list expression matches such
elements, the RE "[[.Ch.]]" when matched against the string "char" is in reality
matched against "ch", "Ch", "cH", and "CH".
The implementation shall support any regular expression that does not exceed 256
bytes in length.
An ordinary character is a BRE that matches itself: any character in the supported
character set, except for the BRE special characters listed in BRE Special Characters.
A BRE special character has special properties in certain contexts. Outside those
contexts, or when preceded by a backslash, such a character is a BRE that matches
the special character itself. The BRE special characters and the contexts in which they
have their special meaning are as follows:
.[\
The period, left-bracket, and backslash shall be special except when used in a
bracket expression (see RE Bracket Expression). An expression containing
a '[' that is not preceded by a backslash and is not part of a bracket
expression produces undefined results.
*
A period ( '.' ), when used outside a bracket expression, is a BRE that shall match
any character in the supported character set except NUL.
2. A matching list expression specifies a list that shall match any single-character
collating element in any of the expressions represented in the list. The first
character in the list shall not be the circumflex; for example, "[abc]" is an RE
that matches any of the characters 'a', 'b', or 'c'. It is unspecified whether a
matching list expression matches a multi-character collating element that is
matched by one of the expressions.
3. A non-matching list expression begins with a circumflex ( '^' ), and specifies a
list that shall match any single-character collating element except for the
expressions represented in the list after the leading circumflex. For
example, "[^abc]" is an RE that matches any character except the
characters 'a', 'b', or 'c'. It is unspecified whether a non-matching list
expression matches a multi-character collating element that is not matched by
any of the expressions. The circumflex shall have this special meaning only
when it occurs first in the list, immediately following the left-bracket.
4. A collating symbol is a collating element enclosed within bracket-period
( "[." and ".]" ) delimiters. Collating elements are defined as described
in Collation Order. Conforming applications shall represent multi-character
collating elements as collating symbols when it is necessary to distinguish them
from a list of the individual characters that make up the multi-character
collating element. For example, if the string "ch" is a collating element defined
using the line:
5. collating-element <ch-digraph> from "<c><h>"
6.
[:name:]
are recognized in those locales where the name keyword has been given
a charclass definition in the LC_CTYPE category.
9. In the POSIX locale, a range expression represents the set of collating elements
that fall between two elements in the collation sequence, inclusive. In other
locales, a range expression has unspecified behavior: strictly conforming
applications shall not rely on whether the range expression is valid, or on the
set of collating elements matched. A range expression shall be expressed as the
starting point and the ending point separated by a hyphen ( '-' ).
The starting range point and the ending range point shall be a collating element
or collating symbol. An equivalence class expression used as a starting or
ending point of a range expression produces unspecified results. An equivalence
class can be used portably within a bracket expression, but only outside the
range. If the represented set of collating elements is empty, it is unspecified
whether the expression matches nothing, or is treated as invalid.
The interpretation of range expressions where the ending range point is also the
starting range point of a subsequent range expression (for example, "[a-m-
o]" ) is undefined.
If a bracket expression specifies both '-' and ']', the ']' shall be placed first
(after the '^', if any) and the '-' last within the bracket expression.
The following rules can be used to construct BREs matching multiple characters from
BREs matching a single character:
1. The concatenation of BREs shall match the concatenation of the strings
matched by each component of the BRE.
2. A subexpression can be defined within a BRE by enclosing it between the
character pairs "\(" and "\)". Such a subexpression shall match whatever it
would have matched without the "\(" and "\)", except that anchoring within
subexpressions is optional behavior; see BRE Expression Anchoring.
Subexpressions can be arbitrarily nested.
3. The back-reference expression '\n' shall match the same (possibly empty)
string of characters as was matched by a subexpression enclosed
between "\(" and "\)" preceding the '\n'. The character 'n' shall be a digit
from 1 through 9, specifying the nth subexpression (the one that begins with
the nth "\(" from the beginning of the pattern and ends with the corresponding
paired "\)" ). The expression is invalid if less than n subexpressions precede
the '\n'. For example, the expression "\(.*\)\1$" matches a line consisting
of two adjacent appearances of the same string, and the
expression "\(a\)*\1" fails to match 'a'. When the referenced subexpression
matched more than one string, the back-referenced expression shall refer to
the last matched string. If the subexpression referenced by the back-reference
matches more than one string because of an asterisk ( '*' ) or an interval
expression (see item (5)), the back-reference shall match the last (rightmost)
of these strings.
4. When a BRE matching a single character, a subexpression, or a back-reference
is followed by the special character asterisk ( '*' ), together with that asterisk
it shall match what zero or more consecutive occurrences of the BRE would
match. For example, "[ab]*" and "[ab][ab]" are equivalent when matching
the string "ab".
5. When a BRE matching a single character, a subexpression, or a back-reference
is followed by an interval expression of the format "\{m\}", "\{m,\}",
or "\{m,n\}", together with that interval expression it shall match what
repeated consecutive occurrences of the BRE would match. The values
of m and n are decimal integers in the range 0 <= m<= n<= {RE_DUP_MAX},
where m specifies the exact or minimum number of occurrences and nspecifies
the maximum number of occurrences. The expression "\{m\}" shall match
exactly m occurrences of the preceding BRE, "\{m,\}" shall match at
least m occurrences, and "\{m,n\}" shall match any number of occurrences
between m and n, inclusive.
The behavior of multiple adjacent duplication symbols ( '*' and intervals) produces
undefined results.
A BRE can be limited to matching strings that begin or end a line; this is called
"anchoring". The circumflex and dollar sign special characters shall be considered BRE
anchors in the following contexts:
An ERE special character has special properties in certain contexts. Outside those
contexts, or when preceded by a backslash, such a character shall be an ERE that
matches the special character itself. The extended regular expression special
characters and the contexts in which they shall have their special meaning are as
follows:
.[\(
A period ( '.' ), when used outside a bracket expression, is an ERE that shall match
any character in the supported character set except NUL.
The rules for ERE Bracket Expressions are the same as for Basic Regular Expressions;
see RE Bracket Expression.
The following rules shall be used to construct EREs matching multiple characters from
EREs matching a single character:
The behavior of multiple adjacent duplication symbols ( '+', '*', '?', and intervals)
produces undefined results.
Two EREs separated by the special character vertical-line ( '|' ) shall match a string
that is matched by either. For example, the ERE "a((bc)|d)" matches the
string "abc" and the string "ad". Single characters, or expressions matching single
characters, separated by the vertical bar and enclosed in parentheses, shall be treated
as an ERE matching a single character.
For example, the ERE "abba|cde" matches either the string "abba" or the
string "cde" (rather than the string "abbade" or "abbcde", because concatenation has
a higher order of precedence than alternation).
9.4.9 ERE Expression Anchoring
An ERE can be limited to matching strings that begin or end a line; this is called
"anchoring". The circumflex and dollar sign special characters shall be considered ERE
anchors when used anywhere outside a bracket expression. This shall have the
following effects:
The lexical conventions for regular expressions are as described in this section.
Except as noted, the longest possible token or delimiter beginning at a given point is
recognized.
The following tokens are processed (in addition to those string constants shown in the
grammar):
COLL_ELEM_SINGLE
COLL_ELEM_MULTI
BACKREF
DUP_COUNT
Represents a numeric constant. It shall be an integer in the range 0
<= DUP_COUNT <= {RE_DUP_MAX}. This token is only recognized when the
context of the grammar requires it. At all other times, digits not preceded
by '\' are treated as ORD_CHAR.
META_CHAR
When found anywhere but first (after an initial '^', if any) or last in a bracket
expression, or as the ending range point in a range expression
]
When found anywhere but first (after an initial '^', if any) in a bracket
expression
L_ANCHOR
Applicable only to basic regular expressions. The character '^' when it appears
as the first character of a basic regular expression and when
not QUOTED_CHAR. The '^' may be recognized as an anchor elsewhere;
see BRE Expression Anchoring.
ORD_CHAR
QUOTED_CHAR
\^ \. \[ \$ \( \) \|
\* \+ \? \{ \\
R_ANCHOR
SPEC_CHAR
^ . [ $ ( ) |
* + ? { \
This section presents the grammar for basic regular expressions, including the bracket
expression grammar that is common to both BREs and EREs.
%token class_name
/* class_name is a keyword to the LC_CTYPE locale category */
/* (representing a character class) in the current locale */
/* and is only recognized between [: and :] */
%start basic_reg_exp
%%
/* --------------------------------------------
Basic Regular Expression
--------------------------------------------
*/
basic_reg_exp : RE_expression
| L_ANCHOR
| R_ANCHOR
| L_ANCHOR R_ANCHOR
| L_ANCHOR RE_expression
| RE_expression R_ANCHOR
| L_ANCHOR RE_expression R_ANCHOR
;
RE_expression : simple_RE
| RE_expression simple_RE
;
simple_RE : nondupl_RE
| nondupl_RE RE_dupl_symbol
;
nondupl_RE : one_char_or_coll_elem_RE
| Back_open_paren RE_expression Back_close_paren
| BACKREF
;
one_char_or_coll_elem_RE : ORD_CHAR
| QUOTED_CHAR
| '.'
| bracket_expression
;
RE_dupl_symbol : '*'
| Back_open_brace DUP_COUNT Back_close_brace
| Back_open_brace DUP_COUNT ',' Back_close_brace
| Back_open_brace DUP_COUNT ',' DUP_COUNT Back_close_brace
;
/* --------------------------------------------
Bracket Expression
-------------------------------------------
*/
bracket_expression : '[' matching_list ']'
| '[' nonmatching_list ']'
;
matching_list : bracket_list
;
nonmatching_list : '^' bracket_list
;
bracket_list : follow_list
| follow_list '-'
;
follow_list : expression_term
| follow_list expression_term
;
expression_term : single_expression
| range_expression
;
single_expression : end_range
| character_class
| equivalence_class
;
range_expression : start_range end_range
| start_range '-'
;
start_range : end_range '-'
;
end_range : COLL_ELEM_SINGLE
| collating_symbol
;
collating_symbol : Open_dot COLL_ELEM_SINGLE Dot_close
| Open_dot COLL_ELEM_MULTI Dot_close
| Open_dot META_CHAR Dot_close
;
equivalence_class : Open_equal COLL_ELEM_SINGLE Equal_close
| Open_equal COLL_ELEM_MULTI Equal_close
;
character_class : Open_colon class_name Colon_close
;
This section presents the grammar for extended regular expressions, excluding the
bracket expression grammar.
Note:
The bracket expression grammar and the associated %token lines are identical
between BREs and EREs. It has been omitted from the ERE section to avoid
unnecessary editorial duplication.
%token ORD_CHAR QUOTED_CHAR DUP_COUNT
%start extended_reg_exp
%%
/* --------------------------------------------
Extended Regular Expression
--------------------------------------------
*/
extended_reg_exp : ERE_branch
| extended_reg_exp '|' ERE_branch
;
ERE_branch : ERE_expression
| ERE_branch ERE_expression
;
ERE_expression : one_char_or_coll_elem_ERE
| '^'
| '$'
| '(' extended_reg_exp ')'
| ERE_expression ERE_dupl_symbol
;
one_char_or_coll_elem_ERE : ORD_CHAR
| QUOTED_CHAR
| '.'
| bracket_expression
;
ERE_dupl_symbol : '*'
| '+'
| '?'
| '{' DUP_COUNT '}'
| '{' DUP_COUNT ',' '}'
| '{' DUP_COUNT ',' DUP_COUNT '}'
;
The ERE grammar does not permit several constructs that previous sections specify as
having undefined results:
TextPad
Size ~6.0 MB
License Proprietary
Website textpad.com
TextPad is a text editor for the Microsoft Windows family of operating systems. It is produced
by Helios Software Solutions. It is currently in its eighth major version.[2]
TextPad was initially released in 1992[3] as shareware, with users requested to pay a
registration fee to support future development.[4] As of 1996 the company was an associate
member of the Association of Shareware Professionals.[5] By 1998 the company was pointing
out that the editor was " shareware (try before you buy)" and payment was necessary to use
it.[6]
Contents
1Features
o 1.1Clip Library
2Reception
3See also
4References
5External links
Features[edit]
Key features include:[7]
Reception[edit]
TextPad has received generally favorable professional reviews. Mike Williams of PC Advisor
calls it "an excellent Notepad replacement with a stack of essential features."[11] Download.com
described it as an affordable editor suited for coding, "neither the most powerful nor most
expensive shareware text tool, though many users will find it more than meets their needs at a
fraction of the cost of similar tools.
Comparison of text editors
From Wikipedia, the free encyclopedia
Jump to navigationJump to search
This article provides basic comparisons for common text editors. More feature details for text
editors are available from the Category of text editor features and from the individual products'
articles. This article may not be up-to-date or necessarily all-inclusive.
Feature comparisons are made between stable versions of software, not the upcoming
versions or beta releases – and are exclusive of any add-ons, extensions or external programs
(unless specified in footnotes).
Contents
1Overview
2Operating system support
o 2.1Cross-platform
3Natural language (localization)
4Document interface
o 4.1Notes
5Basic features
6Programming features
o 6.1Notes
7Extra features
8Key bindings
o 8.1Notes, bugs
9Protocol support
10Unicode and other character encodings
11Right-to-left and bidirectional text
12Newline support
13See also
14Notes and references
Overview[edit]
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
Plan
LPL (O
Rob 9 and
Acme 1993 C Free SI appro Yes
Pike Infern
ved)
o
Alexey
Kuznets
ov, 2016
AkelP
Alexand 2003 4.9.8 -07- C Free BSD Yes
ad
er 18
Shengal
ts
Propriet
ary,
2004
Alpha Vince with
1999 8.3.3 -12- $40 No
tk Darley BSD
10
compon
ents
2016
Aqua David
2005 3.3 -09- C, Emacs Lisp Free GPL Yes
macs Reitter
20
2018
HTML, CSS, JavaScript, ~ 150
Atom GitHub 2014 1.26.1 -04- Free MIT Yes No
C++ MB
26
2018
BBEd Rich Objective-C, Objective- Propriet
1992 12.1.3 -04- $49.99 No
it Siegel C++ ary
11
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
Bluefish
2017
Bluefi Develop
1999 2.2.10 -01- C Free GPL Yes
sh ment
27
Team
2018
Brack Adobe HTML, CSS, JavaScript,
2012 1.12 -02- Free MIT Yes
ets Systems C++
05
2017
Propriet
Coda Panic 2007 2.6.6 -06- Objective-C $99 No
ary
05
ConTE
2009
ConT XT
1999 0.98.6 -08- Object Pascal (Delphi) Free BSD Yes
EXT Project
14
Ltd
Ingyu
Crims
Kang, E 2008
on
merald 1999 3.72 -05- C++ Free GPL Yes
Edito
Editor T 14
r
eam
UVVie 8 MB
wSoft Mac
(alexey
2018
Cuda _t, MPL 12
2015 1.57.0 -06- Object Pascal (Lazarus) Free Yes
Text kvichan 2.0 MB
25
s, Win
matthias
030) 5 Mb
*nix
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
Propriet
E ary,
Alexand 2010
Text with
er 2005 2.0.2 -11- $46.95 No
Edito BSD
Stigsen 30
r compon
ents
uncha
Ken nged
0.04
ed Thomps 1970 from C Free ? Yes Yes
MB
on origin
al
2018
EditPl Sangil Sharew
1998 5.0 -03- C++ $35 No
us Kim are
26
2013 wxWin
Editr Cody
2007 0.7.20 -01- Python Free dows Yes
a Precord
05 license
2017
EmEd Emuras $39.99 Sharew
1997 17.3.2 -09- C++ No
itor oft, Inc. 1-user are
20
Lugaru 2016
epsilo Propriet
Softwar 1984 13.06 -12- C $250 No
n ary
e 06
3.28.2
(Win
2018
GNU Pr 3.20.1
gedit 2000 -05- C Free GPL Yes
oject , Mac
09
3.2.6[1
]
)
2018
Gean Enrico
2005 1.33 -02- C, GTK2 Free GPL Yes
y Tröger
25
GNU Richard 2017
11.6
Emac Stallma 1984 25.3 -09- C, Emacs Lisp Free GPL Yes Yes
MB
s n 11
2009
John E. 0.99- 3.5
JED 1992 -12- C, S-Lang Free GPL Yes Yes
Davis 19 MB[2]
13
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
2017
Slava
jEdit 1998 5.4.0 -03- Java Free GPL Yes
Pestov
18
2018
Joseph 1.3
JOE 1988 4.6 -01- C Free GPL Yes Yes
Allen MB
10
Johnath 1996
JOVE on 1983 4.16 -03- C Free GPL Yes
Payne 19
2018
KDE Pr 2000 17.12.
Kate -03- C++ Free GPL Yes
oject -12 3
08
Mansfie
ld
2016
KEDI Softwar Propriet 1.1M
1983 1.6.1 -12- C $129 No Yes
T e ary B
05
Group,
Inc.
open
Komo - 2017 Python, MPL,
Activest
do sour 10.2.3 -07- JavaScript, Perl, Tcl, PHP, Free GPL, L Yes
ate
Edit ced 11 Ruby GPL
2007
Komo 2017
Activest Python, JavaScript, Perl, Propriet
do 2001 11.0.2 -12- $295 No
ate Tcl, PHP, Ruby ary
IDE 19
2017
KWri KDE Pr 17.12.
2000 -03- C++ Free GPL Yes
te oject 3
08
Alexand
2016
er V.
LE 1997 1.16.3 -06- C++ Free GPL Yes
Lukyan
06
ov
Edward 2018
Leo K. 1996 5.7.2 -05- Python Free MIT Yes
Ream 07
2016
Light Chris
2012 0.8.1 -01- ClojureScript Free MIT Yes
Table Granger
21
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
Alexand
2011
Meta er
1999 3.6 -05- C Free GPL Yes
pad Davidso
28
n
Dave curre Public
mg 1986 C Free Yes
Conroy nt domain
2015
MinE Thomas 2015.
1992 -03- C Free GPL Yes
d Wolff 25
30
Bundl
ed
with
MS-
MS-
DOS Microso 2.0.02 Propriet
1991 DOS, No No
Edito ft 6 ary
Micros
r
oft
Windo
ws
Chris 2018
0.6
Nano Allegret 1999 2.9.6 -04- C Free GPL Yes Yes
MB
ta 27
Sebastia
no
Vigna, 2017
ne Todd 1993 3.1.1 -06- C Free GPL Yes
Lewis, 04
Daniele
Filaretti
2017
Mark
NEdit 1991 5.7 -02- C Free GPL Yes
Edel
08
Bundl
ed
with
Notep Microso Propriet
1985 6.0 MASM (originally) Micros No
ad ft ary
oft
Windo
ws
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
2003 2018
Notep
Don Ho -11- 7.5.6 -03- C++ Free GPL Yes
ad++
25 19
2011
Notep Florian 2004
4.2.25 -05- C++ Free BSD Yes
ad2 Balmer -04
06
Eric Free,
Fookes, 2014 $10
NoteT Propriet
Fookes 1995 7.2 -11- Object Pascal (Delphi) Standa No
ab ary
Softwar 04 rd, $20
e Pro
Keith
nvi ? 1.79 C Free BSD Yes
Bostic
Ioannis 2014
Peppe Propriet
Zafeiro 2014 1.4 -12- Objective-C, JavaScript $14.99 No
rmint ary
poulos 07
Univers
ity of
Pico 1992 4.64 C Free AL2 Yes
Washin
gton
PolySof
2010
PolyE t Sharew
1998 5.4 -04- $27.95 No
dit Solution are
07
s
2018
PSPa Jan 5.0.0 Propriet
2002 -04- Object Pascal (Delphi) Free No
d Fiala (277) ary
24
2011
Baara Propriet
Q10 2007 1.2.21 -06- ? Free No
Estudio ary
16
RJ Rickard 2018
Propriet
TextE Johanss 2004 13.10 -05- Object Pascal (Delphi) Free No
ary
d on 07
2017
RText Fifesoft 2003 2.6.3 -04- Java Free BSD Yes
30
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
early LPL (O
Rob
Sam 1980 stable C Free SI appro Yes
Pike
s ved)
$41.99
for
Neil 2018
macO
SciTE Hodgso 1999 4.0.5 -04- C++ HPND Yes
S. free
n 10
for
others
2016
Slick SlickEd Propriet
1988 21.0.0 -10- C, Slick-C $299 No
Edit it, Inc. ary
14
2017
Smult Peter Propriet
2004 9.2.3 -02- Objective-C $5 No
ron Borg ary
20
Sourc
Source 2017
e 4.0.00 Source Insight macro $239- Propriet
Dynami ? -02- No
Insigh 84 language $255 ary
cs 26
t
$35
SubEt TheCod 2015
comm Propriet
haEdi ingMon 2003 4.1 -02- No
ercial ary
t keys 25
use
Subli 3.1.1 2018
Jon C++, Objective-C++ Propriet 21
me 2008 (build -05- $80 No No
Skinner (macOS version), Python ary MB
Text 3176) 14
TED Juraj 2016
Freewar
Notep Simlovi 2001 6.1.1 -12- C Free No
e
ad c 04
2017
Texta
Mitchell 2007 9.6 -11- C, Lua Free MIT Yes
dept
01
Free
(also
2017
TextE Apple bundle New
2001 1.13 -07- Yes
dit Inc. d BSD
16
with m
acOS)
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
Propriet
ary,
with
MIT Yes
2004 2012 compon (fro
Text Macro $53
-10- 1.5.11 -07- Objective-C++ ents. m
Mate Mates (€39)
10 13 Version versi
2 on 2)
released
under G
PLv3
Helios
Softwar 2017 $30.00
TextP Sharew
e 1992 8.1.2 -03- (£16.5 No
ad are
Solution 07 0)
s
Bare
Text 2016
Bones Propriet
Wran 2003 5.5.1 -07- Free No
Softwar ary
gler 27
e
The
Sem 2005
Sammy 1985 Propriet
Ware 4.4 -06- C, SAL $99 No
Mitchell -11 ary
Edito 24
r
IDM
Comput 2018
Ultra Propriet
er 1994 25.0 -03- C++ $99.95 No
Edit ary
Solution 12
s
$89
Ted
2015 standa
VEDI Green, Propriet
1980 6.24.2 -01- Assembly, C rd, No
T Greenvi ary
12 $239
ew Data
Pro64
BSD or
vi Bill Joy 1976 3.7 C Free Yes Yes
CDDL
Bram 2018 GPL
8.0.18 2.2
Vim Moolen 1991 -05- C, Vim script Free compati Yes Yes
26 MB
aar 12 ble
List of text editors
Fi L
O Mi
rs at
La p ni
t es
tes e C m
p t
t Cos Soft n LI u
u R
Na Crea sta Programming t ware s av m
bl el
me tor ble language (US licen o ail ins
ic ea
ve $) se u ab tal
re se
rsi r le led
le D
on c siz
as at
e e
e e
AkelPad Yes No No No No No
Aquamacs No Yes No No No No
Text editor support for various operating systems
BBEdit No Yes No No No No
Coda No Yes No No No No
ConTEXT Yes No No No No No
EditPlus Yes No No No No No
EmEditor Yes No No No No No
KEDIT Yes No No No No No
Metapad Yes No No No No No
Notepad Yes No No No No No
Notepad++ Yes No No No No No
Notepad2 Yes No No No No No
NoteTab Yes No No No No No
Peppermint No Yes No No No No
PSPad Yes No No No No No
Text editor support for various operating systems
Q10 Yes No No No No No
RJ TextEd Yes No No No No No
Smultron No Yes No No No No
SubEthaEdit No Yes No No No No
TextEdit No Yes No No No No
TextMate No Yes No No No No
Text editor support for various operating systems
TextPad Yes No No No No No
TextWrangler No Yes No No No No
Acme English
Available languages for the UI
AkelPad English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish
Alphatk English
Aquamacs English
Atom English
BBEdit English
English, German, French, Polish(Outdated), Korean, Japanese, Italian, Czech, Dutch, Portuguese,
Brackets
Spanish, Swedish(Outdated)
Main: English. Addons: Japanese, French, Polish, Korean, Hungarian (2018), Greek, German
CudaText
(2017), and 9 others
ed
Editra English, German, French, Polish, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
epsilon English
Geany English, German, French, Polish, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish, Hindi
English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish,
gedit
Hindi
JED English
jEdit English
JOVE English
Kate[8] English, German, French, Polish, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
KEDIT English
Metapad[9] English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
mined English
MS-DOS Editor English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
NEdit English
English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish,
Notepad
Hindi
English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish,
Notepad++
Hindi
NoteTab English
nvi English
Peppermint English
PolyEdit English
Available languages for the UI
PSPad English, German, French, Polish, Japanese, Italian, Czech, Dutch, Portuguese, Spanish, Swedish
RJ TextEd English, German, French, Polish, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
RText English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
Sam English
English, German, French (Outdated (1.72)), Polish, Japanese (Outdated (1.62)), Italian, Dutch
SciTE[10]
(Outdated (1.67)), Portuguese (Outdated (1.63)), Spanish, Swedish
SlickEdit English
SubEthaEdit English
SublimeText English
TextEdit English, German, French, Polish, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish
TextMate English
Available languages for the UI
English, German, French, Polish (Outdated (4.7.3)), Japanese, Italian(Outdated (4.7.3)), Dutch
TextPad
(Outdated (4.7.3)), Spanish (Outdated (4.7.3)), Portuguese (Outdated (4.7.3))
TextWrangler English
The SemWare
English
Editor
VEDIT English
vi English
English, German, French, Polish, Korean, Japanese, Italian, Dutch, Portuguese, Spanish, Swedish,
Vim Afrikaans, Catalan, Czech, Esperanto, Finnish, Irish, Norwegian, Dutch, Russian, Slovak,
Ukrainian, Vietnamese, Chinese
Visual Studio
English, German, French, Korean, Japanese, Italian, Russian, Spanish, Chinese
Code
XEmacs English
Yi English
Document interface[edit]
Text editor support for common document interfaces
Single
MDI: MDI: tabbed MDI:
Multiple document
overlappable document window
instances window
windows interface splitting
splitting
Crimson
Yes Yes Yes Yes Yes
Editor
ed Yes No No No No
Single
MDI: MDI: tabbed MDI:
Multiple document
overlappable document window
instances window
windows interface splitting
splitting
KWrite Yes No No No No
LE Yes No No No No
Metapad Yes No No No No
MS-DOS
Yes Yes No No Yes
Editor
Nano Yes No No No No
Notepad Yes No No No No
Single
MDI: MDI: tabbed MDI:
Multiple document
overlappable document window
instances window
windows interface splitting
splitting
Notepad2 Yes No No No No
Pico Yes No No No No
Q10 No No No No No
TED Notepad ? ? ? No ?
TextEdit Yes No No No No
Single
MDI: MDI: tabbed MDI:
Multiple document
overlappable document window
instances window
windows interface splitting
splitting
The SemWare
Yes Yes No No Yes
Editor
vi Yes No No No No
Visual Studio
Yes Yes No Yes Yes
Code
MDI: MDI:
Multiple Single document MDI: tabbed
overlappable window
instances window splitting document interface
windows splitting
Notes[edit]
Multiple instances: multiple instances of the program can be opened simultaneously for
editing multiple files. Applies both for single document interface (SDI) and multiple
document interface (MDI) programs. Also applies for program that has a user interface that
looks like multiple instances of the same program (such as some versions of Microsoft
Word).
Single document window splitting: window can be split to simultaneously view different
areas of a file.
MDI: Overlappable windows: each opened document gets its own fully movable window
inside the editor environment.
MDI: Tabbed document interface: multiple documents can be viewed as tabs in a single
window.
MDI: Window splitting: splitting application window to show multiple documents (non-
overlapping windows).
Basic features[edit]
Text editor support for basic editing features
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
Instant/liv
Crimson
e (like Yes Yes Yes Yes Yes
Editor
Firefox)
Text editor support for basic editing features
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
E Text
Plug-in[23] Yes Yes Yes Yes Yes
Editor
ed No Yes No No No No
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
Komodo
Yes Yes Yes Yes Yes Yes
Edit
Komodo
Yes Yes Yes Yes Yes Yes
IDE
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
MS-DOS
No No No Yes No No
Editor
Regex-
Rectangular
Spell based Encoding Multiple
Newline conversion block
checking find & conversion undo/redo
selection
replace
Notepad No No No No No No
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
Pico Yes No No No No No
Q10 Yes ? ? ? ? ?
Source
No Yes No Yes Yes Yes
Insight
SubEthaEdi
Yes Yes Yes Yes Yes Yes[43]
t
Text editor support for basic editing features
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
Sublime
Yes Yes Yes Yes Yes Yes
Text
TED
No No No Yes Yes No
Notepad
TextWrangl
Yes Yes Yes Yes Yes Yes
er
The
SemWare Yes Yes No Yes Yes Yes
Editor
vi No Yes No No No No
Regex
-
Spell based Multiple Rectangul
Encoding convers Newline convers
checki find undo/re ar block
ion ion
ng & do selection
repla
ce
Visual
Plug-in Yes Yes Yes Yes Yes
Studio Code
Regex-
Rectangular
Spell based Encoding Multiple
Newline conversion block
checking find & conversion undo/redo
selection
replace
Programming features[edit]
Text editor support for programming features (see source code editor)
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Plug-
AkelPad Plug-in Plug-in Plug-in Plug-in Yes Plug-in No Plug-in
in
Text editor support for programming features (see source code editor)
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Atom Yes Yes Yes Yes Yes Yes Yes Yes Plug-in
Aquama
Yes Yes Yes Yes Yes Yes Yes Yes Yes
cs
BBEdit Yes Yes Yes Yes Yes Yes Yes Yes Yes
ConTEX
Yes ? ? Yes Yes Yes No No Yes
T
Crimson
Yes No Partial[49] Yes Yes No No No Yes
Editor
CudaTex
Yes Yes Yes Plug-in Yes Plug-in Yes Yes Plug-in
t
E Text
Yes ? ? Yes Yes Yes Yes Yes Yes
Editor
Text editor support for programming features (see source code editor)
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
ed No No No No No No No No external[50]
EmEdito
Yes Plug-in Plug-in Yes Yes Plug-in[53] Yes Yes Yes
r
Plug-
gedit Yes Plug-in Plug-in Yes Yes Plug-in No Yes[56]
in[55]
GNU
Yes Yes Yes Yes Yes Yes Yes Yes Yes
Emacs
JED Yes Yes Yes Yes Yes Yes Yes Yes Yes
jEdit Yes Plug-in Plug-in Yes Yes Yes Yes Yes Plug-in
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Kate Yes Plug-in Plug-in Yes Yes Yes Yes Yes Plug-in
Komodo
Yes Yes No Yes Yes Yes Yes Yes No
Edit
Komodo
Yes Yes Yes Yes Yes Yes Yes Yes Yes
IDE
Light
Yes No No Yes Yes Yes No No Partial[58]
Table
Metapad No No No No Yes No No No No
MS-DOS
No No No No No No No No No
Editor
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Symbol
databas
Syntax Bracket Auto Auto Code Text
Functio e Compiler
highlighti matchi indentati completi foldin foldin
n list (ctags integration
ng ng on on g g
or
equiv.)
Notepad No No No No No No No No No
Notepad
Yes Plug-in Plug-in Yes Yes Yes[60] Yes Yes Yes
++
Notepad
Yes No No Yes Yes No No No No
2
Pepperm
Yes Yes Yes Yes Yes Yes Yes Yes Yes
int
Pico No No No No No No No No No
Text editor support for programming features (see source code editor)
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
PolyEdit Yes No No No No No No No No
Q10 ? ? ? ? ? ? ? ? ?
RJ
Yes Yes Yes Yes Yes Yes Yes Yes Yes
TextEd
Sam No No No No No No No No external[62]
SlickEdit Yes Yes Yes Yes Yes Yes Yes Yes Yes
Smultro
Yes No No Yes Yes Yes ? ? ?
n
Source
Yes Yes Yes Yes Yes Yes No No Limited
Insight
SubEtha
Yes ? ? Yes Yes Yes Yes Yes Yes
Edit
Text editor support for programming features (see source code editor)
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Sublime Plug-
Yes Yes Yes Yes Yes Yes Yes Yes
Text in[64]
TED
No ? ? No Yes Yes No No No
Notepad
TextEdit No No No No No No No No No
TextMat
Yes Yes Plug-in Yes Yes Yes[65] Yes Yes No
e
Plug-
TextPad Yes No Yes Yes No No No Yes
in[66]
TextWra
Yes Yes No Yes Yes Yes Yes Yes Plug-in[67]
ngler
The
Plug- Partial[
SemWar Yes Yes Yes Yes Yes[69] 70] No Yes
in[68]
e Editor
UltraEdi
Yes Yes Partial[71] Yes Yes Yes Yes Yes Yes
t
Sym
bol
Synta data Brac Co Tex
Fun Auto Auto
x base e de t Compiler i
ction indent compl
highli (ctag matc fold fold ntegration
list ation etion
ghting s or hing ing ing
equi
v.)
Plug-
Vim Yes Yes Yes Yes Yes Yes Yes Yes
in[73]
Visual
Studio Yes Yes Yes Yes Yes Yes Yes Yes Yes
Code
Symbol
databas
Syntax Bracket Auto Auto Code Text
Functio e Compiler
highlighti matchi indentati completi foldin foldin
n list (ctags integration
ng ng on on g g
or
equiv.)
Notes[edit]
Syntax highlighting: Displays text in different colors and fonts according to the category
of terms.
Function list: Lists all functions from current file in a window or sidebar and allows user to
jump directly to the definition of that function for example by double-clicking on the function
name in the list. More or less realtime (does not require creating a symbol database, see
below).
Symbol database: Database of functions, variable and type definitions, macro definitions
etc. in all the files belonging to the software being developed. The database can be
created by the editor itself or by an external program such as ctags. The database can be
used to instantly locate the definition even if it is in another file.
Bracket matching: Find matching parenthesis or bracket, taking into account nesting.
Auto indentation: May refer to just simple indenting to the same level as the line above,
or intelligent indenting that is language specific, e.g., ensuring a given indent style.
Compiler integration: Allows running compilers/linkers/debuggers from within editor,
capturing the compiler output and stepping through errors, automatically moving cursor to
corresponding location in the source file.
Extra features[edit]
Text editor support for other programming features
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
Extensib
Acme Yes No No ? ? Yes ?
le
memor
AkelPad Yes Yes Yes No Yes Yes Plug-in
y
Aquamac memor
Yes Yes Yes Yes ? Yes ?
s y
Plug- No 2-5
Atom No[78] ? Yes 100B [81] No [82] Yes
in[79] MB [80]
memor
BBEdit Yes Yes Yes[83] No ? Yes Yes
y[84]
Extensib
Brackets Yes Yes No No ? Partial Yes
le
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
ConTEX memor
No Yes Yes No ? No ?
T y[86]
Crimson
No Yes Yes No No ? No ?
Editor
CudaTex
No No Plug-in No ? ? Yes Plug-in
t
E Text
Yes Yes No[87] Yes Yes ? Yes ?
Editor
memor
EditPlus ? Yes Yes No ? Yes Yes
y
Editra ? ? ? ? 2 GB ? ? ?
EmEdito
Yes Yes Yes No Yes ? Yes Yes
r
GNU
Yes Yes Yes Yes 2 EB Yes Yes Yes
Emacs
on 64-
Text editor support for other programming features
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
bit OS[89
][90]
memor Plug-
JED Yes No Yes No Yes No
y[91] ins
No
jEdit Yes No Yes No (heap)[92 ? Yes Yes
]
memor
JOVE Yes No No No ? No No
y
memor
LE Yes No No No[97] ? Yes ?
y[98]
Text editor support for other programming features
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
Light
No Yes No No ? ? No Yes
Table
memor
Metapad Yes Yes No No ? No No
y[99]
mined ? ? ? ? ? ? Yes ?
EDIT No
(MS- No No No No (64~30 No No No
DOS) 0 KB)
2 GB,
for as
long as
there is
EDIT
disk
(DR- No No No No Yes No No
swap
DOS)
space
for two
tempora
ry files
Nano Yes No No No ? ? ? ?
Large Long
Graphical Macro
Text shell Collaborat file line Multi-line Search
shell languag
integration ive editing suppor suppor regex support in files
integration e
t t
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
memor
Notepad Yes Yes No No ? No No
y
2GB,
Notepad+ with plug- 64Bit
Yes Yes Yes more in ? Yes Yes
+ in
Test[100][1
01]
memor
Notepad2 No No No No ? No ?
y[102]
nvi Yes No No ? ? ? ? ?
Peppermi
Yes Yes Yes No Yes Yes Yes Yes
nt
Pico ? ? ? No ? ? ? ?
memor
PSPad Yes Yes Yes No ? with plug-in Yes
y[104]
Q10 ? ? ? ? ? ? ? ?
Text editor support for other programming features
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
RJ
Yes Yes Yes No No ? Yes ?
TextEd
externa
Sam Yes No Yes No ? ? Yes
l[62]
Smultron ? ? ? ? ? ? ? ?
Source ? ? Yes No ? ? No ?
Insight
SubEtha
Yes Yes No Yes ? ? Yes ?
Edit
TED
Yes Yes No No No ? ? ?
Notepad
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
memor
TextPad No Yes Yes No ? Yes Yes
y[105]
TextWra memor
Yes Yes Yes No ? Yes ?
ngler y[84]
Yes Only in
The special
SemWare Yes Yes Yes DOS multi- 2 GB Yes ? Yes
Editor user
version
approx.
vi Yes No Yes No ? Yes Yes
65 MB
Visual
Studio Yes Yes Yes No ? ? Yes Yes
Code
on 64-
XEmacs Yes Yes Yes Yes bit ? Yes Yes
OS[89]
Text editor support for other programming features
Lar Lon
Graphica Macr Sea
Text Collabo ge g Multi-
l o rch
shellinteg rative file line line regexsu
shellinteg lang in
ration editing supp supp pport[76]
ration uage files
ort ort
Large Long
Graphical Macro
Text shell Collaborat file line Multi-line Search
shell languag
integration ive editing suppor suppor regex support in files
integration e
t t
In general, most text editors do not support large text files. Some restrict themselves to
available in-core RAM while others use sophisticated virtual memory management techniques
and paging algorithms.[108]
Search in files: Perform search (and possibly replace) in multiple files on disk, for example on
a sub-directory and recursively all the directories below it. Similar to grep.
Key bindings[edit]
Support for custom key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
Acme No No No No No No No No No
AkelPad Yes ? ? ? ? ? ? ? ?
Alphatk ? ? ? ? ? ? ? ? ?
Text editor support for key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
Plug-
Brackets Yes Partial Yes Plug-in No No No No
in
ConTEXT ? ? ? ? ? ? ? ? ?
Crimson ? ? ? ? ? ? ? ? ?
Editor
CudaText Yes ? ? ? ? ? ? ? ?
E Text Editor ? ? ? ? ? ? ? ? ?
ed No No No No No No No No No
EditPlus Yes ? ? ? ? ? ? ? ?
Editra No No No Yes No No No No No
EmEditor Yes ? ? ? ? ? ? ? ?
Text editor support for key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
Geany Yes ? ? ? ? ? ? ? ?
gedit Yes[111] ? ? ? ? ? ? ? ?
GNU Emacs Yes Yes Yes Yes Yes Partial[ Yes[113] Yes[114] Yes[114]
112]
LE Yes ? ? No ? ? ? ? ?
Plug-
Light Table Yes Partial ? Plug-in ? ? ? ?
in
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
KWrite Yes ? ? ? ? ? ? ? ?
Metapad ? ? ? ? ? ? ? ? ?
mg ? ? ? ? Yes ? ? ? ?
MS-DOS
No No No No No No No No No
Editor
NEdit Yes ? ? ? ? ? ? ? ?
Notepad No Yes No No No No No No No
Notepad2 No ? No No No No ? ? ?
NoteTab ? ? ? ? ? ? ? ? ?
Text editor support for key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
nvi ? ? ? Yes ? ? ? ? ?
PolyEdit ? ? ? ? ? ? ? ? ?
PSPad Yes ? ? ? ? ? ? ? ?
Q10 ? ? ? ? ? ? ? ? ?
RJ TextEd Yes ? ? ? ? ? ? ? ?
RText Yes ? ? ? ? ? ? ? ?
Sam No No No No No No No No No
SciTE Partial[120] ? ? No No No ? ? ?
Smultron ? ? ? ? ? ? ? ? ?
Text editor support for key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
Source
Yes ? No No No No ? ? ?
Insight
SubEthaEdit No No Yes No No No No No No
TED Notepad ? ? ? ? ? ? ? ? ?
TextEdit No No Yes No No No No No No
TextMate No No Yes No No No No No No
TextPad Yes ? ? ? ? ? ? ? ?
TextWrangle
Yes ? Yes No Yes No ? ? ?
r[109][124]
The
SemWare Yes ? ? ? ? ? ? ? ?
Editor
UltraEdit Yes ? No ? ? ? ? ? ?
vi Yes No No Yes No No No No No
Text editor support for key bindings.
Dynamic IB
ally M mac Em Pic Word WordPe Bri
Vi
customiz CU OS acs o Star rfect ef
able A
XEmacs Yes Yes Yes Yes Yes Partial[ Yes[133] Yes[114] Yes[114]
112]
Dynamicall
y IBM WordSta WordPerfe
macOS Vi Emacs Pico Brief
customizab CUA r ct
le
Notes, bugs[edit]
Vim: custom maps of Ctrl-1 .. Ctrl-9, Ctrl-0 cannot be set, nor is Control-Shift-<char>
distinguished from Ctrl-<char>.[134][135]
Notepad++: custom shortcuts of Shift-<char> cannot be set, they need an added modifier
such as Ctrl or Alt. i.e. SCI_LINESCROLLUP cannot be bound to "Shift-I" as the "Add"
button is greyed out.
Emacs and Pico: pico uses most of Emacs's motion and deletion commands: ^F ^B ^P ^N
^D etc.
Protocol support[edit]
Support for editing files over a network or the Internet.
Text editor support for remote file editing over network protocols
AkelPad No No No No
Brackets Plug-in No No No
CudaText Yes No No No
ed No No No No
EditPlus Yes No No No
Text editor support for remote file editing over network protocols
Editra ? ? ? ?
EmEditor No No No No
Geany No No No No
JED No No No No
Plug-
jEdit Plug-in[138] Yes[139] Plug-in.
in[138]
JOE No No No No
JOVE No No No No
LE No No No No
KEDIT No No No No
Metapad No No No No
mined ? ? ? ?
MS-DOS Editor No No No No
Nano No No Yes No
NEdit No No No No
Notepad No No No No
Notepad2 No No No No
nvi No No No No
Pico No No No No
PolyEdit No No No No
Text editor support for remote file editing over network protocols
PSPad Yes No No No
Q10 ? ? ? ?
RText No No No No
Sam No No No No
SciTE No No No No
Smultron Yes ? ? ?
Source Insight No No No No
SubEthaEdit Yes No No No
Plug-
Sublime text Plug-in [141] Yes Plug-in [143]
in [142]
TextEdit No No No No
TextMate Yes[136] No No No
Text editor support for remote file editing over network protocols
TextPad No No No No
VEDIT Yes No No No
vi No No No No
Plug-
Vim Plug-in[146] Plug-in[146] Plug-in[146]
in[146]
Yi No No No No
Text editor support for some of the most common character encodings
ed Yes ? ? ? Yes No
Text editor support for some of the most common character encodings
JOVE Yes No No No No No
LE Yes ? ? ? Yes No
NEdit Yes ? ? ? No No
Q10 ? ? ? ? ? ?
vi Yes ? ? ? Yes No
Yi Yes ? ? ? Yes No
Acme No No
AkelPad No No
Alphatk ? ?
Aquamacs ? ?
Atom No No
BBEdit No No
Brackets ? ?
Coda ? ?
ConTEXT ? ?
Crimson Editor ? ?
Right to left (RTL) & bidirectional (bidi) support
E Text Editor ? ?
ed ? ?
EditPlus No No
Editra ? ?
EmEditor No No
Geany ? ?
JED ? ?
jEdit No No
JOE ? ?
JOVE No No
LE ? ?
KEDIT No No
Komodo Edit No No
Komodo IDE No No
KWrite ? ?
Metapad ? ?
MS-DOS Editor ? ?
Nano ? ?
RTL Bidi
NEdit ? ?
Notepad2 No No
NoteTab ? ?
Right to left (RTL) & bidirectional (bidi) support
nvi ? ?
Peppermint No No
Pico ? ?
PolyEdit ? ?
PSPad ? ?
Q10 ? ?
RText ? ?
Sam No No
SciTE No No
SlickEdit ? ?
Smultron ? ?
Source Insight No No
Sublime Text No No
TED Notepad ? ?
TextMate No No
TextPad ? ?
TextWrangler No No
UltraEdit No No
VEDIT ? ?
vi ? ?
XEmacs ? ?
Yi ? ?
Right to left (RTL) & bidirectional (bidi) support
RTL Bidi
Newline support[edit]
Support for newline characters in line endings
ed No Yes No
LE Yes Yes No
Notepad Yes No No
nvi ? Yes ?
Sam ? ? ?
vi No Yes No
Yi ? Yes ?
Support for newline characters in line endings
See also
List of text editors
From Wikipedia, the free encyclopedia
Jump to navigationJump to search
This list needs additional citations for verification. Please
help improve this article by adding citations to reliable sources.
Unsourced material may be challenged and removed. (February
2011) (Learn how and when to remove this template message)
Contents
[hide]
Extensible Versatile
Default under OpenVMS. ?
Editor (EVE)
Language-Sensitive
Programmer's Editor for OpenVMS implemented using TPU. Yes
Editor (LSE)
A clone based on the ideas of the vi editor and designed for use
vim both from a command line interface and in a graphical user Yes
interface.
Alphatk Proprietary
BBEdit Proprietary
CodeWright Proprietary
E Text Editor Default under IBM OS/2 versions 2-4[citation needed]. Proprietary
EmEditor Proprietary
Epsilon Proprietary
Geany A fast and lightweight editor / IDE, uses GTK+. Free software
iA Writer Proprietary
Name Description License
Kate A basic text editor for the KDE desktop. Free software
Light Table A text editor and IDE with real-time, inline expression Free software
evaluation. Intended mainly for dynamic languages
Name Description License
Multi-Edit Proprietary
NoteTab Proprietary
PolyEdit Proprietary
Programmer's File
Freeware
Editor (PFE)
RJ TextEd Freeware
SlickEdit Proprietary
SubEthaEdit (formerly
Proprietary
called Hydra)
TextWrangler Freeware
The SemWare
Editor (TSE) (formerly Proprietary
called QEdit).
Name Description License
TopStyle Proprietary
Ulysses Proprietary
VEDIT Proprietary
WinEdt Proprietary
The default line editor on Unix since the birth of Unix. Either ed or a
ed compatible editor is available on all systems labeled as Unix (not by Free software
default on every one).
The default on MS-DOS 5.0 and higher and is included with all 32-
EDIT bit versions of Windows that do not rely on a separate copy of DOS. Proprietary
Up to including MS-DOS 6.22, it only supported files up to 64 KB.
The text editor in DR DOS 6.0, Novell DOS 7, OpenDOS 7.01, DR-
DOS 7.02 and higher. Supports large files for as long as swap space
EDIT Proprietary
is available. Version 7 and higher optionally supports a pseudo-
graphics user interface named NewUI.
The text editor in DR DOS 3.31 through DR DOS 5.0, and the
EDITOR Proprietary
predecessor of EDIT.
Stands for Easy Editor, is part of the base system of FreeBSD, along
ee Free software
with vi.[8]
Others[edit]
LE Free software
mcedit Full featured terminal text editor for Unix-like systems. Free software
The SemWare
(TSE for DOS) (formerly called QEdit) Proprietary
Editor
vi clones[edit]
busybox Free
A small vi clone with a minimum of commands and features.
vi software
Free
Elvis The first vi clone and the default vi in Minix.
software
Free
nvi A new implementation and currently the standard vi in BSD distributions.
software
STEVIE (ST Editor for VI Enthusiasts) for the Atari ST, the starting point for Free
STEVIE
vim and xvi software
An extended version of the vi editor, with many additional features designed to Free
vim
be helpful in editing program source code. software
ACiDDraw – designed for editing ASCII text art. Supports ANSI color (ANSI X3.64)
JavE – ASCII editor, portable to any platform running a Java GUI
PabloDraw – ANSI/ASCII editor allowing multiple users to edit via TCP/IP network
connections
TheDraw – ANSI/ASCII text editor for DOS and PCBoard file format support
ASCII font editors[edit]
Historical[edit]
Visual and full-screen editors[edit]
abbix
From Wikipedia, the free encyclopedia
Zabbix
svn://svn.zabbix.com/
Repository
Website www.zabbix.com
Zabbix is an open source monitoring software for networks, operating systems and
applications, created in Latvia by Alexei Vladishev. It is designed to monitor and track the
status of various network services, servers, and other network hardware.
Zabbix can use MySQL, MariaDB, PostgreSQL, SQLite, Oracle or IBM DB2 to store data.[2] Its
backend is written in C and the web frontend is written in PHP. Zabbix offers several
monitoring options:
Simple checks can verify the availability and responsiveness of standard services such as
SMTP or HTTP without installing any software on the monitored host.
A Zabbix agent can also be installed on UNIX and Windows hosts to monitor statistics
such as CPU load, network utilization, disk space, etc.
As an alternative to installing an agent on hosts, Zabbix includes support for monitoring
via SNMP, TCP and ICMP checks, as well as over IPMI, JMX, SSH, Telnetand using
custom parameters. Zabbix supports a variety of near-real-time notification mechanisms,
including XMPP.
Released under the terms of GNU General Public License version 2, Zabbix is free software.
Contents
1History
2Features
3Development
o 3.1Source code
o 3.2Releases
4See also
5References
6Further reading
7External links
History[edit]
Zabbix started as an internal software project in 1998. After three years, in 2001, it was
released to the public under GPL.[3], three years later until the first stable version, 1.0, was
released in 2004.
7 Apr
Zabbix 1.0alpha1 is released as GPL[4] - -
2001
23 Mar
Zabbix 1.0 released[5] -
2004
Zabbix 1.x
6 Feb
Zabbix 1.1 released[5] - -
2006
29 May
Zabbix 1.4 released[5] - -
2007
11 Sep
Zabbix 1.6 released[5] - -
2008
7 Dec
Zabbix 1.8 released[5] - -
2009
Zabbix 2.x
12 Nov
Zabbix 2.2 LTS released[5] August, 2017 [8] August, 2019 [9]
2013
11 Sep
Zabbix 2.4 released[5] - -
2014
Zabbix 3.x
16 Feb
Zabbix 3.0 LTS released[5] February, 2019 [10] February, 2021 [11]
2016
14 Sep
Zabbix 3.2 released[5] - -
2016
22 Aug
Zabbix 3.4 released[5] - -
2017
Features[edit]
Architecture
Agent-less monitoring.
Web-based interface.
Support for both polling and trapping mechanisms.
Monitoring
JMX monitoring.
Web monitoring.
Security and authentication
Audit log.
Secure user authentication.
Flexible user permissions.
Notification capabilities
Development[edit]
Dashboard of the Zabbix 3.0.0 release
See also[edit]
References[edit]
1. Jump up^ "Release Notes for Zabbix 3.4.11". 25 June 2018. Retrieved 10 July2018.
2. Jump up^ List of supported databases in the manual
3. ^ Jump up to:a b Presentation, containing early history
4. Jump up^ Freshmeat announcement page
5. ^ Jump up to:a b c d e f g h i j k Zabbix release list
6. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
7. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
8. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
9. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
10. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
11. Jump up^ https://www.zabbix.com/life_cycle_and_release_policy
12. Jump up^ https://www.zabbix.com/rn/rn3.4.0
13. Jump
up^https://www.zabbix.com/documentation/3.4/manual/introduction/whatsnew340#remote_com
mand_support_through_proxies
14. Jump up^ https://www.zabbix.com/requirements
15. Jump up^ https://www.zabbix.com/requirements
Vidmar, Anže (March 12, 2007). ZABBIX: State-of-the-art network monitoring Linux.com
Ramm, Mark (March 15, 2005). The Watcher Knows, Linux Magazine
Schroder, Carla (May 24, 2005). Monitor Your Net with Free, High-Performance ZABBIX, Enterprise
Networking Planet
ZABBIX - monitoring your applications, network and servers debianhelp.co.uk (Installation
Instructions for Debian or Ubuntu Machines)
Further reading[edit]
(2010) Zabbix 1.8 Network Monitoring - Packt Publishing ISBN 978-1-84719-768-9
(2013) Mastering Zabbix - Packt Publishing ISBN 978-1-78328-349-1
(2015) Zabbix Cookbook - Packt Publishing
(2015) Zabbix Network Monitoring Essentials - Packt Publishing
(2016) Zabbix Network Monitoring - Second Edition - Packt
Publishing ISBN 9781782161288
Up: Connected: An Internet Encyclopedia
Up: Programmed Instruction Course
Up: Section 2 - Domain Naming
Prev: Naming
Next: RFC 1034
DNS Theory
DNS uses a distributed database to maintain its world-wide tree of names.
DNS uses a distributed database protocol to delegate control of domain
name hierarchies among zones, each managed by a group of name servers.
For example, *.cnn.com, where * is anything, is completely the
responsibility of CNN (Turner Broadcasting, as they say). CNN is
responsible for constructing name servers to handle any domain name
ending in cnn.com, referred to as their Zone of Authority (ZOA). A zone
takes its name from its highest point, so this zone is simply called cnn.com.
CNN registers their zone with InterNIC, who loads their name server IP
addresses into the root name servers, which makes this information
available to the global Internet. CNN can also make subdelegations, like
delegating news.cnn.comto their news division. This can be as simple as
creating new name server entries with the longer names, but mechanisms
exist if the delegee wants to operate an independent name server (see RFC
1034 §4.2).
Of course, CNN doesn't actually maintain their own name server. Like
most people, they let their Internet service provider do it for them. In their
case, that means ANSnet, so nis.ans.net is their primary name server,
and ns.ans.net their backup name server. How do I know this? I accessed
InterNIC's Whois service and retrieved cnn.com's domain information
record. Follow the link to try this yourself.
So, name servers contain pointers to other name servers, that can be used
to transverse the entire domain naming hierarchy. You may be wondering
how Internet hosts find an entry point to this system. Currently, it can be
done in three major ways, all of which depend on preloading the IP
address of at least one name server. One way is to preconfigure addresses
of the root name servers. This method is typically used by Internet service
providers on their name servers, typically in the UNIX
file /etc/namedb/named.root. Another way is to preload the address of a
name server that supports recursive queries, and send any name server
lookups to it. This method is common among dial-up Internet subscribers.
The user preloads the address of the service provider's name server, which
processes all queries and returns the answer to the client. The final method
is to automatically configure the address of a recursive name server,
perhaps using a PPP extension (RFC 1877) that is not yet widely
supported.
Once a host has been configured with initial name server addresses, it can
use the DNS protocols to locate the name servers responsible for any part
of the DNS naming hierarchy, and retrieve the resource records (RRs) that
match DNS names to IP
Welcome! The Internet Encyclopedia is my attempt to take the Internet
tradition of open, free protocol specifications, merge it with a 1990s Web
presentation, and produce a readable and useful reference to the technical
operation of the Internet. Some of my favorite parts are the essays
on Ping and Traceroute and the CIDR and DNS sections of the Course.
I'd like to thank all those who have expressed interest and support for this
project.
Brent Baccala, Editor
Connected: An Internet Encyclopedia
baccala@freesoft.org
Submit Query
Sendmail
"address exhaustion"
Acroynm RIP
Wildcarding subnet*
Binary Arithmetic
For some important aspects of Internet engineering, most notably IP Addressing,
an understanding of binary arithmetic is critical. Many strange-looking decimal
numbers can only be understood by converting them (at least mentally) to binary.
All digital computers represent data as a collection of bits. A bit is the smallest
possible unit of information. It can be in one of two states - off or on, 0 or 1. The
meaning of the bit, which can represent almost anything, is unimportant at this
point. The thing to remember is that all computer data - a text file on disk, a
program in memory, a packet on a network - is ultimately a collection of bits.
If one bit has two different states, how many states do two bits have? The answer
is four. Likewise, three bits have eight states. For example, if a computer display
had eight colors available, and you wished to select one of these to draw a
diagram in, three bits would be sufficient to represent this information. Each of
the eight colors would be assigned to one of the three-bit combinations. Then,
you could pick one of the colors by picking the right three-bit combination.
Obviously, if a byte has 256 possible states, its exact state can be represented by
a number from 1 to 256. However, since zero is a very important number, a byte
is more typically represented by a number from 0 to 255. This is very common,
and with bit pattern 00000000 representing zero, and bit
pattern 11111111 representing 255. The numbers matching these two patterns, and
everything in between, can be computed by assigning a weight to each bit,
multiplying each bit's value (0 or 1) by its weight, and then adding the totals. For
example, here's how 217 is represented as 11011001 in binary:
To convert a number from decimal to binary, begin at leftmost bit position (128).
If the number is larger than or equal to the bit's weight, write a 1 in the bit
position, subtract the bit's weight from the number, and continue with the
difference. If the number is less than the bit's weight, write a 0 in the bit position
and continue without any subtraction. Here's an illustration of converting 141 to
binary:
There is a simpler way to convert bytes back and forth between binary and
decimal; akin to memorizing multiplication tables. The byte can split into two
four-bit halves, each half called a nibble. Memorize the decimal values for the
high nibble (they're just the multiples of 16). The low nibble is trivial. Every
number between 0 and 255 is the sum of one of the high nibble values and one of
the low nibble values. Write the high nibble next to the low nibble, and you have
the byte value in binary. Conversely, an eight-bit binary byte can be split in half,
each nibble converted to decimal and two decimal numbers added together.
The most common bit patterns in Internet engineering are those with a string of
one bits, followed by a string of zero bits. Here are all such bytes, along with
their decimal representation, computed just like the example using 217.
Manual:IP/Firewall/NAT
< Manual:IP | Firewall
Applies to RouterOS:v3, v4 +
Contents
[hide]
1Summary
o 1.1Masquerade
2Properties
3Stats
4Menu specific commands
5Basic examples
o 5.1Source NAT
5.1.1Masquerade
5.1.2Source nat to specific address
o 5.2Destination NAT
5.2.1Forward all traffic to internal host
5.2.2Port mapping/forwarding
5.2.3Port forwarding to internal FTP server
o 5.31:1 mapping
o 5.4Carrier-Grade NAT (CGNAT) or NAT444
Summary
Sub-menu: /ip firewall nat
Network Address Translation is an Internet standard that allows hosts on local area networks
to use one set of IP addresses for internal communications and another set of IP addresses for
external communications. A LAN that uses NAT is referred as natted network. For NAT to
function, there should be a NAT gateway in each natted network. The NAT gateway (NAT
router) performs IP address rewriting on the way a packet travel from/to LAN.
There are two types of NAT:
source NAT or srcnat. This type of NAT is performed on packets that are originated
from a natted network. A NAT router replaces the private source address of an IP
packet with a new public IP address as it travels through the router. A reverse
operation is applied to the reply packets travelling in the other direction.
destination NAT or dstnat. This type of NAT is performed on packets that are
destined to the natted network. It is most comonly used to make hosts on a private
network to be acceesible from the Internet. A NAT router performing dstnat replaces
the destination IP address of an IP packet as it travel through the router towards a
private network.
Hosts behind a NAT-enabled router do not have true end-to-end connectivity. Therefore some
Internet protocols might not work in scenarios with NAT. Services that require the initiation of
TCP connection from outside the private network or stateless protocols such as UDP, can be
disrupted. Moreover, some protocols are inherently incompatible with NAT, a bold example is
AH protocol from the IPsec suite.
To overcome these limitations RouterOS includes a number of so-called NAT helpers, that
enable NAT traversal for various protocols.
Masquerade
Firewall NAT action=masquerade is unique subversion of action=srcnat , it was designed
for specific use in situations when public IP can randomly change, for example DHCP-server
changes it, or PPPoE tunnel after disconnect gets different IP, in short - when public IP is
dynamic.
Every time interface disconnects and/or its IP address changes, router will clear all
masqueraded connection tracking entries that send packet out that interface, this way
improving system recovery time after public ip address change.
Unfortunately this can lead to some issues when action=masquerade is used in setups with
unstable connections/links that get routed over different link when primary is down. In such
scenario following things can happen:
Properties
Property
accept - accept
add-dst-to-a
add-src-to-a
dst-nat - repla
ports parame
jump - jump to th
log - add a mess
ip:port and lengt
masquerade - r
packet to IP dete
netmap - creates
hosts on private
passthrough -
redirect - repl
the router's loca
return - passes
same - gives a pa
frequently used
src-nat - repla
connection-type (ftp | h323 | irc | pptp | quake3 | sip | tftp; Default: ) Matches packets from rela
be enabled under /ip firew
unicast - IP add
local - if dst-ad
broadcast - pa
multicast - pa
count - maximum
time - specifies th
burst - number of
mode - the classif
expire - specifies
ipsec-policy (in | out, ipsec | none; Default: ) Matches the policy used b
match the policy used for
ipsec - matches if th
none - matches pack
For example, if router rece
rule ipsec-policy=in
ipv4-options (any | loose-source-routing | no-record-route | no-router-alert | no- Matches IPv4 header optio
source-routing | no-timestamp | none | record-route | router-alert | strict-source-routing |
timestamp; Default: ) any - match pack
loose-source
based on inform
no-record-ro
information sup
no-router-al
no-source-ro
no-timestamp
record-route
router-alert
strict-sourc
timestamp - ma
count - maximum
time - specifies th
burst - number of
WeightThreshold
treated as port s
DelayThreshold -
scan subsequenc
LowPortWeight -
HighPortWeight -
tcp-flags (ack | cwr | ece | fin | psh | rst | syn | urg; Default: ) Matches specified TCP flag
ack - acknowledg
cwr - congestion
ece - ECN-echo f
fin - close conne
psh - push functi
rst - drop conne
syn - new conne
urg - urgent data
time (time-time,sat | fri | thu | wed | tue | mon | sun; Default: ) Allows to create filter base
Stats
/ip firewall nat print stats will show additional read-only properties
Property
By default print is equivalent to print static and shows only static rules.
Basic examples
Source NAT
Masquerade
If you want to "hide" the private LAN 192.168.0.0/24 "behind" one address 10.5.8.109 given to
you by the ISP, you should use the source network address translation (masquerading) feature
of the MikroTik router. The masquerading will change the source IP address and port of the
packets originated from the network 192.168.0.0/24 to the address 10.5.8.109 of the router
when the packet is routed through it.
To use masquerading, a source NAT rule with action 'masquerade' should be added to the
firewall configuration:
All outgoing connections from the network 192.168.0.0/24 will have source address 10.5.8.109
of the router and source port above 1024. No access from the Internet will be possible to the
Local addresses. If you want to allow connections to the server on the local network, you
should use destination Network Address Translation (NAT).
Source nat to specific address
If you have multiple public IP addresses, source nat can be changed to specific IP, for
example, one local subnet can be hidden behind first IP and second local subnet is
masqueraded behind second IP.
Destination NAT
Forward all traffic to internal host
If you want to link Public IP 10.5.8.200 address to Local one 192.168.0.109, you should use
destination address translation feature of the MikroTik router. Also if you want allow Local
server to initiate connections to outside with given Public IP you should use source address
translation, too.
Add Public IP to Public interface:
Add rule allowing access to the internal server from external networks:
Add rule allowing the internal server to initate connections to the outer networks having its
source address translated to 10.5.8.200:
Port mapping/forwarding
If you would like to direct requests for a certain port to an internal machine (sometimes called
opening a port, port mapping), you can do it like this:
This rule translates to: when an incoming connection requests TCP port 1234, use the DST-
NAT action and redirect it to local address 192.168.1.1 and the port 1234
Port forwarding to internal FTP server
As you can see from illustration above FTP uses more than one connection, but only command
channel should be forwarded by Destination nat. Data channel is considered as related
connection and should be accepted with "accept related" rule if you have strict firewall. Note
that for related connections to be properly detected FTP helper has to be enabled.
Note that active FTP might not work if client is behind dumb firewall or NATed router, because
data channel is initiated by the server and cannot directly access the client.
If client is behind Mikrotik router, then make sure that FTP helper is enabled
5061
5 pptp
1:1 mapping
If you want to link Public IP subnet 11.11.11.0/24 to local one 2.2.2.0/24, you should use
destination address translation and source address translation features with action=netmap.
Same can be written using different address notation, that still have to match with the
described network
CGNAT configuration on RouterOS does not differ from any other regular source NAT
configuration:
The service provider router performing CGNAT needs to maintain a state table for all the
address translations: this requires a lot of memory and CPU resources.
Console gaming problems. Some games fail when two subscribers using the same outside
public IPv4 address try to connect to each other.
Tracking of users for legal reasons means extra logging, as multiple households go behind
one public address.
Anything requiring incoming connections is broken. While this already was the case with
regular NAT, end users could usually still set up port forwarding on their NAT router.
CGNAT makes this impossible. This means no web servers can be hosted here, and IP
Phones cannot receive incoming calls by default either.
Some web servers only allow a maximum number of connections from the same public IP
address, as a means to counter DoS attacks like SYN floods. Using CGNAT this limit is
reached more often and some services may be of poor quality.
6to4 requires globally reachable addresses and will not work in networks that employ
addresses with limited topological span.
More on things that can break can be read in this article [1]
Packets with Shared Address Space source or destination addresses MUST NOT be
forwarded across Service Provider boundaries. Service Providers MUST filter such packets on
ingress links. In RouterOS this can be easily done with firewall filters on edge routers:
Service providers may be required to do logging of MAPed addresses, in large CGN deployed
network that may be a problem. Fortunately RFC 7422 suggests a way to manage CGN
translations in such a way as to significantly reduce the amount of logging required while
providing traceability for abuse response.
RFC states that instead of logging each connection, CGNs could deterministically map
customer private addresses (received on the customer-facing interface of the CGN, a.k.a.,
internal side) to public addresses extended with port ranges.
In RouterOS described algorithm can be done with few script functions. Lets take an example:
100.64.1.1 2.2.2.2:2000-2099
100.64.1.2 2.2.2.2:2100-2199
100.64.1.3 2.2.2.2:2200-2299
100.64.1.4 2.2.2.2:2300-2399
100.64.1.5 2.2.2.2:2400-2499
100.64.1.6 2.2.2.2:2500-2599
Instead of writing NAT mappings by hand we could write a function which adds such rules
automatically.
After pasting above script in the terminal function "addNatRules" is available. If we take our
example, we need to map 6 shared network addresses to be mapped to 2.2.2.2 and each
address uses range of 100 ports starting from 2000. So we run our function:
Manual:Interface/VLAN
< Manual:Interface
Contents
[hide]
1Summary
2802.1Q
3Q-in-Q
4Properties
5Setup examples
o 5.1Layer2 VLAN examples
5.1.1Port based VLAN tagging #1 (Trunk and Access ports)
5.1.2Port based VLAN tagging #2 (Trunk and Hybrid ports)
o 5.2Layer3 VLAN examples
5.2.1Simple VLAN routing
5.2.2InterVLAN routing
o 5.3RouterOS /32 and IP unnumbered addresses
Summary
Sub-menu: /interface vlan
Standards: IEEE 802.1Q
Virtual Local Area Network (VLAN) is a Layer 2 method that allows multiple Virtual LANs on a
single physical interface (ethernet, wireless, etc.), giving the ability to segregate LANs
efficiently.
You can use MikroTik RouterOS (as well as Cisco IOS, Linux and other router systems) to
mark these packets as well as to accept and route marked ones.
As VLAN works on OSI Layer 2, it can be used just as any other network interface without any
restrictions. VLAN successfully passes through regular Ethernet bridges.
You can also transport VLANs over wireless links and put multiple VLAN interfaces on a single
wireless interface. Note that as VLAN is not a full tunnel protocol (i.e., it does not have
additional fields to transport MAC addresses of sender and recipient), the same limitation
applies to bridging over VLAN as to bridging plain wireless interfaces. In other words, while
wireless clients may participate in VLANs put on wireless interfaces, it is not possible to have
VLAN put on a wireless interface in station mode bridged with any other interface.
802.1Q
The most commonly used protocol for Virtual LANs (VLANs) is IEEE 802.1Q. It is a
standardized encapsulation protocol that defines how to insert a four-byte VLAN identifier into
Ethernet header. (see Figure 12.1.)
Each VLAN is treated as a separate subnet. It means that by default, a host in a specific VLAN
cannot communicate with a host that is a member of another VLAN, although they are
connected in the same switch. So if you want inter-VLAN communication you need a router.
RouterOS supports up to 4095 VLAN interfaces, each with a unique VLAN ID, per interface.
VLAN priorities may also be used and manipulated.
When the VLAN extends over more than one switch, the inter-switch link has to become a
'trunk', where packets are tagged to indicate which VLAN they belong to. A trunk carries the
traffic of multiple VLANs; it is like a point-to-point link that carries tagged packets between
switches or between a switch and router.
Note: The IEEE 802.1Q standard has reserved VLAN IDs with special use cases, the following
VLAN IDs should not be used in generic VLAN setups: 0, 1, 4095
Q-in-Q
Original 802.1Q allows only one vlan header, Q-in-Q on the other hand allows two or more vlan
headers. In RouterOS Q-in-Q can be configured by adding one vlan interface over another.
Example:
/interface vlan
add name=vlan1 vlan-id=11 interface=ether1
add name=vlan2 vlan-id=12 interface=vlan1
If any packet is sent over 'vlan2' interface, two vlan tags will be added to ethernet header - '11'
and '12'.
Properties
Property
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) Address Resolution Pro
Note: MTU should be set to 1500 bytes same as on Ethernet interfaces. But this may not work
with some Ethernet cards that do not support receiving/transmitting of full size Ethernet
packets with VLAN header added (1500 bytes data + 4 bytes VLAN header + 14 bytes
Ethernet header). In this situation MTU 1496 can be used, but note that this will cause packet
fragmentation if larger packets have to be sent over interface. At the same time remember that
MTU 1496 may cause problems if path MTU discovery is not working properly between source
and destination.
Setup examples
VLANs on Mikrotik environment are also described here: VLANs with bridging
Warning: These configurations are known to cause issues with other vendor devices,
especially in STP enabled network, you should use bridge VLAN filtering instead in case you
are using RouterOS v6.41 or newer. You can read more about this Here.
Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
Add necessary VLAN interfaces on ethernet interfaces to make them as VLAN trunk ports
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
R4:
[admin@MikroTik] ip address>
R4:
[admin@MikroTik] ip address>
At this point it should be possible to ping router R4 from router R2 and vice versa:
To make sure if VLAN setup is working properly, try to ping R1 from R2. If pings are timing out
then VLANs are successfully isolated.
"From R2 to R1:"
InterVLAN routing
If separate VLANs are implemented on a switch, then a router is required to provide
communication between VLANs. Switch works at OSI layer 2 so it uses only Ethernet header
to forward and does not check IP header. For this reason we must use the router that is
working as a gateway for each VLAN. Without a router, a host is unable to communicate
outside of its own VLAN. Routing process between VLANs described above is called inter-
VLAN communication.
To illustrate inter-VLAN communication, we will create a trunk that will carry traffic from three
VLANs (VLAN2 and VLAN3, VLAN4) across a single link between a Mikrotik router and a
manageable switch that supports VLAN
trunking.
Each VLAN has its own separate subnet (broadcast domain) as we see in figure above:
VLAN 2 – 10.10.20.0/24;
VLAN 3 – 10.10.30.0/24;
VLAN 4 – 10.10.40.0./24.
VLAN configuration on most switches is straightforward, basically we need to define which
ports are members of the VLANs and define a 'trunk' port that can carry tagged frames
between the switch and the router.
"Configuration example on MikroTik router:"
"Create VLAN interfaces:"
/interface vlan
add name=VLAN2 vlan-id=2 interface=ether1 disabled=no
add name=VLAN3 vlan-id=3 interface=ether1 disabled=no
add name=VLAN4 vlan-id=4 interface=ether1 disabled=no
/ip address
add address=10.10.20.1/24 interface=VLAN2
add address=10.10.30.1/24 interface=VLAN3
add address=10.10.40.1/24 interface=VLAN4
RouterOS /32 and IP unnumbered addresses
In RouterOS, to create a point-to-point tunnel with addresses you have to use address with a
network mask of '/32' that effectively brings you the same features as some vendors
unnumbered IP address.
There are 2 routers RouterA and RouterB where each is part of networks 10.22.0.0/24 and
10.23.0.0/24 respectively and to connect these routers using VLANs as a carrier with the
following configuration:
RouterA:
RouterB:
Background
It is sole responsibility of administrator to configure MTUs such that intended services and
applications can be successfully implemented in network. In other words - administrator must
make sure that MTUs are configured in a way that packet sizes does not exceed the
capabilities of network equipment.
Originally MTU was introduced because of the high error rates and low speed of
communications. Fragmentation of the data stream gives ability to correct corruption errors
only by resending corrupted fragment, not the whole stream. Also on low speed connections
such as modems it can take too much time to send a big fragment, so in this case
communication is possible only with smaller fragments.
But in present days we have much lower error rates and higher speed of communication, this
opens a possibility to increase the value of MTU. By increasing value of MTU we will result in
less protocol overhead and reduce CPU utilization mostly due to interrupt reduction.
This way some non-standard frames started to emerge:
Giant or Jumbo frames - frames that are bigger than standard (IEEE) Ethernet MTU
Baby Giant or Baby Jumbo frames - frames that are just slightly bigger that standard
(IEEE) Ethernet MTU
It is common now for Ethernet interfaces to support physical MTU above standard, but this can
not be taken for granted. Abilities of other network equipment must be taken into account as
well - for example, if 2 routers with Ethernet interfaces supporting physical MTU 1526 are
connected through Ethernet switch, in order to successfully implement some application that
will produce this big Ethernet frames, switch must also support forwarding such frames.
MTU on RouterOS
Mikrotik RouterOS recognizes several types of MTU:
IP/Layer-3/L3 MTU
MPLS/Layer-2.5/L2.5 MTU
MAC/Layer-2/L2 MTU
MAC/Layer-2/L2 MTU
L2MTU indicates the maximum size of the frame without MAC header that can be sent by this
interface.
Starting from the RouterOS v3.25 L2MTU values can be seen in "/interface" menu. L2MTU
support is added for all Routerboard related Ethernet interfaces, VLANs, Bridge, VPLS and
wireless interfaces. Some of them support configuration of L2MTU value. All other Ethernet
interfaces might indicate L2MTU only if the chip set is the same as Routerboard Ethernets.
This will allow users to check if desired setup is possible. Users will be able to utilize additional
bytes for VLAN and MPLS tags, or simple increase of interface MTU to get rid of the some
unnecessary fragmentation.
This table shows max-l2mtu supported by Mikrotik RouterBoards (Starting from the RouterOS
v5.3 also available in "/interface print" menu as value of read-only "max-l2mtu" option):
Integrated Solutions
RouterBoard
RB Groove series ether1:2028
RB Metal series ether1:2028
RB SXT series, RB LHG, RB LDF ether1:2028
RB SXT Lite series ether1:2028
RB SXT G series, RB DynaDish, wAP ac ether1:4076
RB OmniTik series ether1:4076; ether
RB OmniTik ac series ether1-ether5:4074
RB mAP, RB mAP lite, RB cAP, RB wAP ether1-ether2:2028
RB750 ether1:4076; ether
RB750r2, RB750P-PBr2, RB750UPr2 ether1-ether5:2028
RB750UP ether1:4076; ether
RB751U-2HnD ether1:4076; ether
RB951-2n ether1:4076; ether
RB941-2nD, RB951Ui/RB952Ui series ether1-ether5:2028
RB750GL, RB750Gr2 ether1-ether5:4074
RB750Gr3 ether1-ether5:2026
RB751G-2HnD ether1-ether5:4074
RB951G-2HnD ether1-ether5:4074
RB962UiGS, RB960PGS ether1-ether5:4074
RB1100Hx2 ether1-ether10:949
RB1100AHx2 ether1-ether10:949
CCR1009 series ether1-ether4:1022
CCR1016 series ether1-ether12:102
CCR1036 series ether1-ether12:102
CCR1072 series ether1:9116; sfp-sf
CRS109-8G-1S ether1-ether8:4064
CRS125-24G-1S ether1-ether24:406
CRS112-8G-4S ether1-ether8:9204
CRS106-1C-5S sfp1-sfp5:9204; co
CRS210-8G-2S+ ether1-ether8:9204
CRS212-1G-10S-1S+ ether1:9204; sfp1-
CRS226-24G-2S+ ether1-ether24:920
CRS326-24G-2S+, CSS326-24G-2S+ ether1-ether24:102
CRS317-1G-16S+ ether1:10218; sfp-
CRS328-24P-4S+ ether1-ether24:102
D52G-5HacD2HnD (hAP ac²) ether1-ether5:9124
cAP ac ether1-ether2:9124
wAP60G ether1:9124
RB260GS series, CSS106-5G-1S, CSS106-1G-4P-1S ether1-ether5:9198
RB FTC ether1:4046; sfp1:4
RBM33G ether1-ether3:2026
RBM11G ether1:2026
RB760iGS ether1-ether5:2026
RouterBOARD
RouterBoard
RB411 series ether1:1526
RB433 series ether1:1526; ether2-ether3:1522
RB450 ether1:1526; ether2-ether5:1522
RB450Gx4 ether1-ether5:9214
RB493 series ether1:1526; ether2-ether9:1522
RB411GL ether1:1520
RB433GL ether1-ether3:1520
RB435G ether1-ether3:1520
RB450G ether1-ether5:1520
RB493G ether1-ether9:1520
RB711 series ether1:2028
RB711G series ether1:4076
RB800 ether1-ether2:9500; ether3:9116
RB850Gx2 ether1-ether5:1580
RB911G ether1:4076
RB912UAG ether1:4076
RB921UAGS, RB922UAGS ether1:4076; sfp1:4076
RB953GS ether1-ether2:4074; sfp1:4074; sfp2:4076
RB2011 series ether1-ether5:4074; ether6-ether10:2028;
RB3011 series ether1-ether5:8156; ether6-ether10:8156;
RB44Ge ether1-ether4:9116
Old Products
RouterBoard
RB600 series ether1-ether3:9500
RB1000 ether1-ether4:9500
RB1100 ether1-ether10:9498; ether11-ether13:9116
RB1100AH ether1-ether10:9498; ether11:9500, ether12-ether13:
RB1200 ether1-ether5:4078, ether6-ether8:4080, ether9-ether
RB750 (old revision) ether1:1526; ether2-ether5:1522
RB750G ether1-ether5:1524
RB333 ether1-ether3:1632
RB1xx ether1-ether5:1518; ether6-ether9:1514
RB532, CrossRoads ether1-ether3:1600
RB44G ether1-ether4:7200
RB44GV ether1-ether4:9000
RB250GS ether1-ether5:9198
All wireless interfaces in RouterOS (including Nstreme2) support 2290 byte L2MTU.
Warning: L2MTU configuration changes on Cloud Core Routers evoke all interface reload (link
down - link up) due to necessary internal processes.
It is recommended to configure L2MTU with caution by keeping in mind that it can cause short
interruption with connected devices.
MPLS/Layer-2.5/L2.5 MTU
Configured in "/mpls interface" menu, specifies maximal size of packet, including MPLS labels,
that is allowed to send out by the particular interface (default is 1508).
Make sure that MPLS MTU is smaller or equal to L2MTU
MPLS MTU affects packets depending on what action MPLS router is performing. It is strongly
recommended that MPLS MTU is configured to the same value on all routers forming MPLS
cloud because of effects MPLS MTU has on MPLS switched packets. This requirement means
that all interfaces participating in MPLS cloud must be configured to the smallest MPLS MTU
values among participating interfaces, therefore care must be taken to properly select
hardware to be used.
MPLS Switching
If packet with labels included is bigger than MPLS MTU, MPLS tries to guess protocol that is
carried inside MPLS frame.
If this is IP packet, MPLS produces ICMP Need Fragment error. This behavior mimics IP
protocol behavior. Note that this ICMP error is not routed back to originator of packet but is
switched towards end of LSP, so that egress router can route it back.
If this is not IP packet, MPLS simply drops it, because it does not know how to interpret the
contents of packet. This feature is very important in situations where MPLS applications such
as VPLS are used (where frames that are MPLS tagged are not IP packets, but e.g.
encapsulated Ethernet frames as in case of VPLS) - if somewhere along the LSP MPLS MTU
will be less than packet size prepared by ingress router, frames will simply get dropped.
IP ingress
When router first introduces label (or labels) on IP packet, and resulting packet size including
MPLS labels exceeds MPLS MTU, router behaves as if interface MTU was exceeded - either
fragments packet in fragments that does not exceed MPLS MTU when labels are attached (if
IP Dont Fragment is not set), or generates ICMP Need Fragmentation error that is sent back to
originator.
VPLS ingress
When router encapsulates Ethernet frame for forwarding over VPLS pseudowire, it checks if
packet size with VPLS Control Word (4 bytes) and any necessary labels (usually 2 labels - 8
bytes), exceeds MPLS MTU of outgoing interface. If it does, VPLS fragments packet so that it
honours MPLS MTU of outgoing interface. Packet is defragmented at egress point of VPLS
pseudowire.
IP/Layer-3/L3 MTU
Configured as interface MTU setting (/interface <type> <name> set mtu=X). Specifies how big
IP packets router is allowed to send out the particular interface.
If router receives IP packet of size 1500, but MTU for outgoing interface is set to 1400, router
will either fragment the packet (if "Don't Fragment" bit is not set in IP header) or drop the
packet and send ICMP "Need Fragmentation" error back to originator (this is essential for Path
MTU Discovery to work).
Sometimes it can be bad idea to change IP MTU from its default 1500 bytes on router
interfaces if complete path end-to-end is not in administrators control. Although IP
fragmentation and end-to-end Path MTU Discovery is intended to handle this situation, if ICMP
Need Fragmentation errors are filtered somewhere along the path, Path MTU Discovery will
not work.
There are several features in MikroTik RouterOS that can benefit from possibility to exceed
standard MTU
Simple Examples
In these examples we will take a look at frames entering and leaving router via Ethernet
interfaces.
Simple Routing
The image shows the packet MTU size for simple routing, packets size is not modified.
Routing with VLAN Encap
Each VLAN tag is 4 bytes long, VLAN tag is added by router. L2-MTU is increased by 4 bytes.
Q-in-Q router - this router will receive standard 1500 byte Ethernet frame and will add two
VLAN tags to the packet. Then packet will be sent out via Ethernet network to the second
router
VPLS router - this router will remove outer VLAN tag and will bridge packet with the
remaining VLAN tag with VPLS tunnel. VPLS tunnel will take packet through the MPLS
network to the third router.
MPLS Edge router - will remove VPLS and VLAN tags and bridge packet to the client
Ethernet network.
ummary
Basic use cases and configuration examples for Cloud Router Switch features.
Warning: This article applies to CRS1xx and CRS2xx series switches and not to
CRS3xx series switches. For CRS3xx series devices read the CRS3xx series
switches manual.
Management IP Configuration
Untagged
Untagged (VLAN 0) Management IP address has to be assigned to the master-port.
/interface ethernet
set ether3 master-port=ether2
set ether4 master-port=ether2
set ether5 master-port=ether2
/ip address
add address=192.168.88.1/24 interface=ether2 network=192.168.88.0
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether5 hw=yes
/ip address
add address=192.168.88.1/24 interface=bridge1 network=192.168.88.0
If you are intending to use invalid VLAN filtering (which you should), then ports, from which you
are going to access the switch, needs to be added to the VLAN table for untagged (VLAN 0)
traffic, for example, in case you want to access the switch from ether2:
/interface ethernet switch vlan
add vlan-id=0 ports=ether2,switch1-cpu
Tagged
For tagged VLAN Management IP address add VLAN 99 interface and assign IP address to it.
Since the master-port receives all the traffic coming from switch-cpu port, VLAN interface has
to be configured on the master-port, in this case "ether2" port. Now from switch-chip point there
also has to be VLAN 99 tagging on switch1-cpu port.
/interface vlan
add name=vlan99 vlan-id=99 interface=ether2
/ip address
add address=192.168.88.1/24 interface=vlan99 network=192.168.88.0
/interface vlan
add name=vlan99 vlan-id=99 interface=bridge1
/ip address
add address=192.168.88.1/24 interface=vlan99 network=192.168.88.0
After valid VLAN99 configuration unknown/invalid VLAN filtering can be enabled in global
switch settings.
VLAN
Note: It is recommended to get Serial Console cable and test it before configuring
VLANs because you may lose access to the CPU and/or the port you are
connected to.
Note: Some changes may take some time to take effect due to already learned
MAC addreses. In such cases flushing Unicast Forwarding Database can
help: /interface ethernet switch unicast-fdb flush
Note: For CRS3xx series devices you must use bridge VLAN filtering, you can
read more about it in the Bridge VLAN Filtering section.
Choose a master port and enslave the ports you need to be in the same switch group.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Add VLAN 200, VLAN 300 and VLAN 400 tagging on ether2 port to create it as VLAN trunk
port. Egress-VLAN-Tag entry is mandatory for every VLAN to make VLAN access ports
work. If VLAN trunk port has not been chosen yet, Egress-VLAN-Tag entry has to be
added with tagged-ports="".
VLAN membership definitions in the VLAN table are required for proper isolation. Adding
entries with VLAN id and ports makes that VLAN traffic valid on those ports.
After valid VLAN configuration unknown/invalid VLAN forwarding can be disabled in global
switch settings.
Note: It is possible to use the built-in switch chip and the CPU at the same time to
create a Switch-Router setup, where a device acts as a switch and as a router at
the same time. You can find a configuration example in the CRS-Router guide.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Add initial VLAN assignments (PVID) for untagged traffic on ether6, ether7, ether8 ports.
Add VLAN 200, VLAN 300 and VLAN 400 tagging on ports according to diagram.
The tagged-ports option allow multiple values to support tagging on many ports.
/interface ethernet switch egress-vlan-tag
add tagged-ports=ether2,ether7,ether8 vlan-id=200
add tagged-ports=ether2,ether6,ether8 vlan-id=300
add tagged-ports=ether2,ether6,ether7 vlan-id=400
VLAN membership definitions in the VLAN table are required for proper isolation. Adding
entries with VLAN id and ports makes that VLAN traffic valid on those ports.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Warning: Internally all MAC addresses in MAC based VLANs are hashed, certain
MAC addresses can have the same hash, which will prevent a MAC address
being loaded in to the switch chip if the hash matches with a hash from a MAC
address that has been already loaded, for this reason it is recommended to use
Port bases VLANs in combination with MAC based VLANs. This is a hardware
limitation.
/interface ethernet
set ether7 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
Add VLAN 200, VLAN 300 and VLAN 400 tagging on ether2 port to create it as VLAN trunk
port.
InterVLAN Routing
InterVLAN Routing
InterVLAN routing configuration consists of two main parts – VLAN tagging in switch-chip and
routing in RouterOS. This configuration can be used in many applications by combining it with
DHCP server, Hotspot, PPP and other features for each VLAN. Additionally this example
covers blocking of unwanted other VLAN traffic on ports.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Set VLAN tagging on CPU port for all VLANs to make packets tagged before they are
routed and add ingress VLAN translation rules to ensure correct VLAN id assignment is
done on access ports.
For routing add VLAN interfaces on master-port (bridge) because it connects with CPU
port and add IP addresses to created VLAN interfaces. In this example three 192.168.x.1
addresses are added to vlan200, vlan300 and vlan400 interfaces.
Q-in-Q VLAN
CRS-1:The first switch on the edge of service provider network has to properly indentify traffic
from customer VLAN id on port and assign new service VLAN id with ingress VLAN translation
rules.
VLAN trunk port configuration for service provider VLAN tags is in the same egress-vlan-
tag table.
The main difference from basic Port Based VLAN configuration is that CRS switch-chip has to
be set to do forwarding according to service (outer) VLAN id instead of customer (inner) VLAN
id.
/interface ethernet
set ether2 master-port=ether1
set ether9 master-port=ether1
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether9 hw=yes
CRS-2: The second switch in the service provider network require only switched ports
using master-port and bridge-type configured to do forwarding according to service
(outer) VLAN id instead of customer (inner) VLAN id.
/interface ethernet
set ether10 master-port=ether9
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether9 hw=yes
add bridge=bridge1 interface=ether10 hw=yes
/interface ethernet
set ether4 master-port=ether3
set ether10 master-port=ether3
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether10 hw=yes
CVID Stacking
It is possible to use CRS1xx/CRS2xx series switches for CVID Stacking setups.
CRS1xx/CRS2xx series switches are capable of VLAN filtering based on the outer tag of
tagged packets that have two CVID tags (double CVID tag), these switches are also capable of
adding another CVID tag on top of an existing CVID tag (CVID Stacking). For example, in a
setup where ether1 is receiving tagged packets with CVID 10, but it is required
that ether2 sends out these packets with another tag CVID 20 (VLAN10 inside VLAN20) while
filtering out any other VLANs, the following must be configured:
/interface ethernet
set ether2 master-port=ether1
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
Add a service tag SVID 20 to packets that have a CVID 10 tag on ether1:
Note: Since the switch is set to look up VLAN ID based on service tag, which is
overridden with a different EtherType, then VLAN filtering is only done on the
outer tag of a packet, the inner tag is not checked.
Mirroring
Mirroring
The Cloud Router Switches support three types of mirroring. Port based mirroring can be
applied to any of switch-chip ports, VLAN based mirroring works for all specified VLANs
regardless switch-chip ports and MAC based mirroring copies traffic sent or received from
specific device reachable from the port configured in Unicast Forwarding Database.
/interface ethernet
set ether7 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
/interface ethernet
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Trunking
Trunking
The Trunking in the Cloud Router Switches provides static link aggregation groups with
hardware automatic failover and load balancing. IEEE802.3ad and IEEE802.1ax compatible
Link Aggregation Control Protocol is not supported yet. Up to 8 Trunk groups are supported
with up to 8 Trunk member ports per Trunk group.
Configuration requires a group of switched ports and an entry in the Trunk table.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
This example also shows proper bonding configuration in RouterOS on the other end.
/interface bonding
add name=bonding1 slaves=ether2,ether3,ether4 mode=balance-xor
transmit-hash-policy=layer-2-and-3 \
link-monitoring=mii mii-interval=100ms
Note: You can find a working example for trunking and port based VLANs at CRS
VLANs with Trunks page.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
CRS1xx/2xx switches also allow to learn one dynamic MAC per port to ensure only one end
user device is connected no matter of its MAC address.
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
Isolation
Port Level Isolation
One or multiple uplink ports are shared among all users for accessing gateway or router.
Port group Isolated Ports is for guest users. Communication is through the uplink ports
only.
Port group Community 0 is for department A. Communication is allowed between the
group members and through uplink ports.
Port group Community X is for department X. Communication is allowed between the
group members and through uplink ports.
The Cloud Router Switches use port-level isolation profiles for Private VLAN implementation:
/interface ethernet
set ether6 master-port=ether2
set ether7 master-port=ether2
set ether8 master-port=ether2
set ether9 master-port=ether2
set ether10 master-port=ether2
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
add bridge=bridge1 interface=ether9 hw=yes
add bridge=bridge1 interface=ether10 hw=yes
The first part of port isolation configuration is setting the Uplink port – set port profile to 0 for
ether2.
Then continue with setting isolation profile 1 to all isolated ports and adding the communication
port for port isolation profile 1.
Choose a master port and enslave the ports you need to be within the same switch group.
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether5 hw=yes
Set the same Community port profile for all DHCP client ports. Community port profile
numbers are from 2 to 30.
And configure port isolation/leakage profile for selected Community (2) to allow DHCP
traffic destined only to port where the trusted DHCP server is located. registration-
status and traffic-type properties have to be set empty in order to apply restriction
only for DHCP protocol.
/interface ethernet
set ether7 master-port=ether6
set ether8 master-port=ether6
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Add UFDB entries to match specific MACs on ether7 and apply QoS group1
Configure ether7 port queues to work according Strict Priority and QoS scheme only for
destination address.
/interface ethernet
set ether7 master-port=ether6
set ether8 master-port=ether6
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Add UFDB entry to match specific MAC on ether8 and apply QoS group1
Configure ether8 port queues to work according Strict Priority and QoS scheme only for
destination address.
If CRS switch supports Access Control List, this configuration would be simplier.
/interface ethernet
set ether7 master-port=ether6
set ether8 master-port=ether6
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
Configure ether6, ether7, ether8 port queues to work according Strict Priority and QoS
scheme only for VLAN based QoS.
To achieve such a behaviour, switch together ether1, ether2 and ether3 ports:
/interface bridge
add name=bridge1 igmp-snooping=no protocol-mode=none
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
Map each PCP value to an internal priority value, for convenience reasons simply map
PCP to an internal priority 1-to-1:
Since the switch will empty the largest queue first and you need the highest priority to be
served first, then you can assign this internal priority to a queue 1-to-1:
Finally, set each switch port to schedule packets based on the PCP value:
Bandwidth Limiting
Both Ingress Port policer and Shaper provide bandwidth limiting features for CRS switches.
Broadcast storm control example on ether5 port with 500 packet limit per second:
Example with multiple packet types which includes ARP and ND protocols and
unregistered multicast traffic. Unregistered multicast is traffic which is not defined in
Multicast Forwarding database.
Slave ports are dynamically added to the bridge only to show STP status. Forwarding
through switched ports still are handled by hardware switch chip.
Manual:Interface/VLAN
< Manual:Interface
Contents
[hide]
1Summary
2802.1Q
3Q-in-Q
4Properties
5Setup examples
o 5.1Layer2 VLAN examples
5.1.1Port based VLAN tagging #1 (Trunk and Access ports)
5.1.2Port based VLAN tagging #2 (Trunk and Hybrid ports)
o 5.2Layer3 VLAN examples
5.2.1Simple VLAN routing
5.2.2InterVLAN routing
o 5.3RouterOS /32 and IP unnumbered addresses
Summary
Sub-menu: /interface vlan
Standards: IEEE 802.1Q
Virtual Local Area Network (VLAN) is a Layer 2 method that allows multiple Virtual LANs on a
single physical interface (ethernet, wireless, etc.), giving the ability to segregate LANs
efficiently.
You can use MikroTik RouterOS (as well as Cisco IOS, Linux and other router systems) to
mark these packets as well as to accept and route marked ones.
As VLAN works on OSI Layer 2, it can be used just as any other network interface without any
restrictions. VLAN successfully passes through regular Ethernet bridges.
You can also transport VLANs over wireless links and put multiple VLAN interfaces on a single
wireless interface. Note that as VLAN is not a full tunnel protocol (i.e., it does not have
additional fields to transport MAC addresses of sender and recipient), the same limitation
applies to bridging over VLAN as to bridging plain wireless interfaces. In other words, while
wireless clients may participate in VLANs put on wireless interfaces, it is not possible to have
VLAN put on a wireless interface in station mode bridged with any other interface.
802.1Q
The most commonly used protocol for Virtual LANs (VLANs) is IEEE 802.1Q. It is a
standardized encapsulation protocol that defines how to insert a four-byte VLAN identifier into
Ethernet header. (see Figure 12.1.)
Each VLAN is treated as a separate subnet. It means that by default, a host in a specific VLAN
cannot communicate with a host that is a member of another VLAN, although they are
connected in the same switch. So if you want inter-VLAN communication you need a router.
RouterOS supports up to 4095 VLAN interfaces, each with a unique VLAN ID, per interface.
VLAN priorities may also be used and manipulated.
When the VLAN extends over more than one switch, the inter-switch link has to become a
'trunk', where packets are tagged to indicate which VLAN they belong to. A trunk carries the
traffic of multiple VLANs; it is like a point-to-point link that carries tagged packets between
switches or between a switch and router.
Note: The IEEE 802.1Q standard has reserved VLAN IDs with special use cases, the following
VLAN IDs should not be used in generic VLAN setups: 0, 1, 4095
Q-in-Q
Original 802.1Q allows only one vlan header, Q-in-Q on the other hand allows two or more vlan
headers. In RouterOS Q-in-Q can be configured by adding one vlan interface over another.
Example:
/interface vlan
add name=vlan1 vlan-id=11 interface=ether1
add name=vlan2 vlan-id=12 interface=vlan1
If any packet is sent over 'vlan2' interface, two vlan tags will be added to ethernet header - '11'
and '12'.
Properties
Property
arp (disabled | enabled | proxy-arp | reply-only; Default: enabled) Address Resolution Pro
Note: MTU should be set to 1500 bytes same as on Ethernet interfaces. But this may not work
with some Ethernet cards that do not support receiving/transmitting of full size Ethernet
packets with VLAN header added (1500 bytes data + 4 bytes VLAN header + 14 bytes
Ethernet header). In this situation MTU 1496 can be used, but note that this will cause packet
fragmentation if larger packets have to be sent over interface. At the same time remember that
MTU 1496 may cause problems if path MTU discovery is not working properly between source
and destination.
Setup examples
VLANs on Mikrotik environment are also described here: VLANs with bridging
Warning: These configurations are known to cause issues with other vendor devices,
especially in STP enabled network, you should use bridge VLAN filtering instead in case you
are using RouterOS v6.41 or newer. You can read more about this Here.
Port based VLAN tagging #1 (Trunk and Access ports)
Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
Add necessary VLAN interfaces on ethernet interfaces to make them as VLAN trunk ports
/interface vlan
add interface=ether2 name=eth2-vlan200 vlan-id=200
add interface=ether2 name=eth2-vlan300 vlan-id=300
add interface=ether2 name=eth2-vlan400 vlan-id=400
/interface bridge
add name=bridge-vlan200
add name=bridge-vlan300
add name=bridge-vlan400
Add VLAN interfaces to their corresponding bridges and ethernet interfaces where
untagged traffic is necessary
R4:
[admin@MikroTik] ip address>
R4:
[admin@MikroTik] ip address>
At this point it should be possible to ping router R4 from router R2 and vice versa:
"From R4 to R2:"
To make sure if VLAN setup is working properly, try to ping R1 from R2. If pings are timing out
then VLANs are successfully isolated.
"From R2 to R1:"
InterVLAN routing
If separate VLANs are implemented on a switch, then a router is required to provide
communication between VLANs. Switch works at OSI layer 2 so it uses only Ethernet header
to forward and does not check IP header. For this reason we must use the router that is
working as a gateway for each VLAN. Without a router, a host is unable to communicate
outside of its own VLAN. Routing process between VLANs described above is called inter-
VLAN communication.
To illustrate inter-VLAN communication, we will create a trunk that will carry traffic from three
VLANs (VLAN2 and VLAN3, VLAN4) across a single link between a Mikrotik router and a
manageable switch that supports VLAN
trunking.
Each VLAN has its own separate subnet (broadcast domain) as we see in figure above:
VLAN 2 – 10.10.20.0/24;
VLAN 3 – 10.10.30.0/24;
VLAN 4 – 10.10.40.0./24.
VLAN configuration on most switches is straightforward, basically we need to define which
ports are members of the VLANs and define a 'trunk' port that can carry tagged frames
between the switch and the router.
"Configuration example on MikroTik router:"
"Create VLAN interfaces:"
/interface vlan
add name=VLAN2 vlan-id=2 interface=ether1 disabled=no
add name=VLAN3 vlan-id=3 interface=ether1 disabled=no
add name=VLAN4 vlan-id=4 interface=ether1 disabled=no
/ip address
add address=10.10.20.1/24 interface=VLAN2
add address=10.10.30.1/24 interface=VLAN3
add address=10.10.40.1/24 interface=VLAN4
RouterA:
RouterB:
/ip address add address=10.23.0.1/24 interface=ether1
/interface vlan add interface=ether2 vlan-id=1 name=vlan1
/ip address add address=10.23.0.1/32 interface=vlan1
network=10.22.0.1
/ip route add gateway=10.22.0.1 dst-address=10.22.0.0/24
INICIANDO
MikroTik
Danilo M. Fugi - Ciência da Computação - 6º Período - Disciplina Redes
2
danilofugi@gmail.com
IF Sul de Minas - Muzambinho
O QUE É MIKROTIK
Talvez já tenha utilizado e não saiba, a maioria dos provedores de
acesso utiliza essa tecnologia para autenticar seus clientes para
navegação na internet, onde temos que digitar o login e a senha para
depois navegar na web.
INSTALAÇÃO E CONFIGURAÇÃO
Primeiramente vamos entender como funciona a instalação.
Tipo de utilização:
Provedor de Internet --------- (P. rede 01) Mikrotik (P. rede 02) ----
-------- Clientes
* Percebam que temos 02 placas de rede
Instalação:
Vamos à configuração.
[admin@MikroTik] >
CONFIGURANDO IPS
# add interface=internet
# print #ver resultados
# enable numbers=0
# print #já deve ter pego o ip automático
Agora vamos setar o IP do lado dos clientes que será IP fixo e será o
gateway da rede interna
# Add interface=clientes
address=SeuIpRedeClientes/MascaradeRede #exemplo do IP/máscara
192.168.0.1/24 <- não sabe o que é o 24, pesquise por máscara de rede
representação binária
# setup
Dhcp server interface: clientes
Dhcp address space: EndereçodaSuaRede/mascara (já deve ter reconhecido)
Gateway for dhcp network: EndereçoIpConfiguradoClientes (192.168.0.1)
Addresses to give out: 192.168.0.2-192.168.0.254 (pode alterar se quiser, pois será atribuído
desde o ip 2 até 254)
Dns servers: 8.8.8.8 (já deve ter reconhecido seu dns primário)
Lease time: 3d (3 dias)
0 dhcp_pool1
# set name=Servidor numbers=0
# print
0 Servidor
CONFIGURANDO O FIREWALL
Agora sim, seus clientes já tem acesso à internet e o NAT está ativo.
CONFIGURANDO O HOTSPOT
Solicitar usuário e senha para navegar na internet.
# print
# setup
Hotspot interface: clientes
Local address os network: 192.168.0.1/24
Masquerade network: yes
Address pool of network: 192.168.0.2-192.168.0.254
Select certificate: none (podemos deixar none para não importer nenhum SSL)
Ip address of smtp server: 0.0.0.0
Dns servers: (colocar endereço de gateway da internet ou servidor dns do provedor)
Dns name: mkt.provedornome.net (ou outro nome que desejar)
Name of local hotspot user: joao (primeiro usuario do hotspot – o qualquer nome)
Password for the user: 123 (senha do usuário)
# set name=HotSpotProvedor
Remover usuário:
# remove NomedoUsuario
# print
# add name=plano1 rate-limit=512k/1024k #podemos fazer vários
planos
# print
# set joao profile=plano1
CONFIGURAÇÃO DE SEGURANÇA
Nosso Usuário ADMIN, que é padrão, acessa o Sistema Operacional e sem
senha possui um potencial de segurança baixíssimo, onde qualquer cliente
poderá acessar o MikroTik e reconfigurar tudo! Vamos trocar isso, né?!
# print
# add name=super password=123456 group=full #utilize uma senha
adequada!
# remove admin
Endereço: ftp://192.168.0.1
Login: admin
Senha: (nada)
# set enable=yes
# print
# enable numbers=0
CONCLUSÃO
Amigos, chegamos ao fim deste tutorial. Espero ter ajudado nas
configurações!
anual:IP/Hotspot
< Manual:IP
Contents
[hide]
1HotSpot
o 1.1Sub Categories
2HotSpot Setup
3ip hotspot
4ip hotspot active
5ip hotspot host
6IP Bindings
7Cookies
HotSpot
The MikroTik HotSpot Gateway provides authentication for clients before access to public
networks .
HotSpot Gateway features:
different authentication methods of clients using local client database on the router, or
remote RADIUS server;
users accounting in local database on the router, or on remote RADIUS server;
walled-garden system, access to some web pages without authorization;
login page modification, where you can put information about the company;
automatic and transparent change any IP address of a client to a valid address;
Hotspot can work reliably only when IPv4 is used. Hotspot relies on Firewall NAT rules which
currently are not supported for IPv6.
Sub Categories
HotSpot Setup
The simplest way to setup HotSpot server on a router is by /ip hotspot setup command.
Router will ask to enter parameters required to successfully set up HotSpot. When finished,
default configuration will be added for HotSpot server.
ip hotspot
Menu is designed to manage HotSpot servers of the router. It is possible to run HotSpot on
Ethernet, wireless, VLAN and bridge interfaces. One HotSpot server is allowed per interface.
When HotSpot is configured on bridge interface, set HotSpot interface as bridge interface not
as bridge port, do not add public interfaces to bridge ports. You can add HotSpot servers
manually to /ip hotspot menu, but it is advised to run /ip hotspot setup, that adds all necessary
settings.
ip hotspot active
HotSpot active menu shows all clients authenticated in HotSpot, menu is informational it is not
possible to change anything here.
ip hotspot host
Host table lists all computers connected to the HotSpot server. Host table is informational and
it is not possible to change any value there
IP Bindings
Sub-menu: /ip hotspot ip-binding
IP-Binding HotSpot menu allows to setup static One-to-One NAT translations, allows to bypass
specific HotSpot clients without any authentication, and also allows to block specific hosts and
subnets from HotSpot network
Property
address (IP Range; Default: "") The original IP address of
mac-address (MAC; Default: "") MAC address of the client
server (string | all; Default: "all") Name of the HotSpot serve
regular - performs On
bypassed - performs t
blocked - translation
Cookies
Sub-menu: /ip hotspot cookie
He aqui un abstract del libro TCP ilustrated capitulo 3 IP Protocol sub tema IP Routing: