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/Option | Example | Description |
---|
system identity set name=<name> | system identity set name=MyRouter | Set the router’s hostname |
system reboot | system reboot | Reboot the router |
system shutdown | system shutdown | Shut down the router |
export | export | Display the current configuration |
import file-name=<filename> | import file-name=config.rsc | Import configuration from a file |
reset-configuration | system reset-configuration | Reset the router to factory settings |
Interface Configuration
#
Command/Option | Example | Description |
---|
interface print | interface print | Display all interfaces |
interface set <id> name=<name> | interface set 0 name=ether1 | Set the name of an interface |
ip address add address=<addr> interface=<iface> | ip address add address=192.168.1.1/24 interface=ether1 | Assign IP address to an interface |
interface enable <id> | interface enable ether1 | Enable an interface |
interface disable <id> | interface disable ether1 | Disable an interface |
VLAN Configuration
#
Command/Option | Example | Description |
---|
interface vlan add name=<name> vlan-id=<id> interface=<iface> | interface vlan add name=vlan10 vlan-id=10 interface=ether1 | Create a VLAN on an interface |
interface vlan print | interface vlan print | Display VLAN configurations |
Firewall Configuration
#
Command/Option | Example | Description |
---|
ip firewall filter add chain=<chain> action=<action> <parameters> | ip firewall filter add chain=input action=accept protocol=tcp port=22 | Add a firewall rule |
ip firewall filter print | ip firewall filter print | Display firewall rules |
ip firewall nat add chain=<chain> action=<action> <parameters> | ip firewall nat add chain=srcnat action=masquerade out-interface=ether1 | Add a NAT rule |
ip firewall nat print | ip firewall nat print | Display NAT rules |
VPN Configuration
#
Command/Option | Example | Description |
---|
interface ovpn-server add name=<name> <parameters> | interface ovpn-server add name=ovpn-in1 user=myuser password=mypassword | Add 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=mypassword | Add an OVPN client instance |
interface ovpn-server print | interface ovpn-server print | Display OVPN server configurations |
interface ovpn-client print | interface ovpn-client print | Display OVPN client configurations |
Routing Configuration
#
Command/Option | Example | Description |
---|
ip route add dst-address=<network> gateway=<gateway> | ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1 | Add a static route |
ip route print | ip route print | Display routing table |
Wireless Configuration
#
Command/Option | Example | Description |
---|
interface wireless set <id> ssid=<ssid> | interface wireless set 0 ssid=MySSID | Set the SSID for a wireless interface |
interface wireless set <id> mode=<mode> | interface wireless set 0 mode=ap-bridge | Set the mode for a wireless interface |
interface wireless print | interface wireless print | Display wireless interface configurations |
System Management
#
Command/Option | Example | Description |
---|
system clock set time=<time> | system clock set time=12:00:00 | Set the system time |
`system ntp client set enabled=<yes | no> 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 print | system resource print | Display 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.