MikroTik RouterOS

MikroTik RouterOS Cheatsheet #

MikroTik RouterOS is the operating system used in MikroTik’s networking devices. This cheatsheet covers commonly used commands and configurations for MikroTik RouterOS.

Basic Commands #

Command/OptionExampleDescription
system identity set name=<name>system identity set name=MyRouterSet the router’s hostname
system rebootsystem rebootReboot the router
system shutdownsystem shutdownShut down the router
exportexportDisplay the current configuration
import file-name=<filename>import file-name=config.rscImport configuration from a file
reset-configurationsystem reset-configurationReset the router to factory settings

Interface Configuration #

Command/OptionExampleDescription
interface printinterface printDisplay all interfaces
interface set <id> name=<name>interface set 0 name=ether1Set the name of an interface
ip address add address=<addr> interface=<iface>ip address add address=192.168.1.1/24 interface=ether1Assign IP address to an interface
interface enable <id>interface enable ether1Enable an interface
interface disable <id>interface disable ether1Disable an interface

VLAN Configuration #

Command/OptionExampleDescription
interface vlan add name=<name> vlan-id=<id> interface=<iface>interface vlan add name=vlan10 vlan-id=10 interface=ether1Create a VLAN on an interface
interface vlan printinterface vlan printDisplay VLAN configurations

Firewall Configuration #

Command/OptionExampleDescription
ip firewall filter add chain=<chain> action=<action> <parameters>ip firewall filter add chain=input action=accept protocol=tcp port=22Add a firewall rule
ip firewall filter printip firewall filter printDisplay firewall rules
ip firewall nat add chain=<chain> action=<action> <parameters>ip firewall nat add chain=srcnat action=masquerade out-interface=ether1Add a NAT rule
ip firewall nat printip firewall nat printDisplay NAT rules

VPN Configuration #

Command/OptionExampleDescription
interface ovpn-server add name=<name> <parameters>interface ovpn-server add name=ovpn-in1 user=myuser password=mypasswordAdd an OVPN server instance
interface ovpn-client add name=<name> <parameters>interface ovpn-client add name=ovpn-out1 connect-to=192.168.1.1 user=myuser password=mypasswordAdd an OVPN client instance
interface ovpn-server printinterface ovpn-server printDisplay OVPN server configurations
interface ovpn-client printinterface ovpn-client printDisplay OVPN client configurations

Routing Configuration #

Command/OptionExampleDescription
ip route add dst-address=<network> gateway=<gateway>ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1Add a static route
ip route printip route printDisplay routing table

Wireless Configuration #

Command/OptionExampleDescription
interface wireless set <id> ssid=<ssid>interface wireless set 0 ssid=MySSIDSet the SSID for a wireless interface
interface wireless set <id> mode=<mode>interface wireless set 0 mode=ap-bridgeSet the mode for a wireless interface
interface wireless printinterface wireless printDisplay wireless interface configurations

System Management #

Command/OptionExampleDescription
system clock set time=<time>system clock set time=12:00:00Set the system time
`system ntp client set enabled=<yesno> primary-ntp=`system ntp client set enabled=yes primary-ntp=pool.ntp.org
system scheduler add name=<name> interval=<interval> on-event=<script>system scheduler add name=backup interval=1d on-event="/system backup save name=backup.backup"Schedule a task
system resource printsystem resource printDisplay system resource usage

This cheatsheet provides essential MikroTik RouterOS commands for network management, interface configuration, VLANs, firewalls, VPNs, routing, and system management. For more detailed information, refer to the MikroTik documentation.

MikroTik RouterOS

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.