MikroTik RouterOS CLI Commands Cheat Sheet
MikroTik CLI Cheatsheet
General Commands
| Command | Description |
|---|---|
/system identity set name=Router1 |
Set router name |
/system reboot |
Reboot device |
/system shutdown |
Shutdown device |
/system resource print |
View system resources |
/system clock set time=12:00:00 |
Set time |
IP / Interfaces
| Command | Description |
|---|---|
/ip address add address=192.168.88.1/24 interface=ether1 |
Add IP to interface |
/ip address print |
Show all IP addresses |
/ip route add gateway=192.168.88.254 |
Add default route |
/interface print |
Show interfaces |
/interface enable ether1 |
Enable interface |
Routing
| Command | Description |
|---|---|
/ip route add dst-address=10.0.0.0/24 gateway=192.168.88.2 |
Add static route |
/routing ospf instance print |
View OSPF instance |
/routing bgp instance print |
View BGP instance |
Firewall / NAT
| Command | Description |
|---|---|
/ip firewall filter add chain=input action=accept protocol=tcp dst-port=22 |
Allow SSH |
/ip firewall nat add chain=srcnat action=masquerade out-interface=ether1 |
NAT for internet access |
/ip firewall filter print |
View firewall rules |
Wireless
| Command | Description |
|---|---|
/interface wireless print |
View wireless interfaces |
/interface wireless set wlan1 ssid=MikroTik |
Set SSID |
/interface wireless enable wlan1 |
Enable wireless interface |