Command Line Interface

Yaser Rahmati | یاسر رحمتی

Using MikroTik’s Command Line Interface (CLI) is an efficient way to manage and configure RouterOS devices. Here’s a step-by-step guide to getting started with MikroTik CLI:

1. Accessing the CLI

Using Winbox:

  1. Open Winbox: Launch the Winbox application on your computer.

  2. Connect to Router: Enter the IP address or MAC address of the MikroTik router, along with the login credentials.

  3. Open Terminal: Click on the "New Terminal" button in Winbox to open the CLI.

Using SSH:

  1. Open an SSH Client: Use an SSH client like PuTTY.

  2. Connect to Router: Enter the IP address of the MikroTik router and connect using your credentials.

  3. Login: Enter your username and password when prompted.

Using the Console Port:

  1. Connect a Console Cable: Use a console cable to connect your computer to the router's console port.

  2. Open Terminal Emulator: Use a terminal emulator like PuTTY or Tera Term.

  3. Select the Serial Port: Configure the terminal emulator to use the correct serial port and connect.

2. Basic CLI Navigation

  • Show Commands: ? or pressing Tab to autocomplete commands.

  • Help: Type ? after a command or partial command to get help.

  • List Commands: Type the command name followed by ? to list options.

3. Basic Commands

Viewing System Information:

  • System Info:

system resource print
  • RouterOS Version:

system resource print

Configuring IP Addresses:

  • List IP Addresses:

ip address print
  • Add IP Address:

ip address add address=192.168.1.1/24 interface=ether1
  • Remove IP Address:

ip address remove [find address=192.168.1.1]

Managing Interfaces:

  • List Interfaces:

interface print
  • Enable/Disable Interface:

interface enable [find name=ether1]
interface disable [find name=ether1]

Managing Routes:

  • List Routes:

ip route print
  • Add Static Route:

ip route add dst-address=0.0.0.0/0 gateway=192.168.1.254
  • Remove Route:

ip route remove [find dst-address=0.0.0.0/0]

4. Advanced Commands

Firewall Rules:

  • List Firewall Rules:

ip firewall filter print
  • Add Firewall Rule:

ip firewall filter add chain=input action=accept protocol=tcp port=22
  • Remove Firewall Rule:

ip firewall filter remove [find chain=input]

User Management:

  • List Users:

user print
  • Add User:

user add name=newuser password=newpassword group=full
  • Remove User:

user remove [find name=newuser]

5. Saving and Rebooting

  • Save Configuration:

system configuration save
  • Reboot Router:

system reboot

6. Logging Out

  • Exit CLI Session:

exit

7. Tips and Best Practices

  • Use Scripts: For repetitive tasks, consider creating and using scripts.

  • Backup Configuration: Regularly back up your configuration to avoid data loss.

  • Keep Updated: Familiarize yourself with the latest MikroTik RouterOS updates and features.

By following these steps, you’ll be able to efficiently navigate and manage your MikroTik devices using the CLI.

Keywords

MikroTik, RouterOS, RouterBOARD, wireless networking, ISP, WISP, networking equipment, routers, switches, Cloud Core Router, CCR, SXT, LTE integration, 5G, cybersecurity, network security, networking software, networking hardware, Latvia, John Trully, Arnis Riekstiņš, MikroTik Academy, MUM events, network management, hotspot, VLAN, firewall, VPN, QoS, bandwidth management, traffic shaping, wireless access point, CAPsMAN, WinBox, PoE, mesh networking, routing protocols, MPLS, OSPF, BGP, MikroTik training

میکروتیک, روتر او اس, روتر برد, شبکه بی‌سیم, آی اس پی, وایرلس آی اس پی, تجهیزات شبکه, روترها, سوییچ‌ها, کلود کور روتر, سی سی آر, اس ایکس تی, ادغام ال تی ای, 5G, امنیت سایبری, امنیت شبکه, نرم‌افزار شبکه, سخت‌افزار شبکه, لتونی, جان ترولی, آرنیس ریکسینش, آکادمی میکروتیک, رویدادهای مام, مدیریت شبکه, هات اسپات, وی‌لَن, فایروال, وی‌پی‌ان, کیو‌اُ‌اس, مدیریت پهنای باند, شکل‌دهی ترافیک, نقطه دسترسی بی‌سیم, کپزمن, وین‌باکس, پی او ای, شبکه مش, پروتکل‌های مسیریابی, ام پی ال اس, اُ اس پی اف, بی جی پی, آموزش میکروتیک

🌐 Personal Website 📄 Resume 🎥 Video Archive 💼 Finance Blog 🔐 Network & Security Notebook 🎬 Aparat Channel

Last updated