Mikrotik Config Cheatsheet
Published: 2022-12-08
Intro
The following is a cheatsheet with common configurations for the Mikrotik CRS326 router / switch.
Lab Environment
The following hardware is used for all examples in this post.
Administration
Console
Connect to the console port.
screen /dev/tty.usbserial-<usb id> 115200SSH
Connect via SSH.
ssh admin@<router ip>Web UI
Connect to the web UI.
http://<router ip>Software Update
Upgrade the software package.
/system package update
check-for-updates
download
# reboot required after download completes
/system rebootHostname
Set the device hostname.
/system identity
set name=<hostname>Bridge
Create a bridge.
/interface bridge
add name=bridge1 vlan-filtering=yesVLAN
Create a VLAN and assign it to a bridge.
/interface bridge vlan
add bridge=bridge1 tagged=bridge1,ether24 vlan-ids=<vlan id>Access Port
Add an interface to a bridge and configure it as an access port.
/interface bridge port
add bridge=bridge1 interface=<interface> pvid=<vlan id>Trunk Port
Add an interface to a bridge and configure it as a trunk port.
/interface bridge port
add bridge=bridge1 interface=<interface>VLAN Interface
Create a VLAN interface and assign an IP address.
/interface vlan
add interface=bridge1 name=<vlan name> vlan-id=<vlan id>
/ip address
add address=<ip address>/<prefix length> interface=<vlan name>Static Route
Add a static route.
/ip route
add dst-address=<destination network>/<prefix length> gateway=<gateway ip>DNS Client
Configure DNS client settings.
/ip dns
set servers=<dns server ip>NTP Client
Configure NTP client settings.
/system ntp client
set enabled=yes
/system ntp client servers
add address=<ntp server ip>LLDP Client
Enable LLDP on all interfaces.
/ip neighbor discovery-settings
set discover-interface-list=allShow LLDP neighbors.
/ip neighbor printHTTP Server
Configure HTTP server settings.
/ip service
set www disabled=no port=80
set www-ssl disabled=no port=443Disable Services
Disable unused services.
/ip service
set telnet disabled=yes
set ftp disabled=yes
set api disabled=yes
set api-ssl disabled=yesService Status
Show the status of all services.
/ip service printOutro
In this cheatsheet, I covered some common configurations for the Mikrotik CRS326 router / switch.
Links
https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge
https://wiki.mikrotik.com/wiki/Manual:Initial_Configuration#Summary
https://help.mikrotik.com/docs/display/ROS/Command+Line+Interface
https://www.timigate.com/2022/11/mikrotik-trunk-and-access-port-configuration.html
https://wiki.mikrotik.com/wiki/Manual:Upgrading_RouterOS
https://forum.mikrotik.com/viewtopic.php?p=839603
https://stubarea51.net/2019/02/06/cisco-to-mikrotik-switching-and-vlans/
https://www.ispsupplies.com/blog/creating-trunk-and-access-ports-on-mikrotik-crs3xx-series-switches
https://www.timigate.com/2022/11/mikrotik-trunk-and-access-port-configuration.html
https://wiki.mikrotik.com/wiki/Manual:Simple_Static_Routing
https://help.mikrotik.com/docs/display/ROS/Bridging+and+Switching
https://forum.mikrotik.com/viewtopic.php?t=143620
https://it4allsite.wordpress.com/2019/03/21/trunk-and-access-ports-on-mikrotik-switch-with-routeros/
https://help.mikrotik.com/docs/display/ROS/Serial+Console
https://help.mikrotik.com/docs/display/ROS/Spanning+Tree+Protocol