### Netinstall Version 6 Example Source: https://manual.mikrotik.com/docs/Getting%20Started/netinstall Example of running Netinstall version 6, which resets the configuration upon reinstallation. This command initiates the installation process for a MIPSBE architecture device. ```bash admin@ubuntu:~$ sudo ./netinstall -r -a 192.168.88.3 routeros-mipsbe-6.48.1.npk Using server IP: 192.168.88.2 Starting PXE server Waiting for RouterBOARD... PXE client: 01:23:45:67:89:10 Sending image: mips Discovered RouterBOARD... Formatting... Sending package routeros-mipsbe-6.48.1.npk ... Ready for reboot... Sent reboot command ``` -------------------------------- ### HotSpot Setup Wizard Source: https://manual.mikrotik.com/docs/Authentication%2C%20Authorization%2C%20Accounting/HotSpot%20-%20Captive%20portal Use the setup command to configure a new HotSpot instance on a specified interface. This wizard guides through interface selection, IP addressing, DHCP pool, SSL certificate, SMTP server, DNS configuration, and local user creation. ```bash [admin@MikroTik] /ip/hotspot> setup Select interface to run HotSpot on hotspot interface: ether3 Set HotSpot address for interface local address of network: 10.5.50.1/24 masquerade network: yes Set pool for HotSpot addresses address pool of network: 10.5.50.2-10.5.50.254 Select hotspot SSL certificate select certificate: none Select SMTP server ip address of smtp server: 0.0.0.0 Setup DNS configuration dns servers: 10.1.101.1 DNS name of local hotspot server dns name: myhotspot Create local hotspot user name of local hotspot user: admin password for the user: [admin@MikroTik] /ip/hotspot> ``` -------------------------------- ### Basic Multi-WAN Setup with Routing Marks in ROSv7 Source: https://manual.mikrotik.com/docs/User%20Guides/Routing%20and%20Networking%20Protocols/moving-from-rosv6-to-rosv7 This example illustrates a basic multi-WAN configuration using routing tables and mangle rules. It sets up IP addresses, routes, and a firewall mangle rule to mark traffic for a specific routing table ('myTable'), directing it through a designated gateway. ```bash /routing/table/add name=myTable fib /ip/address add address=192.168.1.1/24 interface=LAN add address=1.1.1.2/24 interface=WAN1 add address=2.2.2.2/24 interface=WAN2 /ip/route add gateway=1.1.1.1@main routing-table=myTable add gateway=2.2.2.2 /ip/firewall/mangle/add in-interface=LAN action=mark-routing new-routing-mark=myTable ``` -------------------------------- ### Start HAProxy Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-haproxy This command starts the HAProxy container. ```bash /container/start [find where name=haproxy] ``` -------------------------------- ### Start PostgreSQL Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-matrix-synapse Use this command to start the PostgreSQL container, which will serve as the database for your Synapse server. ```bash /container/start [find where name=postgresql_synapse] ``` -------------------------------- ### Start Certbot Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-haproxy This command starts the Certbot container after its image has been downloaded. ```bash /container/start [find where name=certbot] ``` -------------------------------- ### Setup DHCP Server Source: https://manual.mikrotik.com/docs/Getting%20Started/first-time-configuration This interactive command-line setup automates the configuration of a DHCP server on the specified interface and network. It prompts for necessary details like network space, gateway, IP pool, DNS servers, and lease time. ```bash [admin@MikroTik] > ip dhcp-server/ setup [enter] Select interface to run DHCP server on dhcp server interface: bridge1 [enter] Select network for DHCP addresses dhcp address space: 192.168.88.0/24 [enter] Select gateway for given network gateway for dhcp network: 192.168.88.1 [enter] Select pool of ip addresses given out by DHCP server addresses to give out: 192.168.88.2-192.168.88.254 [enter] Select DNS servers dns servers: 192.168.88.1 [enter] Select lease time lease time: 1800 [enter] ``` -------------------------------- ### Start PostgreSQL Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-postgres Initiates the PostgreSQL container, making the database server ready to accept connections. The container will start automatically on system boot if configured. ```routeros /container/start [find where name=postgres] ``` -------------------------------- ### Install Binfmt Support for Extra Architectures Source: https://manual.mikrotik.com/docs/Extended%20features/Container Installs the necessary binary format support to allow Docker to build images for architectures other than the host system. Run this if `docker buildx ls` does not show the required platforms. ```bash docker run --privileged --rm tonistiigi/binfmt --install all ``` -------------------------------- ### Netwatch Log Output Example Source: https://manual.mikrotik.com/docs/Diagnostics%2C%20monitoring%20and%20troubleshooting/netwatch Example log output showing a successful Netwatch script execution for a ping to 8.8.8.8. ```text 08:03:26 script,info Ping to 8.8.8.8 successful ``` -------------------------------- ### Install Latest Firmware Source: https://manual.mikrotik.com/docs/Mobile%20Networking/lte-5g Execute this command to initiate the firmware installation process for the latest stable version. Ensure an active internet connection is available and RouterOS is up-to-date. ```routeros [admin@D53G] > /interface/lte/firmware-upgrade lte1 upgrade=yes ``` -------------------------------- ### Comment Examples Source: https://manual.mikrotik.com/docs/Developer%20Guides/Scripting Illustrates how to use comments in RouterOS scripts. Comments start with '#' and extend to the end of the line. They are ignored by the interpreter. ```routeros # this is a comment # continued comment in the next line :global a; # comment describing variable :global myStr "part of the string # is not a comment" ``` -------------------------------- ### Run Bandwidth Test with Specific Parameters Source: https://manual.mikrotik.com/docs/Diagnostics%2C%20monitoring%20and%20troubleshooting/bandwidth-test This example shows how to initiate a bandwidth test with a specified duration, packet sizes for both transmit and receive, and user credentials. It configures the test to run in both directions. ```bash [admin@MikroTik] /tool> bandwidth-test 10.0.0.32 duration=15s \ ... direction=both local-udp-tx-size=1000 protocol=udp \ ... remote-udp-tx-size=1000 user=admin status: done testing duration: 15s tx-current: 272.8Mbps tx-10-second-average: 200.3Mbps tx-total-average: 139.5Mbps rx-current: 169.6Mbps rx-10-second-average: 164.8Mbps rx-total-average: 117.0Mbps lost-packets: 373 random-data: no direction: both tx-size: 1000 rx-size: 1000 [admin@MikroTik] /tool> ``` -------------------------------- ### System Resource Information Source: https://manual.mikrotik.com/docs/Developer%20Guides/rest-api Example of how to retrieve system resource information using cURL. This demonstrates a GET request to the /system/resource endpoint. ```APIDOC ## GET /system/resource ### Description Retrieves detailed information about the system's resources, including CPU, memory, and storage. ### Method GET ### Endpoint /system/resource ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -k -u admin: https:///rest/system/resource ``` ### Response #### Success Response (200) - **architecture-name** (string) - The name of the CPU architecture. - **board-name** (string) - The name of the board. - **build-time** (string) - The build time of the RouterOS. - **cpu** (string) - The type of CPU. - **cpu-count** (string) - The number of CPU cores. - **cpu-frequency** (string) - The CPU frequency. - **cpu-load** (string) - The current CPU load. - **free-hdd-space** (string) - The amount of free hard drive space. - **free-memory** (string) - The amount of free memory. - **platform** (string) - The platform name. - **total-hdd-space** (string) - The total hard drive space. - **total-memory** (string) - The total memory. - **uptime** (string) - The system uptime. - **version** (string) - The RouterOS version. #### Response Example ```json [ { "architecture-name": "tile", "board-name": "CCR1016-12S-1S+", "build-time": "2020-12-04 14:19:51", "cpu": "tilegx", "cpu-count": "16", "cpu-frequency": "1200", "cpu-load": "1", "free-hdd-space": "83439616", "free-memory": "1503133696", "platform": "MikroTik", "total-hdd-space": "134217728", "total-memory": "2046820352", "uptime": "2d20h12m20s", "version": "7.1beta4 (development)" } ] ``` ``` -------------------------------- ### Add PPTP Client Configuration Source: https://manual.mikrotik.com/docs/Virtual%20Private%20Networks/pptp Sets up a PPTP client connection with specified credentials and server address. Ensure the user and password match the server's configuration. ```bash [admin@MikroTik] > /interface/pptp-client/add connect-to=192.168.62.2 disabled=no name=pptp-out1 password=StrongPass user=MT-User ``` ```bash [admin@MikroTik] > /interface/pptp-client/print Flags: X - disabled; R - running 0 R name="pptp-out1" max-mtu=1450 max-mru=1450 mrru=disabled connect-to=192.168.62.2 user="MT-User" password="StrongPass" profile=default-encryption keepalive-timeout=60 add-default-route=no dial-on-demand=no allow=pap,chap,mschap1,mschap2 ``` -------------------------------- ### Multi-line Command Example Source: https://manual.mikrotik.com/docs/Management%20tools/command-line-interface Illustrates how to construct and execute commands that span multiple lines, indicated by a continuation prompt. ```bash [admin@MikroTik] > { {... :put (\ {(\... 1+2)} 3 ``` -------------------------------- ### Mosquitto Server Logs Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-mosquitto-mqtt-server Example log output confirming the Mosquitto server has started successfully, loaded the configuration, and is listening on ports 8883 for both IPv4 and IPv6. ```log 11:20:41 container,info,debug 1689160841: mosquitto version 2.0.15 starting 11:20:41 container,info,debug 1689160841: Config loaded from /mosquitto/config/mosquitto.conf. 11:20:41 container,info,debug 1689160841: Opening ipv4 listen socket on port 8883. 11:20:41 container,info,debug 1689160841: Opening ipv6 listen socket on port 8883. 11:20:41 container,info,debug 1689160841: mosquitto version 2.0.15 running 11:22:24 system,info,account user admin logged in from 10.5.217.34 via local ``` -------------------------------- ### Download Netinstall Tool Source: https://manual.mikrotik.com/docs/Getting%20Started/netinstall Download the Netinstall tool for Linux. Replace [VERSION] with the actual version number. ```bash wget https://download.mikrotik.com/routeros/[VERSION]/netinstall-[VERSION].tar.gz ``` -------------------------------- ### Python3 API Client Example Source: https://manual.mikrotik.com/docs/tags/api A basic client demonstrating how to connect and interact with the RouterOS API using Python 3. Ensure you have the necessary libraries installed. ```python from routeros_api import RouterOsApi api = RouterOsApi('192.168.88.1', 'admin', 'password') api.login() # Example: Get system identity identity = api.get_resource('/system/identity').get() print(f"System Identity: {identity['name']}") # Example: Get list of connected users users = api.get_resource('/ip/hotspot/active').get() print("Connected Users:") for user in users: print(f"- {user['user']} ({user['address']})") api.logout() ``` -------------------------------- ### Start Synapse Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-matrix-synapse Execute this command to launch the Synapse container, initiating your Matrix server. ```bash /container/start [find where name=synapse] ``` -------------------------------- ### Retrieve S.M.A.R.T. Disk Information Source: https://manual.mikrotik.com/docs/Hardware/Disks/smart Use this command to get S.M.A.R.T. diagnostic attributes from a storage drive. Ensure the Storage package is installed. Note that some USB enclosures might not support this feature. ```bash /disk smart-info ``` -------------------------------- ### Configure Boot Key for Bootloader Access Source: https://manual.mikrotik.com/docs/Management%20tools/serial-console Guides through the process of changing the boot key option in the bootloader menu to ' key only' to prevent the router from getting stuck at the Bootloader main menu after a reboot. ```text What do you want to configure? d - boot delay k - boot key s - serial console n - silent boot o - boot device u - cpu mode f - cpu frequency r - reset booter configuration e - format nand g - upgrade firmware i - board info p - boot protocol b - booter options t - call debug code l - erase license x - exit setup your choice: k - boot key Select key which will enter setup on boot: * 1 - any key 2 - key only your choice: 2 ``` -------------------------------- ### Run Netinstall CLI Tool Source: https://manual.mikrotik.com/docs/Getting%20Started/netinstall Execute the Netinstall CLI tool with parameters and the RouterOS package. Requires root privileges. ```bash sudo ./netinstall-cli [-parameters] [address/interface] routeros-arm64-[package VERSION].npk ``` -------------------------------- ### Configure Discovery on Specific Slave Interfaces Source: https://manual.mikrotik.com/docs/System%20Information%20and%20Utilities/neighbor-discovery This example demonstrates how to restrict neighbor discovery to a specific slave interface within a bonding setup by using an interface list. Ensure the master interface is not included in the discovery list. ```bash /interface/bonding add name=bond1 slaves=ether5,ether6 /interface/list add name=only-ether5 /interface/list/member add interface=ether5 list=only-ether5 /ip/neighbor/discovery-settings set discover-interface-list=only-ether5 ``` -------------------------------- ### Create Container from Tar Image (Docker Buildx Alternative) Source: https://manual.mikrotik.com/docs/Extended%20features/Container Creates a container on RouterOS from a tar image archive that was built using Docker buildx. Note that this example omits the 'root-dir' parameter, which might be required depending on your setup. ```bash /container/add file=pihole.tar interface=veth1 mountlists=MOUNT_PIHOLE_PIHOLE,MOUNT_PIHOLE_DNSMASQD envlist=ENV_PIHOLE name=pihole ``` -------------------------------- ### Example Login Parameter Usage Source: https://manual.mikrotik.com/docs/Management%20tools/command-line-interface Illustrates how to use login parameters to disable console colors, auto-detection, and set terminal width. ```text admin+ct80w ``` -------------------------------- ### Verify Downloaded Configuration File Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-thingsboard-mqtt-http-server List files in your local directory to confirm that 'thingsboard.yml' has been successfully downloaded. ```bash c:\Users\Admin\Desktop\ThingsBoard>dir ``` -------------------------------- ### Start Pi-hole Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container Manually starts the Pi-hole container after it has been added and downloaded/extracted. ```routeros /container/start pihole ``` -------------------------------- ### Connect to MQTT Broker Source: https://manual.mikrotik.com/docs/Internet%20of%20Things/mqtt Use this command to establish a connection to a pre-configured MQTT broker. Ensure the broker is set up in the system. ```bash /iot/mqtt/connect broker="broker" ``` -------------------------------- ### List Local Files Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-thingsboard-mqtt-http-server Verify the downloaded certificate files (keystore.p12, mqttserver.p12) are present in the current local directory. ```bash C:\Users\Admin\Desktop\ThingsBoard>dir ``` -------------------------------- ### Configure RouterBOOT Setup Key Source: https://manual.mikrotik.com/docs/Extended%20features/ups Set the RouterBOOT setup key to 'Delete' to prevent accidental entry into the setup menu when the UPS unit sends data during startup. This is crucial for RouterBOARD devices. ```text Select key which will enter setup on boot: * 1 - any key 2 - key only your choice: ``` -------------------------------- ### Configure Logging Action and Topic Source: https://manual.mikrotik.com/docs/Developer%20Guides/Scripting/scripting-examples Sets up a logging action named 'pppoe' and a logging rule to capture PPPoE info messages. ```routeros /system logging action add name="pppoe" /system logging add action=pppoe topics=pppoe,info,!ppp,!debug ``` -------------------------------- ### IPv6 Prefix Examples Source: https://manual.mikrotik.com/docs/Getting%20Started/Networking%20Fundamentals/ipv6-addresses Provides examples of IPv6 prefixes written in the address/prefix-length format. ```text 2001:470:1f09:131::/64 ``` ```text 2001:db8:1234::/48 ``` ```text 2607:f580::/32 ``` ```text 2000::/3 ``` -------------------------------- ### Add MQTT Broker (Basic) Source: https://manual.mikrotik.com/docs/Internet%20of%20Things/MQTT/mqtt-and-thingsboard-configuration Configure a basic MQTT broker connection to ThingsBoard. Ensure to replace placeholders with your actual server address and credentials. ```bash /iot/mqtt/brokers/add name=tb address=x.x.x.x client-id=clientid password=password username=username ``` -------------------------------- ### Simple VRF-Lite Setup - IP Addresses Source: https://manual.mikrotik.com/docs/User%20Guides/Routing%20and%20Networking%20Protocols/virtual-routing-and-forwarding-vrf Assigns IP addresses to interfaces for a VRF-Lite setup. ```bash /ip/address add address=172.16.1.2/24 interface=public add address=192.168.1.1/24 interface=ether1 add address=192.168.2.1/24 interface=ether2 ``` -------------------------------- ### Dual-Stack Queue Entry Example Source: https://manual.mikrotik.com/docs/Network%20Management/dhcp Shows a dynamic simple queue entry created when 'allow-dual-stack-queue' is enabled, encompassing both IPv4 and IPv6 addresses for a client. ```bash [admin@MikroTik] > /queue/simple/print Flags: X - disabled, I - invalid, D - dynamic 0 D name="dhcp-ds<6C:3B:6B:7C:41:3E>" target=192.168.1.200/32,fdb4:4de7:a3f8:418c::/66 parent=none packet-marks="" priority=8/8 queue=default -small/default-small limit-at=10M/10M max-limit=10M/10M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1 ``` -------------------------------- ### Print Installed eSIM Profiles Source: https://manual.mikrotik.com/docs/Mobile%20Networking/lte-5g Lists all eSIM profiles currently installed on the eSIM card. ```routeros /interface/lte/esim/print ``` -------------------------------- ### Basic IP and Firewall Configuration Source: https://manual.mikrotik.com/docs/Virtual%20Private%20Networks/PPPoE/mlppp-over-single-and-multiple-links This snippet demonstrates essential post-PPPoE client setup, including assigning a local IP address, enabling DNS requests, and configuring basic NAT masquerade for outgoing traffic. It also includes initial firewall rules for input chain protection. ```routeros /ip/address/add address=192.168.88.1/24 interface=local /ip/dns/set allow-remote-request=yes /ip/firewall/nat add chain=src-nat action=masquerade out-interface=pppoe-out1 /ip/firewall/filter add chain=input connection-state=invalid action=drop \ comment="Drop Invalid connections" add chain=input connection-state=established action=accept \ comment="Allow Established connections" add chain=input protocol=icmp action=accept \ comment="Allow ICMP" add chain=input src-address=192.168.88.0/24 action=accept \ in-interface=!pppoe-out1 add chain=input action=drop comment="Drop everything else" ``` -------------------------------- ### Configure PostgreSQL Container Environment and Mounts Source: https://manual.mikrotik.com/docs/Extended%20features/Container Sets up environment variables and volume mounts for a PostgreSQL container, then adds the container to the system, specifying its image, network interface, and configuration lists. ```bash /container/envs/add list=ENV_POSTGRES key=POSTGRES_DB value="webapp" /container/envs/add list=ENV_POSTGRES key=POSTGRES_PASSWORD value="" /container/envs/add list=ENV_POSTGRES key=POSTGRES_USER value="webapp" /container/envs/add list=ENV_POSTGRES key=PGDATA value="/var/lib/postgresql/data/pgdata" /container/envs/add list=ENV_POSTGRES key=POSTGRES_INITDB_ARGS value="--encoding='UTF8' --lc-collate='C' --lc-ctype='C'" /container/mounts/add list=MOUNT_POSTGRES src=disk1/volumes/postgres/data dst=/var/lib/postgresql/data /container/add remote-image=postgres:15 interface=veth1 root-dir=disk1/images/postgres mountlists=MOUNT_POSTGRES envlist=ENV_POSTGRES name=postgres start-on-boot=yes logging=yes ``` -------------------------------- ### DHCP Lease Script Example Source: https://manual.mikrotik.com/docs/Developer%20Guides/Scripting An example of a DHCP lease script that logs various lease-related built-in variables. ```mikrotik /system script add name=myLeaseScript policy= ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api source=":log info $leaseActIP\r\n:log info $leaseActMAC\r\n:log info $leaseServerName\r\n:log info $leaseBound" /ip dhcp-server set myServer lease-script=myLeaseScript ``` -------------------------------- ### system/package/update/install Source: https://manual.mikrotik.com/docs/CLI%20Reference/system/system/package Installs downloaded packages for RouterOS updates. The `ignore-missing` argument allows for installing only the main RouterOS package. ```APIDOC ## system/package/update/install ### Description Installs downloaded packages for RouterOS updates. ### Method Command ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments - **ignore-missing** (bool) - Optional - Install only the RouterOS main package, omitting packages that are missing or not uploaded. ``` -------------------------------- ### Get Resource Version Source: https://manual.mikrotik.com/docs/Management%20tools/console Retrieves the RouterOS version using the 'get' command combined with ':put' to display the output. ```bash :put [/system/resource/get version] ``` -------------------------------- ### Start the pgAdmin Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-postgres Initiates the pgAdmin container, making the web application accessible via a web browser. ```bash /container/start [find where name=pgadmin] ``` -------------------------------- ### Example Log Entry Source: https://manual.mikrotik.com/docs/Diagnostics%2C%20monitoring%20and%20troubleshooting/log This is an example of a log entry showing route and BGP debug information related to a KeepaliveTimer expiration. ```log 12:41:40 route,bgp,debug,timer KeepaliveTimer expired 12:41:40 route,bgp,debug,timer RemoteAddress=2001:470:1f09:131::1 ``` -------------------------------- ### Create Virtual Client Source: https://manual.mikrotik.com/docs/Wireless/wireless-interface Use this command to create a virtual client, enabling a repeater setup with a single hardware card. The master interface must be active for the virtual client to function. ```bash /interface> wireless add mode=station master-interface=wlan1 ssid=where-to-connect security-profile=your-profile ``` -------------------------------- ### Start HAProxy Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-haproxy This command starts the HAProxy container that was previously created. It uses the 'find' command to locate the container by its name. ```routeros /container/start [find where name=haproxy] ``` -------------------------------- ### Example HAProxy Configuration Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-haproxy This is a sample HAProxy configuration file. It sets up basic HTTP mode, timeouts, and defines a frontend and backend for routing traffic to a Synapse service. ```haproxy defaults mode http timeout client 10s timeout connect 10s timeout server 10s timeout http-request 10s frontend http_synapse bind *:80 use_backend synapse backend synapse server server1 172.17.0.2:8008 maxconn 32 ``` -------------------------------- ### Generate Initial Synapse Configuration Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-matrix-synapse Run a Synapse container with the 'generate' command to create the initial configuration files. ```bash /container/add remote-image=matrixdotorg/synapse:latest interface=veth1 cmd="generate" root-dir=disk1/synapse mountlists=synapse_data envlists=synapse_envs name=synapse ``` -------------------------------- ### Start Packet Sniffer on an Interface Source: https://manual.mikrotik.com/docs/Diagnostics%2C%20monitoring%20and%20troubleshooting/packet-sniffer Use this command to start capturing packets on a specific interface. Captured packets are not saved by default. ```bash /tool/sniffer/start interface=ether1 ``` -------------------------------- ### Example Traffic Distribution Output Source: https://manual.mikrotik.com/docs/High%20Availability%20Solutions/bonding-examples This output shows an example of how traffic is distributed across the EoIP interfaces when bonding is functioning correctly. ```text /int monitor-traffic eoip-tunnel1,eoip-tunnel2 received-packets-per-second: 685 685 received-bits-per-second: 8.0Mbps 8.0Mbps sent-packets-per-second: 21 20 sent-bits-per-second: 11.9kbps 11.0kbps received-packets-per-second: 898 899 received-bits-per-second: 10.6Mbps 10.6Mbps sent-packets-per-second: 20 21 sent-bits-per-second: 11.0kbps 11.9kbps received-packets-per-second: 975 975 received-bits-per-second: 11.5Mbps 11.5Mbps sent-packets-per-second: 22 22 sent-bits-per-second: 12.4kbps 12.3kbps received-packets-per-second: 980 980 received-bits-per-second: 11.6Mbps 11.6Mbps sent-packets-per-second: 21 21 sent-bits-per-second: 11.9kbps 11.8kbps received-packets-per-second: 977 977 received-bits-per-second: 11.6Mbps 11.5Mbps sent-packets-per-second: 21 21 sent-bits-per-second: 11.9kbps 11.8kbps -- [Q quit|D dump|C-z pause] ``` -------------------------------- ### Open AP with OWE Transition Mode Setup Source: https://manual.mikrotik.com/docs/Wireless/WiFi Configures an Open AP with OWE transition mode to support both OWE-capable and older devices. This involves creating two SSIDs: one visible open SSID and one hidden OWE SSID. ```bash /interface/wifi add master-interface=wifi1 name=wifi1_owe configuration.ssid=MikroTik_OWE security.authentication-types=owe security.owe-transition-interface=wifi1 configuration.hide-ssid=yes set wifi1 configuration.country=Latvia configuration.ssid=MikroTik security.authentication-types="" security.owe-transition-interface=wifi1_owe enable wifi1,wifi1_owe ``` -------------------------------- ### Enable Start on Boot for Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container This command enables a container to start automatically after the router reboots. It requires RouterOS version 7.6beta6 or later. ```mikrotik /container/set 0 start-on-boot=yes ``` -------------------------------- ### RouterBOOT Configuration Menu Example Source: https://manual.mikrotik.com/docs/Getting%20Started/Installation%20and%20Upgrade/routerboot Displays the interactive menu available in RouterBOOT 7.4beta4, showing options for configuring boot delay, serial console, boot device, and firmware upgrades. ```text RouterBOOT booter 7.4beta4 CRS328-24P-4S+ built by build at 2022-06-15 11:34:09 from revision 73B4521C CPU frequency: 800 MHz Memory size: 512 MiB Storage size: 16 MiB Press Ctrl+E to enter etherboot mode Press any key within 2 seconds to enter setup RouterBOOT-7.4beta4 What do you want to configure? d - boot delay k - boot key s - serial console n - silent boot o - boot device z - extra kernel parameters r - reset booter configuration e - format storage w - repartition nand g - upgrade firmware i - board info p - boot protocol b - booter options j - boot os t - hardware tests l - erase license x - exit setup your choice: ``` -------------------------------- ### Netinstall CLI Command Syntax Source: https://manual.mikrotik.com/docs/Getting%20Started/netinstall The general syntax for the `netinstall-cli` command on Linux. This command requires root privileges. ```bash netinstall-cli [-r] [-e] [-b] [-m [-o]] [-f] [-c] [-v] [-k ] [-s ] [-sm ] [--mac ] {-i | -a } [PACKAGES] ``` -------------------------------- ### PoE-Out Status Example in CLI Source: https://manual.mikrotik.com/docs/Hardware/poe-out Example of how PoE-Out status, such as 'overload', is displayed in the CLI interface. This indicates a potential issue with power delivery. ```text 1 RS ;;; poe-out status: overload ether1 ether 1500 1588 9204 64:D1:54:61:D5:E0 ``` -------------------------------- ### XML User Credentials Export Example Source: https://manual.mikrotik.com/docs/Authentication%2C%20Authorization%2C%20Accounting/user-manager An example of the XML structure generated when exporting user credentials. It lists usernames and their corresponding passwords. ```xml olsgkl 86a6zH lkbwss jaKY5V cwxbwu a62yZd username secretpassword ``` -------------------------------- ### Btrfs Scrub Start Script Source: https://manual.mikrotik.com/docs/Storage/Btrfs/raid Initiates a Btrfs scrub operation on all filesystems. This script checks if a scrub is already in progress before starting a new one. ```routeros /system/script add dont-require-permissions=no name=BraidScrubStart owner=admin policy=ftp,read,write,policy,test,sniff source=":global btrfsscrubstatuscheck; \nif (\$btrfsscrubstatuscheck != \"started\") do={\ \n :set \$btrfsscrubstatuscheck (\$btrfsscrubstatuscheck \"started\");\ \n foreach i in=[/disk/btrfs/filesystem/find] do={ /disk/btrfs/filesystem/scrub-start \$i;\ \n :local temp [ /disk/btrfs/filesystem/get value-name=label \$i;]\ \n /log/info message=\"INFO: Btrfs scrub process started on \$temp\";\ \n :delay 3; \ \n } \ \n} \ \n" ``` -------------------------------- ### Initiate SFTP Connection Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-mosquitto-mqtt-server Connect to the device using SFTP with the specified username and IP address. ```bash C:\Users\Administrator\Desktop\Container>sftp admin@192.168.88.1 ``` -------------------------------- ### Start Home Assistant Container Source: https://manual.mikrotik.com/docs/Extended%20features/Container/container-homeassistant Starts the Home Assistant container. The container is identified by its index, which is typically '0' if it's the first container added. ```routeros /container/start 0 ``` -------------------------------- ### Configure Scan List with Multiple Channel Widths Source: https://manual.mikrotik.com/docs/Wireless/wireless-interface This example shows how to define multiple advanced channels with different widths (20MHz and 10MHz) for specific frequencies and bands, and then configure a wireless interface's scan list to include these defined channel lists. ```bash [admin@MikroTik] /interface/wireless> channels add frequency=5180 width=20 band=5ghz-a list=20MHz-list [admin@MikroTik] /interface/wireless> channels add frequency=5200 width=20 band=5ghz-a list=20MHz-list [admin@MikroTik] /interface/wireless> channels add frequency=5220 width=20 band=5ghz-a list=20MHz-list [admin@MikroTik] /interface/wireless> channels add frequency=5180 width=10 band=5ghz-a list=10MHz-list [admin@MikroTik] /interface/wireless> channels add frequency=5200 width=10 band=5ghz-a list=10MHz-list [admin@MikroTik] /interface/wireless> channels add frequency=5220 width=10 band=5ghz-a list=10MHz-list [admin@MikroTik] /interface/wireless> set wlan1 scan-list=20MHz-list,10MHz-list ``` -------------------------------- ### iOS WireGuard NAT Rule Example Source: https://manual.mikrotik.com/docs/Virtual%20Private%20Networks/wireguard An example of a NAT rule that might be necessary depending on the network configuration to allow WireGuard traffic. ```MikroTik RouterOS chain=dstnat action=dst-nat to-ports=port protocol=udp in-interface=interface dst-port=port ``` -------------------------------- ### system/serial-interface/start Source: https://manual.mikrotik.com/docs/CLI%20Reference/system/system/serial-interface Starts the serial interface for a given port and channel. ```APIDOC ## system/serial-interface/start ### Description Starts the serial interface for a given port and channel. ### Method Command ### Parameters #### Arguments - **port** (enum) - Description: The serial port to use. - **channel** (num) - Description: The channel on the serial port. ``` -------------------------------- ### RADIUS Debug Log Example Source: https://manual.mikrotik.com/docs/Authentication%2C%20Authorization%2C%20Accounting/dot1x Example output from RADIUS debug logs showing an Access-Accept message with Tunnel attributes received from the RADIUS server. ```text 09:51:45 radius,debug,packet received Access-Accept with id 64 from 10.1.2.3:1812 09:51:45 radius,debug,packet Tunnel-Type = 13 09:51:45 radius,debug,packet Tunnel-Medium-Type = 6 09:51:45 radius,debug,packet Tunnel-Private-Group-ID = "12" (..) 09:51:45 radius,debug,packet User-Name = "dot1x-user" ``` -------------------------------- ### Configure LEDs for Modem Access Technology Source: https://manual.mikrotik.com/docs/Hardware/leds These examples configure LEDs to indicate the modem's access technology (GSM, 3G, LTE). The number of LEDs used determines the granularity of the indication. ```bash /system/leds/add interface=lte1 leds=led1 modem-type=modem-technology ``` ```bash /system/leds add interface=lte1 leds=led1,led2 modem-type=modem-technology ``` ```bash /system/leds/add interface=lte1 leds=led1,led2,led3 modem-type=modem-technology ```