Bookmarks
ReferenceNetworks & sysadminVerified

MikroTik

MikroTik RouterOS is the network operating system for MikroTik routers. The reference covers WinBox and the terminal, bridges and VLANs, DHCP, the firewall, NAT, WireGuard and backups.

checked 1 Nov · next check 8 Nov · 49 min read

Sections
13
Reading
49 min
Current version
7.25.1
Written from
help.mikrotik.com/docs

Check status of the reference

Verified 1 Nov · next check 8 Nov

The sections were compared with the release notes, the check found nothing, and all source links respond.

  1. Verified
  2. Scheduled check

What MikroTik RouterOS is and how it works

MikroTik RouterOS is the network operating system for MikroTik routers, switches and wireless devices. It combines routing, a firewall, VPN, Wi-Fi management, queues (QoS) and monitoring tools.

RouterOS comes preinstalled on MikroTik devices and can be upgraded even on models that were discontinued long ago, except for the MIPS-LE family: RouterOS v7 does not run on the RB100 or some of the RB700 series. It can also be installed on x86 computers, and CHR (Cloud Hosted Router) is RouterOS built for virtual machines. With the default configuration v7 needs at least 32 MB of memory, and 64 MB or more for complex setups.

CHR has its own perpetual licence: the free tier is limited to 1 Mbps per interface, while the paid P1, P10 and P-Unlimited levels allow up to 1 Gbps, 10 Gbps and unlimited speed. All other RouterOS features work at every level, and you can try the paid levels free for 60 days (/system/license/renew).

How a packet passes through the router

The packet flow determines which rules see a packet. An incoming packet first passes through prerouting: connection tracking and dstnat. Then comes the routing decision: a packet addressed to the router itself goes to the input chain, and the rest go to forward and postrouting, where srcnat is applied. Packets created by the router itself go through output.

Simplified: the bridge, mangle, RAW and queues are not shown. Firewall rules work in input, forward and output.

If a packet arrives on a bridge port, the bridging decision comes first, based on the destination MAC address. A packet reaches routing only if it is addressed to the router itself or to another network. On devices with a switch chip, the chip forwards packets between bridge ports without loading the CPU.

WinBox, WebFig or the terminal

All management methods change the same configuration: WinBox windows mirror the terminal menus. The “IP → Firewall” path in WinBox is /ip/firewall in the terminal, and the CLI Reference on the MikroTik website follows the same paths: /interface, /ip/address, /routing/bgp, /system.

MethodWhat it isWhen to use it
WinBoxA graphical application for Windows, Linux and macOS; connects by IP or MAC addressEveryday configuration and the first connection
WebFigThe router’s own web interfaceYou only have a browser at hand
Terminal (CLI)A command line over SSH, Telnet or a serial console, with built-in scriptingPrecise commands, scripts, moving settings as text
MikroTik appAn app for Android and iOSYou only have a phone at hand
APIA programming interfaceYour own configuration and monitoring tools

What to know first

  • IP addresses and masks, routing, NAT and DNS as mechanisms are covered in the “TCP/IP and DNS” reference, in the sections “IPv4: addresses, masks and subnets”, “Routing, ARP and NAT” and “DNS: how a name is resolved”.
  • What a port is and how TCP differs from UDP are covered in the same reference, in the sections “Ports and sockets” and “UDP and comparison with TCP”.

Section sources

the section is written from these pages

Cheat sheet

Everyday RouterOS terminal commands, each explained in its own section. Replace the names (bridge, ether1, wireguard1) and addresses in the examples with your own.

Terminal tricks

Key or techniqueWhat it does
TabCompletes a command or name; pressing it twice shows the options
F1Help: what you can enter at this point
Ctrl+X or F4Turns Safe Mode on and off
Ctrl+CInterrupts a running command, such as ping
↑Previous commands from the history
/ and ..Go to the menu root and up one level
print detailAll parameters of the list entries
print where interface=ether1Only the entries that match the condition
/undoReverts the last configuration change

System

TaskCommand
Model, version, CPU load and memory/system/resource/print
Router name/system/identity/set name=office-gw
Check for updates/system/package/update/check-for-updates
Install the update and reboot/system/package/update/install
Upgrade RouterBOOT (then reboot)/system/routerboard/upgrade
Reboot/system/reboot
Who is connected to the router now/user/active/print

Interfaces and bridges

TaskCommand
All interfaces and their state/interface/print
Create a bridge/interface/bridge/add name=bridge1
Add a port to a bridge/interface/bridge/port/add bridge=bridge1 interface=ether2
Bridge ports and hardware offloading (flag H)/interface/bridge/port/print
Bridge VLAN table/interface/bridge/vlan/print
VLAN 10 interface on a bridge/interface/vlan/add interface=bridge1 name=vlan10 vlan-id=10
Add an interface to the LAN list/interface/list/member/add list=LAN interface=bridge1

Addresses, DHCP and DNS

TaskCommand
Address on an interface/ip/address/add address=192.168.88.1/24 interface=bridge
DHCP client on the WAN/ip/dhcp-client/add interface=ether1
What the DHCP client received/ip/dhcp-client/print detail
DHCP server using the wizard/ip/dhcp-server/setup
Leased addresses/ip/dhcp-server/lease/print
Router DNS servers/ip/dns/set servers=1.1.1.1,9.9.9.9
Resolve a name from the router:put [:resolve mikrotik.com]
Flush the DNS cache/ip/dns/cache/flush

Routes, firewall and NAT

TaskCommand
Routing table/ip/route/print
Default route/ip/route/add dst-address=0.0.0.0/0 gateway=203.0.113.1
Route to another network/ip/route/add dst-address=192.168.20.0/24 gateway=10.255.0.2
Filter rules with counters/ip/firewall/filter/print stats
NAT rules/ip/firewall/nat/print
Masquerade for the WAN/ip/firewall/nat/add chain=srcnat action=masquerade out-interface-list=WAN

VPN and diagnostics

TaskCommand
WireGuard interfaces, their ports and keys/interface/wireguard/print
Active IPsec peers/ip/ipsec/active-peers/print
Ping/ping 1.1.1.1 count=3
Path to a host/tool/traceroute 1.1.1.1 count=3
What traffic passes through an interface/tool/torch bridge
Log by topic/log/print where topics~"dhcp|interface"
New log entries as they appear/log/print follow-only

Backups and dangerous commands

TaskCommand
Text export to a file/export file=office
Export including passwords and keys/export show-sensitive file=office-full
Binary backup with a password/system/backup/save name=office password=change-me
Restore a backup (with a reboot)/system/backup/load name=office
Reset to the factory configuration/system/reset-configuration
Reset without the default configuration/system/reset-configuration no-defaults=yes

Section sources

the section is written from these pages

Access and initial setup

A new MikroTik router with the default configuration answers at 192.168.88.1 on every port except ether1, which is where you connect the internet. Log in as admin: the password is empty or printed on the device label. Set your own right away.

What is configured by default

RouterOS picks the default configuration according to the device type. The commands it applied are shown by /system/default-configuration/print.

DevicesWhat is configured
Home routers and access points: hAP, hEX, RB4011, cAP, L009 and othersether1 is the WAN with a DHCP client, firewall and NAT; the other ports and Wi-Fi are in the LAN bridge with the address 192.168.88.1/24 and a DHCP server
LTE routers: Chateau, LtAP, SXT LTEThe WAN is the LTE interface with a firewall and NAT; a LAN bridge with the address 192.168.188.1/24 and a DHCP server
Switches without Wi-Fi: CRS, FiberBoxAll ports in one bridge, with the address 192.168.88.1/24 on the bridge
CCR and other models with no configuration of their own (IP Only)Only the address 192.168.88.1/24 on ether1 (or combo1, sfp1); admin has no password

Connecting

WinBox v4 is an application for Windows, Linux and macOS that needs no installation: on Windows and Linux, unpack the archive into a separate folder with no other files (otherwise self-update will not work); on macOS, open the DMG. The “Neighbors” tab shows the routers on the local network.

Connect by IP address. Use the MAC address only when the IP is unavailable or shown as 0.0.0.0: such a connection uses broadcast frames and is not always reliable. Other ways in are WebFig in a browser, SSH, and the terminal built into WinBox.

First steps

  1. Create your own administrator, check that you can log in with it, then disable admin. Use a password of at least 12 characters with mixed-case letters, digits and symbols: a forgotten password cannot be recovered, only the router reset.
  2. Give the router a name of up to 64 characters: it appears in the terminal prompt, in the WinBox connection title and to neighbours on the network. A name made of Latin letters, digits and hyphens works everywhere.
  3. Check that the default firewall is in place, and do not disable its rules.
  4. Do not expose management to the internet: for remote access, set up a VPN, either WireGuard or IPsec.
  5. Update RouterOS; the procedure is in the section “Versions and what’s new”.
routeros
/user/add name=alisher group=full password="change-me"/user/disable admin/system/identity/set name=office-gw/ip/firewall/filter/print

You can also change your password interactively: /password asks for the old and new passwords. Detailed hardening rules are in the section “Router security”.

Safe Mode

Safe Mode protects you when you edit over the network: if the session drops, the router undoes all changes made in this mode, including those made from other sessions. Turn it on before editing the firewall, addresses and bridges: Ctrl+X or F4 in the terminal, the “Safe Mode” button in WinBox.

textexample output
[admin@office-gw] /ip/route> [Ctrl+X][Safe Mode taken][admin@office-gw] /ip/route<SAFE>
  • Changes are rolled back when the router considers the connection lost: after the TCP timeout, which takes 9 minutes.
  • Leaving with Ctrl+D also discards the changes, while /quit does not. To keep your changes and leave the mode, press Ctrl+X again.
  • If there are more changes than fit in the history (the last 100 actions), the mode turns off without a rollback. Change the configuration in small steps.

Without the default configuration

On a CCR the default configuration is just an address on ether1 (see the table above); /system/reset-configuration no-defaults=yes removes even that address. Removing the default configuration also removes all the built-in protection rules. Connect with WinBox by MAC address and set up the basics by hand: the bridge and ports, the LAN address, the DHCP server, the firewall and NAT, following the sections “Interfaces, bridges and VLANs”, “IP addresses, DHCP and DNS”, “Firewall: chains and filter rules” and “NAT: masquerade and port forwarding”.

Section sources

the section is written from these pages

Interfaces, bridges and VLANs

A bridge joins ports into a single network segment, like a switch. VLANs split that segment into isolated networks: you enable vlan-filtering=yes on the bridge and describe in the VLAN table which VLANs pass through which port.

Bridge and ports

Assign the IP address to the bridge itself, not to its ports. To keep the bridge’s MAC address from changing when ports change, set it manually with auto-mac=no and admin-mac.

routeros
/interface/bridge/add name=bridge1/interface/bridge/port/add bridge=bridge1 interface=ether2/interface/bridge/port/add bridge=bridge1 interface=ether3/interface/bridge/port/print

The H flag on a port in the print output means hardware offloading: a switch chip forwards packets between such ports at wire speed, and RouterOS sees only their counters. Offloading is on by default (hw=yes), but some bridge features turn it off, for example split horizon (horizon). Only one bridge per switch chip can be hardware-offloaded, except on CRS1xx and CRS2xx switches.

Interface lists

An interface list is a named group of interfaces. The firewall, bridge, neighbour discovery and Detect Internet all refer to lists: add an interface to a list and every setting that mentions that list applies to it. The built-in lists are all, none, dynamic and static.

routeros
/interface/list/add name=WAN/interface/list/add name=LAN/interface/list/member/add list=WAN interface=ether1/interface/list/member/add list=LAN interface=bridge1

What a VLAN is

A VLAN (Virtual LAN) is a way to keep several isolated networks on one physical link. The IEEE 802.1Q standard inserts a 4-byte tag into the Ethernet frame header, carrying a VLAN number from 1 to 4094. Hosts in different VLANs cannot see each other even on the same switch: traffic between VLANs goes only through a router.

  • A trunk port carries frames of several VLANs with tags (tagged): this is how switches are connected to each other and to the router.
  • An access port delivers frames of one VLAN without a tag (untagged): ordinary devices such as computers and printers connect to it.
  • The standard reserves the numbers 0, 1 and 4095 for special cases: use other numbers for your own networks.

VLANs on a bridge: trunk and access ports

An example for a router without the default configuration: ether2 is a trunk to a managed switch carrying VLANs 10 and 20, and ether3 and ether4 are access ports for VLAN 10 and VLAN 20. The vlan10 and vlan20 interfaces on top of the bridge give the router an address in each VLAN, and it routes traffic between them.

Traffic between VLAN 10 and VLAN 20 passes through the router and its firewall.

The order matters: first the bridge with vlan-filtering=no, the ports, the VLAN table and the addresses, and enable filtering with the last command.

routeros
/interface/bridgeadd name=bridge1 vlan-filtering=no/interface/bridge/portadd bridge=bridge1 interface=ether2 \    frame-types=admit-only-vlan-taggedadd bridge=bridge1 interface=ether3 pvid=10 \    frame-types=admit-only-untagged-and-priority-taggedadd bridge=bridge1 interface=ether4 pvid=20 \    frame-types=admit-only-untagged-and-priority-tagged/interface/bridge/vlanadd bridge=bridge1 tagged=bridge1,ether2 vlan-ids=10add bridge=bridge1 tagged=bridge1,ether2 vlan-ids=20/interface/vlanadd interface=bridge1 name=vlan10 vlan-id=10add interface=bridge1 name=vlan20 vlan-id=20/ip/addressadd address=192.168.10.1/24 interface=vlan10add address=192.168.20.1/24 interface=vlan20/interface/bridgeset bridge1 vlan-filtering=yes
  • pvid is the VLAN that untagged frames arriving on the port are placed in. An access port adds itself to the table as untagged for its own pvid, and pvid takes effect only with vlan-filtering=yes.
  • frame-types drops frames of the wrong kind: untagged frames on a trunk, tagged frames on an access port. The ingress check this needs (ingress-filtering) has been on by default since RouterOS 7.
  • tagged=bridge1 lets the VLAN reach the router itself; without it the vlan10 and vlan20 interfaces get no traffic. Since RouterOS 7.16 this entry is also added automatically when you create a VLAN interface on the bridge (comment added by vlan on bridge).

Pitfalls

  • Do not list several VLANs in one entry with access ports: untagged=ether3,ether4 vlan-ids=10,20 sends both VLANs untagged to both ports.
  • The bridge itself is also a port, with its own pvid=1. If the trunk also has pvid=1, the router can be reached with untagged frames through the trunk. /interface/bridge/set bridge1 frame-types=admit-only-vlan-tagged closes this.
  • Hardware offloading together with vlan-filtering works only on some switch chips: Marvell Prestera, RTL8367, 88E6393X, 88E6191X, 88E6190, MT7621, MT7531 and EN7523. On other devices the CPU does the VLAN filtering, and speed drops.

Section sources

the section is written from these pages

IP addresses, DHCP and DNS

In RouterOS, you assign an IP address to an interface or bridge with /ip/address/add. The address from your ISP usually comes from a DHCP client, a DHCP server hands out addresses to LAN clients, and the router’s DNS cache resolves names for them.

Address on an interface

routeros
/ip/address/add address=192.168.88.1/24 interface=bridge/ip/address/print

You can have several addresses on one interface, one per add. RouterOS works out the network address (network) from the mask. If you assign an address to a port that belongs to a bridge, it actually ends up on the bridge, as the actual-interface field shows. The D flag in the print output marks dynamic addresses, such as those obtained by a DHCP client.

DHCP client on the WAN

routeros
/ip/dhcp-client/add interface=ether1/ip/dhcp-client/print detail

Once the client gets a lease, it adds a dynamic address to the interface, a default route through the gateway it was given (add-default-route=yes), and your ISP’s DNS servers to the router’s resolver (use-peer-dns=yes). The working state is status=bound. When the lease is lost, the address and route are removed.

DHCP server for the LAN

A server needs the router’s address on the interface, an IP pool (/ip/pool), a network with settings for clients (/ip/dhcp-server/network), and the server itself, which ties the interface to the pool. The /ip/dhcp-server/setup wizard creates all of this at once and suggests values based on the interface address. To do it manually:

routeros
/ip/pool/add name=lan-pool ranges=192.168.88.10-192.168.88.254/ip/dhcp-server/network/add address=192.168.88.0/24 \    gateway=192.168.88.1 dns-server=192.168.88.1/ip/dhcp-server/add name=lan-dhcp interface=bridge \    address-pool=lan-pool
  • Do not include the router’s address in the pool.
  • An interface runs one server for the clients in that segment. A server does not work on a bridge with no ports.
  • If the network has no dns-server, clients get the DNS servers the router itself uses.

A permanent address for a device

A static lease pins an address to a device such as a printer, server or camera. The easiest way is to make an existing lease static: run make-static with its number from print. Or create a lease directly by MAC address:

routeros
/ip/dhcp-server/lease/print/ip/dhcp-server/lease/make-static 0/ip/dhcp-server/lease/add server=lan-dhcp \    mac-address=6C:3B:6B:7C:41:3E address=192.168.88.20

With add-dns-entries=yes, the server also adds each client’s name to the router’s DNS with the lan suffix, for example laptop.lan: /ip/dhcp-server/set lan-dhcp add-dns-entries=yes.

The router’s DNS cache

The router is a caching DNS resolver: it queries upstream servers itself and stores the answers. To let it answer LAN clients, you need allow-remote-requests=yes. The router queries its own servers before dynamic ones, such as those obtained by a DHCP client. The default configuration already sets all this up.

routeros
/ip/dns/set servers=1.1.1.1,9.9.9.9 allow-remote-requests=yes/ip/dns/static/add name=nas.lan address=192.168.88.20:put [:resolve mikrotik.com]/ip/dns/cache/flush
routeros
/ip/firewall/filter/add chain=input action=drop \    in-interface-list=WAN protocol=udp dst-port=53/ip/firewall/filter/add chain=input action=drop \    in-interface-list=WAN protocol=tcp dst-port=53

IPv6 from your ISP

For IPv6, the ISP usually delegates a prefix over DHCPv6 (prefix delegation). The DHCPv6 client puts the received prefix into a pool, the LAN address is taken from that pool, and advertise=yes announces the prefix to the network so devices configure their own addresses. DHCPv6 does not provide a default gateway; add-default-route=yes adds a route to the DHCPv6 server, so it is best to set it explicitly.

routeros
/ipv6/dhcp-client/add interface=ether1 request=prefix \    pool-name=isp-v6 pool-prefix-length=64 add-default-route=yes/ipv6/address/add address=::1/64 from-pool=isp-v6 \    interface=bridge advertise=yes

With IPv6, LAN devices have public addresses, so they need rules in /ipv6/firewall/filter. See the section “Firewall: chains and filter rules”.

Section sources

the section is written from these pages

Routes and failover

A route in RouterOS is an /ip/route entry with a destination network (dst-address) and a gateway (gateway). For each packet, the most specific route is chosen, and among routes to the same network, the active one with the lowest distance wins. This is what failover is built on.

Default route

routeros
/ip/route/add dst-address=0.0.0.0/0 gateway=203.0.113.1/ip/route/print

RouterOS adds connected networks itself, one route for each address on an enabled interface. A default route from a DHCP client is dynamic too. Flags in print: A – active, s – static, c – connected network, d – from DHCP, D – dynamic, I – inactive, + – ECMP, several equal-cost gateways.

Route sourceDefault distance
Connected network0
Static route1
DHCP client1 (default-route-distance)
OSPF110

The selection works like this: first the most specific route, the one with the longest mask. Among routes to the same network, the active one has the lower distance and a reachable gateway. If two DHCP clients added routes with equal distance, both are active and traffic is shared between them (ECMP).

Failover: check-gateway

A backup link is a second default route with a higher distance. For the router to notice that the primary gateway is gone, enable check-gateway=ping on the primary route: the router pings the gateway every 10 seconds and, after two missed replies in a row (the timeout is 1 second), stops using the route until the gateway replies again.

routeros
/ip/route/add dst-address=0.0.0.0/0 gateway=203.0.113.1 \    distance=1 check-gateway=ping/ip/route/add dst-address=0.0.0.0/0 gateway=198.51.100.1 \    distance=2

If both links get their address over DHCP, set the same options on the DHCP clients:

routeros
/ip/dhcp-client/set [find interface=ether1] \    default-route-distance=1 check-gateway=ping/ip/dhcp-client/add interface=ether2 default-route-distance=2

Netwatch: checking a host beyond the gateway

Netwatch regularly probes a host (ping, TCP, HTTP or DNS) and runs down-script when the host goes down and up-script when it comes back. For failover, instead of check-gateway, ping a public address and disable the primary route while it doesn’t answer:

routeros
/ip/route/add dst-address=9.9.9.9/32 gateway=203.0.113.1/ip/route/add dst-address=0.0.0.0/0 gateway=203.0.113.1 \    distance=1 comment=isp1/tool/netwatch/add host=9.9.9.9 \    down-script="/ip/route/disable [find comment=isp1]" \    up-script="/ip/route/enable [find comment=isp1]"

The /32 route to 9.9.9.9 makes the probe always go through the primary link. Without it, after a switchover the probe would go through the backup link, the host would answer, and the primary route would be enabled again.

Policy routing: a separate table

Policy routing sends part of the traffic through its own routing table. First create the table in /routing/table, then direct traffic into it with a /routing/rule rule, by source address, destination address or incoming interface, or with a mark in firewall mangle: a rule with action=mark-routing sets the new-routing-mark mark.

routeros
/routing/table/add name=via-isp2 fib/ip/route/add dst-address=0.0.0.0/0 gateway=198.51.100.1 \    routing-table=via-isp2/routing/rule/add src-address=192.168.88.50/32 \    action=lookup table=via-isp2
  • action=lookup: if the table has no matching route, the lookup continues in main. lookup-only-in-table: it doesn’t continue, so when the table’s gateway goes down, the traffic goes nowhere.
  • If you use both mangle and rules, the mangle mark takes precedence by default.
  • For a custom table, the route to the destination must also exist in main, at least the default route.

In large networks, routes are distributed by the OSPF and BGP protocols. Their routes go into the same route database and are selected by the same rules. OSPF has a default distance of 110, so a static route to the same network takes precedence.

Section sources

the section is written from these pages

Firewall: chains and filter rules

The RouterOS firewall checks packets against /ip/firewall/filter rules in three chains: input for packets to the router itself, forward for packets through the router, and output for packets from the router. Rules are processed from top to bottom until the first match, and a packet that matches none is accepted.

This gives two rules for writing a rule set. The last rule in input (and in forward too, for a strict set) must drop everything else, otherwise anything not explicitly forbidden gets through. An accept rule placed after it never fires, and a new rule goes to the end by default, so place it higher with the place-before parameter.

Connection states

The firewall evaluates a packet together with its connection (connection tracking). A good rule set accepts packets of already permitted connections straight away and performs detailed checks only for new ones, which is faster and simpler.

StateMeaning
newThe packet starts a new connection, or a connection that has no reply yet
establishedThe packet belongs to an existing connection
relatedRelated to an existing connection, for example an ICMP error or FTP data
invalidDoesn’t belong to any connection; drop such packets in input and forward
untrackedExcluded from tracking by a RAW rule
How the default firewall works: the first matching rule decides the packet’s fate.

A baseline rule set

This is the core of the default firewall (where the rules carry defconf: comments), written for a router without the default configuration. It relies on interface lists: ether1 is in WAN, and the bridge bridge is in LAN. Add these rules in Safe Mode (see the section “Access and initial setup”): a mistake in input cuts off your access to the router.

routeros
/ip/firewall/filteradd chain=input action=accept \    connection-state=established,related,untrackedadd chain=input action=drop connection-state=invalidadd chain=input action=accept protocol=icmpadd chain=input action=drop in-interface-list=!LAN \    comment="drop all not coming from LAN"add chain=forward action=fasttrack-connection \    connection-state=established,relatedadd chain=forward action=accept \    connection-state=established,related,untrackedadd chain=forward action=drop connection-state=invalidadd chain=forward action=drop connection-state=new \    connection-nat-state=!dstnat in-interface-list=WAN \    comment="drop all from WAN not DSTNATed"
  • input: the router accepts replies to its own connections, ICMP and everything from the LAN, and nothing else from the WAN, including WinBox and SSH.
  • fasttrack-connection moves established connections to the fast path, and from then on the firewall checks only new connections.
  • forward: from the WAN, only replies to connections from the LAN and forwarded ports (dstnat) get through. Nothing blocks traffic from the LAN, so it is accepted.

Actions

ActionWhat it does
acceptAccepts the packet; it goes no further down the chain
dropSilently drops the packet
rejectDrops the packet and replies with an ICMP error or TCP RST (reject-with)
jump and returnJump to a custom chain (jump-target) and return from it
logWrites the packet to the log and passes it to the next rule
add-src-to-address-listAdds the source address to a list (address-list), optionally for a limited time (address-list-timeout), and passes the packet on
fasttrack-connectionMoves the connection to the fast path

Interface lists and address lists in rules

Rules with in-interface-list and src-address-list don’t need rewriting when ports and addresses change: you change the contents of the list, not the rule. A ! before the name means “not in the list”. An address list is a named set of addresses, subnets and ranges; you can also add a DNS name to it, and the router then tracks its address itself.

To allow SSH (port 22) and WinBox (port 8291) from the office address, place the rule above the one that drops everything not from the LAN:

routeros
/ip/firewall/address-list/add list=trusted address=198.51.100.7/ip/firewall/filter/add chain=input action=accept \    protocol=tcp dst-port=22,8291 src-address-list=trusted \    place-before=[find comment~"drop all not coming from LAN"]

Rule logging

log=yes writes every packet that matches the rule to the log, and log-prefix adds a label to the start of the entry to make it easy to search for. Enable it only briefly: during an attack, logging loads the CPU.

routeros
/ip/firewall/filter/set [find comment~"not coming from LAN"] \    log=yes log-prefix=drop-wan/log/print where message~"drop-wan"

IPv6

IPv6 has its own rules, in /ipv6/firewall/filter. Here you need to protect the clients too: with IPv6, LAN devices have public addresses, and without rules in forward they are reachable from the internet.

Section sources

the section is written from these pages

NAT: masquerade and port forwarding

NAT in RouterOS is the /ip/firewall/nat rules in the srcnat and dstnat chains: srcnat changes the source address and lets the LAN out to the internet, while dstnat changes the destination address and exposes a LAN server to the outside. A rule fires on the first packet of a connection, and connection tracking translates the rest in the same way.

ActionChainWhat it does
masqueradesrcnatSubstitutes the address of the outgoing interface; for a WAN with a changing address
src-natsrcnatSubstitutes to-addresses; for a fixed public address
dst-natdstnatChanges the destination address and port to to-addresses and to-ports
redirectdstnatRedirects the packet to the router itself, on port to-ports

RouterOS 7 has two more NAT chains for the router’s own traffic, input and output. This section doesn’t need them: it covers transit traffic between the LAN and the internet.

The router translates replies in both connections back by itself, using the connection tracking entry.

Internet access for the LAN

For a WAN with a changing address, such as DHCP or PPPoE, use masquerade: it takes the current address of the outgoing interface and, when the address changes or the link drops, removes the old connections. The default configuration already has such a rule.

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

With a fixed address, src-nat is better: its connections survive a brief link outage.

routeros
/ip/firewall/nat/add chain=srcnat action=src-nat \    src-address=192.168.88.0/24 out-interface-list=WAN \    to-addresses=203.0.113.10

Port forwarding

Port forwarding is a dstnat rule: packets to port 8080 of the external address go to port 80 of the server 192.168.88.10.

routeros
/ip/firewall/nat/add chain=dstnat action=dst-nat \    in-interface-list=WAN protocol=tcp dst-port=8080 \    to-addresses=192.168.88.10 to-ports=80

The default firewall allows such connections: in forward, it drops only new connections from the WAN that haven’t gone through dstnat. If your forward ends with a drop rule, allow forwarded connections above it. Here, drop all else is the comment on your last rule:

routeros
/ip/firewall/filter/add chain=forward action=accept \    connection-nat-state=dstnat in-interface-list=WAN \    place-before=[find comment="drop all else"]

To keep the port from being open to the whole internet, add a source condition to the dstnat rule: src-address= or src-address-list=trusted.

Hairpin NAT: reaching your own server by its external address

A computer on the same LAN as the server can’t reach the server by its external address. A rule with in-interface-list=WAN doesn’t catch its packet, and if you redirect that packet too, the server replies directly, bypassing the router, and the client drops the reply. You need a dstnat rule matching the external address instead of the incoming interface, and a masquerade rule for packets from the LAN to the server:

routeros
/ip/firewall/nat/add chain=dstnat action=dst-nat \    dst-address=203.0.113.10 protocol=tcp dst-port=8080 \    to-addresses=192.168.88.10 to-ports=80/ip/firewall/nat/add chain=srcnat action=masquerade \    src-address=192.168.88.0/24 dst-address=192.168.88.10 \    protocol=tcp dst-port=80 out-interface=bridge

If the external address changes, use dst-address-type=local instead of dst-address: it matches any address of the router itself, including its LAN address.

Why NAT doesn’t replace a firewall

Masquerade hides LAN addresses but doesn’t block incoming traffic. A packet sent directly to an address in your LAN, for example from the ISP’s network, passes through the router without any NAT. Only the forward rule “drop all from WAN not DSTNATed” in the default firewall stops it.

Section sources

the section is written from these pages

VPN: WireGuard and IPsec

WireGuard in RouterOS is a tunnel interface: each side has its own key pair, and a peer entry says whose public key it is and what traffic goes through that peer (allowed-address). Use IPsec with IKEv2 when the other side does not support WireGuard.

Two offices: site-to-site

Office A has LAN 192.168.10.0/24 and external address 203.0.113.10. Office B has 192.168.20.0/24 and 198.51.100.20. The tunnel addresses are 10.255.0.1 and 10.255.0.2, and the port is UDP 13231. First create the interface on both routers (the keys are generated automatically), then exchange public keys. A router never gives up its private key.

routeroson both routers
/interface/wireguard/add name=wireguard1 listen-port=13231:put [/interface/wireguard/get [find name=wireguard1] public-key]

Next, add the peer, the tunnel address, a route to the other office’s network, and a rule allowing the WireGuard port in input. In allowed-address, list the networks this peer sends into the tunnel and the networks the router sends through it: the other office’s LAN and its tunnel address. Replace PUBLIC-KEY-OF-B with the key shown by router B.

routeroson the office A router
/interface/wireguard/peers/add interface=wireguard1 \    public-key="PUBLIC-KEY-OF-B" \    endpoint-address=198.51.100.20 endpoint-port=13231 \    allowed-address=192.168.20.0/24,10.255.0.2/32/ip/address/add address=10.255.0.1/30 interface=wireguard1/ip/route/add dst-address=192.168.20.0/24 gateway=wireguard1/ip/firewall/filter/add chain=input action=accept \    protocol=udp dst-port=13231 src-address=198.51.100.20 \    place-before=([find chain=input]->0)
routeroson the office B router
/interface/wireguard/peers/add interface=wireguard1 \    public-key="PUBLIC-KEY-OF-A" \    endpoint-address=203.0.113.10 endpoint-port=13231 \    allowed-address=192.168.10.0/24,10.255.0.1/32/ip/address/add address=10.255.0.2/30 interface=wireguard1/ip/route/add dst-address=192.168.10.0/24 gateway=wireguard1/ip/firewall/filter/add chain=input action=accept \    protocol=udp dst-port=13231 src-address=203.0.113.10 \    place-before=([find chain=input]->0)

place-before=([find chain=input]->0) puts the rule first in input, before any drop. If your forward chain is strict, also allow traffic between 192.168.10.0/24 and 192.168.20.0/24 there.

Remote employee

On the router, the interface gets an address in the tunnel network, and each device gets its own peer with a single /32 address in allowed-address. The peer does not need endpoint-address: the phone or laptop connects by itself.

routeros
/ip/address/add address=192.168.100.1/24 interface=wireguard1/interface/wireguard/peers/add interface=wireguard1 \    public-key="PUBLIC-KEY-OF-LAPTOP" \    allowed-address=192.168.100.2/32/ip/firewall/filter/add chain=input action=accept \    protocol=udp dst-port=13231 place-before=([find chain=input]->0)/interface/list/member/add interface=wireguard1 list=LAN

Adding wireguard1 to the LAN list gives employees the same permissions as the LAN, including access to the router’s DNS and WinBox. If you want fewer permissions, write separate rules for the tunnel.

In the WireGuard app on the device, create a tunnel: the app generates the key pair itself, so leave the PrivateKey line as it is and add the public key to the peer on the router. AllowedIPs = 0.0.0.0/0 sends all of the device’s traffic into the tunnel, while listed networks send only the traffic for the office.

iniWireGuard app
[Interface]Address = 192.168.100.2/24DNS = 192.168.100.1 [Peer]PublicKey = PUBLIC-KEY-OF-ROUTERAllowedIPs = 192.168.88.0/24, 192.168.100.0/24Endpoint = vpn.example.com:13231

The router can also generate a ready-made client configuration, as text or a QR code, from the peer’s client-* fields: /interface/wireguard/peers/show-client-config.

IPsec: what matters

Use IPsec when the other end is third-party equipment or the built-in VPN client of Windows, macOS, iOS or Android. For new setups, choose IKEv2 (exchange-mode=ike2) with certificate authentication: pre-shared key (PSK) authentication is open to offline attacks.

  • The parameters of both phases (algorithms, DH group, lifetime) must match on both sides, or the log shows no suitable proposal found.
  • Open UDP 500 and 4500 in input: if the firewall blocks them, negotiation ends with phase1 negotiation failed due to time up.
  • Exempt tunnel traffic from NAT with a srcnat rule with action=accept above masquerade; otherwise masquerade rewrites the source address and the packet no longer matches the IPsec policy.
  • Exempt it from FastTrack too: such packets bypass the IPsec policy check, so not everything gets through the tunnel.
  • Synchronise the time (NTP) on both sides: tunnels drop when the clocks drift apart.
routeros
/ip/firewall/nat/add chain=srcnat action=accept \    src-address=192.168.10.0/24 dst-address=192.168.20.0/24 \    place-before=0/ip/ipsec/active-peers/print

Which protocol to choose

ProtocolWhen to choose it
WireGuardBoth sides run RouterOS 7, or there is a WireGuard client. The main choice: simpler and faster than IPsec
IPsec, IKEv2Third-party equipment and the built-in VPN clients of operating systems
L2TP/IPsecOlder clients that support only this protocol. RouterOS creates an IPsec peer with a pre-shared key for it, so use IKEv2 wherever you can
SSTPWhen only HTTPS is open to the outside: a tunnel over TLS on TCP 443 passes through most firewalls and proxies. Needs a server certificate
OpenVPNClients already work with OpenVPN. The RouterOS implementation does not support everything: no LZO compression or cipher negotiation (NCP), and the cipher is set in the .ovpn file
PPTPDo not use: the protocol has known encryption vulnerabilities. For compatibility and testing only

Section sources

the section is written from these pages

Backups and export

RouterOS has two kinds of copies. A binary backup (/system/backup/save) restores the same device in full, while a text export (/export) is a set of terminal commands that you can read, compare and move to another router. Make both: they complement each other.

What we compare.backup backup.rsc export
FormatBinary fileText: terminal commands
Where to restoreTo the same device and the same RouterOS versionTo any router; preferably the same RouterOS version
User passwords and SSH keysInside the fileNever included
CertificatesInside the fileNot included; move them separately
Service passwords and keysInside the fileOnly with show-sensitive
Restore/system/backup/load with a reboot/import, or run-after-reset on a reset

Save

routeros
/system/backup/save name=office-2026-11-01 password=change-me/export file=office-2026-11-01/file/print

A backup contains the device’s secrets, so encrypt it with a password and store it somewhere safe. By default, /export writes only changed settings, without default values, and hides secrets. show-sensitive produces a full copy with secrets, and a separate menu can be exported with its own export command:

routeros
/export show-sensitive file=office-full/ip/firewall/export file=firewall

Restore

routeros
/system/backup/load name=office-2026-11-01 password=change-me

The router asks for confirmation and reboots. A backup also contains the device’s MAC addresses, so restore it only on the same router and use an export to migrate.

An export is run with /import. First reset the default configuration on the new router, or the commands will collide with existing entries. Check the file without applying changes (dry-run):

routeros
/import file-name=office.rsc verbose=yes dry-run

Then run it right after a reset:

routeros
/system/reset-configuration no-defaults=yes \    run-after-reset=office.rsc
  • Before migrating, remove interface renames from the file and check that the new router has the same number of physical interfaces.
  • If the file takes longer than 2 minutes to run, run-after-reset is aborted with the error runtime limit exceeded.
  • Set user passwords, SSH keys and certificates again on the new router.

Reset and Netinstall

/system/reset-configuration restores the factory configuration with the admin user and the factory password, and saves a backup of the current one before the reset. keep-users=yes keeps the users, no-defaults=yes does not load the default configuration, and skip-backup=yes skips the backup.

Without access to the router: unplug the power, hold the reset button, plug the power in again and release the button when the LED (usually USR) starts flashing. The configuration is reset. If you keep holding through the whole sequence (flashing, solid, off), the router starts looking for a Netinstall server on the network. Netinstall reinstalls RouterOS when the router does not boot; it does not touch the licence or the RouterBOOT settings.

Regular copies

A nightly backup and export are a script plus a scheduler task (/system/scheduler). The files are overwritten every night, so collect them from the router regularly: a copy that dies with the router is no help.

routeros
/system/script/add name=nightly-backup source={    /system/backup/save name=nightly password=change-me    /export file=nightly}/system/scheduler/add name=nightly-backup start-time=03:00:00 \    interval=1d on-event=nightly-backup

A script can send a copy by email with /tool/e-mail/send and the file= parameter, provided an email server is configured in /tool/e-mail.

Section sources

the section is written from these pages

Router security

Router management services exposed to the internet are constantly scanned and brute-forced, and older RouterOS versions contain vulnerabilities that have since been fixed. The defence: up-to-date RouterOS, personal user accounts, management closed off from the WAN, and unneeded services disabled.

User accounts

  • Keep RouterOS updated: older releases retain vulnerabilities that have been fixed. The update procedure is in the “Versions and what’s new” section.
  • Create an account for each administrator instead of a shared admin, and disable admin.
  • Assign groups with only the permissions needed: even the built-in read group can reboot the router and sees secrets (the reboot and sensitive policies).
  • Restrict logins by address: address= on a user allows login only from the listed networks.
  • /user/settings sets the minimum password length and the number of required character categories. A secure password has at least 12 characters, with digits, symbols and letters of both cases. Inside quotes, escape ", \ and $: an unescaped $ starts a variable name, the router replaces the $ and the name after it with the variable’s value (usually empty), and the password silently becomes shorter.
routeros
/user/group/add name=noc policy=ssh,winbox,read/user/add name=alisher group=full address=192.168.88.0/24 password="change-me"/user/add name=noc1 group=noc password="change-me"/user/disable admin/user/active/print

/user/active/print shows who is connected to the router right now and through which service.

Logging in with SSH keys

Import the administrator’s public key: for a user with an SSH key, the SSH server no longer accepts a password. strong-crypto=yes removes weak ciphers and SHA-1 key exchange from the SSH server, and password-authentication=no forbids password login for everyone. The default is yes-if-no-key, which allows a password only for users without a key.

routeros
/user/ssh-keys/import public-key-file=alisher.pub user=alisher/ip/ssh/set strong-crypto=yes/ip/ssh/set password-authentication=no

Management services

ServicePortWhat to do
telnet23Disable
ftp21Disable
www80Disable, unless you need WebFig over HTTP
www-ssl443WebFig over HTTPS; needs a certificate
ssh22Keep, log in with keys
winbox8291Keep for the LAN and VPN
api, api-ssl8728, 8729Disable if you do not use them
routeros
/ip/service/disable telnet,ftp,www,api/ip/service/set winbox,ssh \    available-from=192.168.88.0/24,10.8.0.0/24/ip/service/print where dynamic

available-from is an extra lock, not a replacement for the firewall: a client from another address can still open a TCP connection, and a scanner will see the port as open. That is why it is used to restrict access from trusted networks, while the firewall closes the port to the internet. Include the address you are working from right now in the list, or your next login will fail. print where dynamic shows which other ports the router is listening on.

Management from the internet

By default, the firewall blocks management from the WAN side, so do not delete those rules. For remote work, set up a VPN such as WireGuard and manage the router through the tunnel. If you still need to open SSH or WinBox to the internet, allow only those, only from known addresses, and above the rule that drops everything not from the LAN:

routeros
/ip/firewall/filter/add chain=input action=accept \    in-interface-list=WAN protocol=tcp dst-port=22 \    src-address=198.51.100.7 comment="allow SSH from office" \    place-before=[find comment="defconf: drop all not coming from LAN"]

Open SSH is protected against brute force with address lists: each new connection from an address moves it to the next stage (connection1 for 5 minutes, connection2 for 15, connection3 for an hour), and the fourth sends the address to a blacklist for a day. The rules count connections, not failed logins, so first let your own addresses through with a separate rule, or you will lock yourself out. Failed logins show in the log: login failure for user <name> from <address> via ssh.

MAC access, neighbours and unneeded services

MAC Telnet, MAC WinBox and MAC ping work at the Ethernet level, and the IP firewall does not stop them. On a production network, turn them off (or specify the LAN list instead of none), along with neighbour discovery, the bandwidth test server, the proxy, SOCKS and UPnP.

routeros
/tool/mac-server/set allowed-interface-list=none/tool/mac-server/mac-winbox/set allowed-interface-list=none/tool/mac-server/ping/set enabled=no/ip/neighbor/discovery-settings/set discover-interface-list=none/tool/bandwidth-server/set enabled=no/ip/proxy/set enabled=no/ip/socks/set enabled=no/ip/upnp/set enabled=no
routeros
/ip/dns/set allow-remote-requests=no

Device mode (device-mode)

Devices running RouterOS 7.17 or later ship with a device mode (device-mode) set at the factory: home on home routers, advanced on CCR and the 1100 series, basic on the rest, and rose on ROSE storage devices. On versions older than 7.17, every device is in advanced mode. In home, for example, the scheduler, sniffer, fetch, e-mail, proxy and speed test are unavailable, and commands answer failure: not allowed by device-mode. A mode change is confirmed by pressing a button on the device or cutting the power, so it cannot be changed remotely.

routeros
/system/device-mode/print/system/device-mode/update scheduler=yes

flagged: yes in the output means that at boot RouterOS found signs of unauthorised changes in the configuration, disabled the suspicious entries and will not let you re-enable them until the state is cleared. Treat the router as compromised: review the whole configuration, change the passwords and update RouterOS, then clear the state with /system/device-mode/update flagged=no, which also needs confirmation by button or power cut.

Section sources

the section is written from these pages

Common errors and troubleshooting

Troubleshoot along the packet’s path: WAN link, address, route, DNS, NAT, firewall. Ping shows whether a packet arrives, traceroute shows where it is lost, Torch and the sniffer show what passes through an interface, and the log (/log/print) shows what the router recorded in the meantime.

Order of checks

  1. Interfaces: /interface/print. The WAN port should have the R (running) flag. Without it there is no link: “No internet” starts with the cable or link down.
  2. Address and DHCP client: /ip/address/print shows whether there is a dynamic address on the WAN. If your provider assigns the address by DHCP, check the client status with /ip/dhcp-client/print (status=bound).
  3. Default route: /ip/route/print should show an active (A) 0.0.0.0/0 route.
  4. Connectivity from the router itself: /ping 1.1.1.1 count=3, then /ping mikrotik.com count=3. If the address answers but the name does not, the problem is DNS.
  5. Path: /tool/traceroute 1.1.1.1 count=3 shows after which router packets stop coming back.
  6. LAN clients: if the router reaches the internet but the computers do not, check masquerade and forward; Torch on the bridge shows whether the client’s traffic leaves.
  7. Firewall: /ip/firewall/filter/print stats shows from the counters which rule drops packets.
  8. Log: /log/print where topics~"interface|dhcp" shows whether the WAN had link down and whether the DHCP client got an address.

Ping and traceroute from a specific address and interface

By default, ping and traceroute use the address of the outgoing interface. When you need to test from another address, for example a LAN address behind an IPsec policy, set src-address; interface= sends the requests out through the chosen interface.

routeros
/ping 192.168.2.10 src-address=192.168.88.1 count=3/tool/traceroute 198.51.100.10 src-address=192.168.88.1 count=3

Detailed log for a single feature

By default, the log keeps the last 1000 entries in memory, without debug messages. To investigate one feature, write its debug output to a separate buffer so that it does not push out everything else. The debug output of some features contains secrets, such as SSH session keys, so do not send it to syslog or by email.

routeros
/system/logging/action/add name=dhcpdebug target=memory \    memory-lines=2000/system/logging/add topics=dhcp,debug action=dhcpdebug/log/print where buffer=dhcpdebug

failure: resolve failed

Cause: the router could not resolve the name using its DNS settings. If ping to an IP address works, connectivity is fine and only DNS is broken.

routeros
/ping 1.1.1.1 count=3/ping mikrotik.com count=3

Fix: check /ip/dns/print for servers and for dynamic-servers received from the DHCP client; if neither is there, set the servers manually (see the “IP addresses, DHCP and DNS” section).

timeout

Cause: no reply arrived within interval, which is 1 second by default. The host is off, does not answer ping, or a firewall on the path drops the request or the reply; many computers with a firewall enabled never answer ping. To check a host on your own network, use an ARP ping: any working device answers ARP. You need an interface with the router’s address on that network; without one, ping answers interface needs to be specified for arp ping.

routeros
/ping 192.168.88.20 arp-ping=yes interface=bridge count=2

TTL exceeded

Cause: a routing loop, where two routers keep sending the packet to each other until the TTL runs out. The HOST column shows the router where it ran out, and in traceroute the loop appears as two alternating addresses. Check the routes to that network on both routers: one of them sends it the wrong way.

routeros
/tool/traceroute 198.51.100.10 count=1 max-hops=8

fragmentation needed and DF set

Cause: a link with a smaller MTU on the path, such as PPPoE or a tunnel. Symptom: ping works, but websites load only partially and downloads hang.

routeros
/ping 198.51.100.10 size=1500 do-not-fragment count=2/ping 198.51.100.10 size=1400 do-not-fragment count=2

Fix: reduce size until replies arrive. The largest size that gets a reply is the path MTU; on PPPoE, start at 1492. To let TCP connections through such a link, clamp the TCP MSS with a mangle rule.

host unreachable from 203.0.113.1

Cause: a router on the path (here 203.0.113.1) cannot deliver the packet to the host, or its firewall rejects the packet with reject-with=icmp-host-unreachable. network unreachable means it has no route to the network, and packet filtered means the firewall rejects the packet as forbidden. If the address in the output is your own router, check its routes and reject rules; if it is someone else’s, the problem is with the provider or the server owner.

routeros
/tool/traceroute 198.51.100.10 count=1

login failure for user admin from 192.168.88.17 via ssh

Cause: a failed login; a series of such entries from one address is password guessing. The entries have the topics system,error,critical and are printed on open terminals. Close the service from the WAN and restrict the sources (see the “Router security” section).

routeros
/log/print where message~"login failure"

Port forwarding does not work

Causes: the dstnat rule does not match (for example, it specifies ether1 while the WAN is pppoe-out1), a strict forward chain with no allow rule, testing from your own LAN via the external address without hairpin NAT, or the server replying through a different gateway.

routeros
/tool/torch ether1 port=8080/tool/sniffer/quick interface=bridge port=80 duration=10s

Torch sees packets before the firewall and shows whether requests reach the router’s WAN. The sniffer on the LAN shows whether the request went on to the server and whether the reply came back: no packets to the server means dstnat or forward is at fault, and no reply means the server or its gateway.

The WireGuard tunnel does not come up

Causes: the public keys are swapped, allowed-address does not include the addresses the other side sends, or the WireGuard UDP port is closed in input or on an intermediate router.

routeros
/tool/sniffer/quick interface=ether1 port=13231 duration=20s/log/print where topics~"wireguard"

If no packets arrive on port 13231, either the network before the router does not let them through or the other side is sending them to the wrong place. If packets arrive but the tunnel does not work, compare the keys and allowed-address on both sides.

Minor problems

SymptomCauseWhat to do
The log is empty after a rebootEntries are kept in memoryWrite the log to disk (action=disk) or to a syslog server
Torch and the sniffer do not see traffic between bridge portsThe switch chip forwards it, bypassing the CPULook at traffic from hosts to the router and to other networks: it goes through the CPU
Torch on the WAN shows the router’s address instead of the computer’sThe address has already been replaced after srcnatLook at the LAN interface
expected end of command in Torchport accepts a single port or anyRun Torch separately for each port
CPU load rises while Torch or the sniffer is runningFast path and FastTrack are disabled for that timeLimit the time: duration=10s
The log has no entries for packets dropped by a ruleThe rule does not logEnable log=yes on the rule and entries appear with the firewall topic (see the “Firewall: chains and filter rules” section)

Section sources

the section is written from these pages

Versions and what’s new

This reference covers RouterOS 7.25 (stable channel). The latest release is 7.25.1, from 2 November 2026. Stable releases come out every few months; long-term releases are rare and contain only critical fixes.

ChannelLatest releasePurpose
stable7.25.1, 2 November 2026Main channel: tested new features and fixes
long-term7.24.6, 30 October 2026Critical fixes only; a long-released, well-tested stable branch moves here
testing7.25.1 (same as stable)Releases every few weeks after basic testing; not for production
development7.26beta5Raw changes for trying out new features
v66.49.23The previous major version; to move to v7, go through the intermediate 7.12.1

The parts of a version number are separate integers, not a decimal fraction: 7.9 is older than 7.25. Choose the release channel in /system/package/update.

What changed in 7.25

  • Interfaces, bridges and VLANs: bridges gained dynamic ARP inspection and IP source guard; RouterOS warns about entries in the VLAN table when vlan-filtering is off, and about a VLAN interface created on a bridge port.
  • VPN: a WireGuard peer can be specified by name, and there are new client-mtu, comments in wg-import files and a warning when allowed-address overlaps between peers; IPsec gained XFRM interfaces.
  • Router security: the SSH server creates an Ed25519 host key by default and warns about weak RSA keys, and WinBox gained a device-mode setting.
  • Access and initial setup: the minimum supported WinBox version is 4.3.
  • IP addresses, DHCP and DNS: the DHCP server supports option 108 (ipv6-only-preferred), and resolution of names with a trailing dot is fixed.
  • Versions: the channel label is gone from the RouterOS version string, and if booting fails, the router reboots by itself.

Deprecated and removed

  • 7.25: the bridge IGMP parameter last-member-interval is renamed last-member-query-interval.
  • 7.24: in /ip/service, the address parameter is renamed available-from, and the dot1x server’s reauth-timeout is renamed reauth-period; the old names are still accepted.
  • 7.24: in /system/resource, the factory-software field is renamed minimum-version.
  • 7.23: the bridge setting add-dhcp-option82 is replaced by dhcp-agent-circuit-id and dhcp-agent-remote-id; the configuration is converted automatically on upgrade.
  • RouterOS 7: the LCD and KVM packages are removed.

Security updates

IdentifierWhat is affectedFixed in
CVE-2026-98432System: improved stability7.25.1, long-term 7.24.6
CVE-2026-31431, CVE-2026-67280System: improved stability7.25
CVE-2026-103903System: improved stability7.24.5, long-term 7.23.8
CVE-2026-84411System: improved stabilitylong-term 7.23.8, 6.49.23
CVE-2026-67278Cryptography: improved stability7.24.3, long-term 7.23.6
CVE-2026-16347Users: delay after a failed login7.24.3, long-term 7.23.6
No numberImportant security update; details not published; most configurations are not at risk7.24.2, long-term 7.23.4, 6.49.21
No numberService vulnerability; home routers with the default configuration are not affected7.23.2, long-term 7.21.5, 6.49.20

Moving from v6

Upgrade from v6 to v7 the same way as within v6, but not in one step: first to the latest v6 release (stable or long-term), then to the intermediate 7.12.1 in the upgrade channel, and only then to the current v7. The configuration is converted automatically; BGP, OSPF, MPLS and route filters need attention, as they work differently in v7. v7 needs at least 64 MB of memory.

How to upgrade

  1. Save a backup and an export, and download them from the router (see “Backups and export”).
  2. Choose a channel and check for updates. The router contacts the MikroTik server itself (over HTTPS since 7.23), so it needs DNS and internet access.
  3. Install the update: the router downloads the packages and reboots.
  4. Upgrade the RouterBOOT bootloader and reboot once more.
routerossteps 2 and 3
/system/package/update/set channel=stable/system/package/update/check-for-updates/system/package/update/install
routerosstep 4, after the reboot
/system/routerboard/upgrade/system/reboot

If the update does not show up, check :put [:resolve upgrade.mikrotik.com] and access to it on port 443. To install .npk packages manually, pick the ones for the device’s architecture (shown in “System → Resource” and by /system/resource/print), upload them to “Files” and reboot the router.

Section sources

the section is written from these pages

End of the reference

What changed

revision history · 4 entries

Every edit is saved as a revision: a snapshot of the reference, the reason and a summary of changes. The published version changes only after the same checks as at creation.

  1. Manual edit

    reason: manual edit
  2. Manual edit

    reason: manual edit
  3. Manual edit

    reason: manual edit
  4. Reference updated

Weekly check

How the reference is checked

Once a week — and right after news of a release or a vulnerability — the reference is checked in three steps.

  1. 1. Freshness

    Sections are compared with the release notes and changelogs from the official sources and with the topic’s news.

  2. 2. Errors

    Every section is read again: wrong facts, outdated APIs and flags, broken examples.

  3. 3. Links — by an HTTP request

    Every source link must respond. A broken link is a reason to recheck the section.

No findings — only the date changes. Findings — only the affected sections are rewritten, and they appear in “What changed”. A new version replaces the published one only after passing the same checks as at creation.

Statuses

Verified
no findings
Updated
sections rewritten, edits are listed
Rechecking
while the check runs, the previous version stays open
Needs review
disputed points: the verified version is shown, editors review

Last check

18 Nov · Check · updated · no findings

Found an error in the reference?

On the topic

tracks, news and other references
The whole “MikroTik” topic
12 sections
Another reference · DevOps & cloud

Ansible

Verified 6 Nov
All references · 61