MikroTik Commands
MikroTik RouterOS CLI commands for router and switch configuration.
Device Startup Procedure
Step 1: Power on deviceConnect power to boot MikroTik device
Step 2: Wait for bootWait 1-3 minutes for RouterOS to load
Step 3: Verify systemCheck system status after boot
/system resource printDisplay system resources and uptime
/system routerboard printVerify hardware information
Step 4: Check interfacesVerify interface states
/interface printDisplay all interface status
Step 5: Verify configurationEnsure configuration is loaded
/system backup save name=startup-checkCreate backup after successful boot
Device Shutdown Procedure
Step 1: Save configurationEnsure configuration is saved before shutdown
/system backup save name=pre-shutdownCreate backup before shutdown
/export file=config-backupExport configuration to file
Step 2: Check active connectionsReview current sessions if needed
/ip firewall connection print count-onlyCount active connections
Step 3: Graceful shutdownShutdown or reboot the device
/system shutdownShutdown the device
/system rebootReboot the device
Step 4: Alternative - scheduled shutdownSchedule shutdown for later
/system scheduler add name=shutdown on-event="/system shutdown" start-time=<time>Schedule shutdown at specific time
System Information
/system resource printDisplay system resources and uptime
/system routerboard printDisplay RouterBOARD information
/system license printDisplay license information
/system identity printDisplay system identity/hostname
/system identity set name=<name>Set system identity/hostname
/system clock printDisplay system time
/system package printList installed packages
/system history printDisplay command history
Interface Configuration
/interface printList all interfaces
/interface print statsDisplay interface statistics
/interface ethernet printList Ethernet interfaces
/interface enable <interface>Enable interface
/interface disable <interface>Disable interface
/interface set <interface> name=<newname>Rename interface
/interface ethernet set <interface> speed=<speed>Set interface speed
/interface ethernet set <interface> auto-negotiation=yesEnable auto-negotiation
/interface monitor-traffic <interface>Monitor real-time traffic
IP Address & Routing
/ip address printDisplay IP addresses
/ip address add address=<ip/mask> interface=<interface>Add IP address to interface
/ip address remove <id>Remove IP address
/ip route printDisplay routing table
/ip route add dst-address=0.0.0.0/0 gateway=<gateway>Add default route
/ip route add dst-address=<network/mask> gateway=<gateway>Add static route
/ip route remove <id>Remove route
/ip dhcp-client printDisplay DHCP client status
/ip dhcp-client add interface=<interface> disabled=noEnable DHCP client on interface
/ip dns printDisplay DNS configuration
/ip dns set servers=<dns1>,<dns2>Set DNS servers
Bridge & VLAN
/interface bridge printList bridges
/interface bridge add name=<name>Create bridge
/interface bridge port printList bridge ports
/interface bridge port add bridge=<bridge> interface=<interface>Add interface to bridge
/interface bridge port remove <id>Remove interface from bridge
/interface vlan printList VLAN interfaces
/interface vlan add name=<name> vlan-id=<id> interface=<interface>Create VLAN interface
/interface bridge vlan printDisplay bridge VLAN configuration
/interface bridge vlan add bridge=<bridge> tagged=<ports> vlan-ids=<id>Add VLAN to bridge
Wireless Configuration
/interface wireless printList wireless interfaces
/interface wireless scan <interface>Scan for wireless networks
/interface wireless set <interface> ssid=<ssid>Set wireless SSID
/interface wireless set <interface> frequency=<freq>Set wireless frequency
/interface wireless set <interface> band=<band>Set wireless band
/interface wireless security-profiles printList wireless security profiles
/interface wireless security-profiles add name=<name> mode=dynamic-keys authentication-types=wpa2-psk wpa2-pre-shared-key=<key>Create WPA2 security profile
/interface wireless registration-table printDisplay connected wireless clients
Firewall
/ip firewall filter printDisplay firewall filter rules
/ip firewall filter add chain=<chain> action=<action> src-address=<ip>Add firewall filter rule
/ip firewall filter remove <id>Remove firewall rule
/ip firewall nat printDisplay NAT rules
/ip firewall nat add chain=srcnat out-interface=<interface> action=masqueradeAdd masquerade NAT rule
/ip firewall nat add chain=dstnat dst-port=<port> protocol=tcp action=dst-nat to-addresses=<ip> to-ports=<port>Add port forwarding rule
/ip firewall address-list printDisplay firewall address lists
/ip firewall address-list add list=<name> address=<ip>Add address to list
/ip firewall mangle printDisplay mangle rules
DHCP Server
/ip dhcp-server printDisplay DHCP servers
/ip dhcp-server setupRun DHCP server setup wizard
/ip dhcp-server add name=<name> interface=<interface> address-pool=<pool>Create DHCP server
/ip dhcp-server network printDisplay DHCP networks
/ip dhcp-server network add address=<network/mask> gateway=<gateway> dns-server=<dns>Add DHCP network
/ip dhcp-server lease printDisplay DHCP leases
/ip dhcp-server lease make-static <id>Make lease static
/ip pool printDisplay IP pools
/ip pool add name=<name> ranges=<start>-<end>Create IP pool
User & Security
/user printList user accounts
/user add name=<username> password=<password> group=<group>Add user account
/user remove <username>Remove user account
/user set <username> password=<newpassword>Change user password
/user active printDisplay active user sessions
/ip service printDisplay enabled services
/ip service set <service> disabled=yesDisable service
/ip service set <service> port=<port>Change service port
/ip ssh printDisplay SSH settings
/ip ssh set strong-crypto=yesEnable strong SSH crypto
Bandwidth Management
/queue simple printDisplay simple queues
/queue simple add name=<name> target=<ip/mask> max-limit=<up>/<down>Add simple queue with bandwidth limit
/queue simple remove <id>Remove simple queue
/queue tree printDisplay queue tree
/interface ethernet switch rule printDisplay switch rules (CRS)
Logging & Monitoring
/log printDisplay system logs
/log print followFollow system logs in real-time
/log print where topics~"<topic>"Filter logs by topic
/system logging printDisplay logging configuration
/system logging add topics=<topic> action=<action>Add logging rule
/tool torch <interface>Real-time traffic monitor
/tool bandwidth-test <address> protocol=<protocol>Run bandwidth test
/tool ping <address>Ping host
/tool traceroute <address>Traceroute to host
/tool sniffer quickQuick packet sniffer
Backup & System
/system backup save name=<filename>Create system backup
/system backup load name=<filename>Restore from backup
/export file=<filename>Export configuration to file
/export compactExport compact configuration
/import file-name=<filename>Import configuration from file
/system reset-configurationReset configuration to default
/system reset-configuration no-defaults=yes skip-backup=yesReset with no defaults (clean slate)
/system rebootReboot system
/system shutdownShutdown system
Routing Protocols
/routing ospf instance printDisplay OSPF instances
/routing ospf network add network=<network/mask> area=<area>Add OSPF network
/routing bgp instance printDisplay BGP instances
/routing bgp peer printDisplay BGP peers
/routing bgp peer add remote-address=<ip> remote-as=<asn>Add BGP peer
/routing rip instance printDisplay RIP instances
/routing route printDisplay active routes