1 2 3 4 5 | # Here is a script you can paste into the console to do some of the above: /system reset-configuration # /system reset-configuration no-defaults=yes /user set admin password=Xxxveryxxxlong123xxxPASSWORDxxx /system package update install |
A MikroTik has no time/date keeping battery, so it needs to update time+date on each boot. A MikroTik by default updates it's time use a MikroTik cloud, check Winbox: IP ⇢ Cloud: Update time is enabled. If you wish to setup a NTP/SNTP client to update from your own network, disable the cloud time.
If you need the router to be able to route/connect to internal networks, give the router an IP on each network, and it will create a dynamic route in the routing table and be able to connect. Add ex. address "10.0.1.1/24", no network, and put the IP on the interface that is cabled to the network. If you have several ports cabled on the network, then bridge the ports and add the address on the bridge.
Since most RouterOS devices can perform either as layer 2 or layer 3, you need to choose your setup of switch chip and CPU. For devices including a switch chip, you will usually connect all ports to one master port, to gain full wire speed switching. Check your devices setup of master ports with:
1 2 | # Show which master-port each port is using: /interface ethernet print |
If there is a switch chip and you want to use it, set all ports as having the primary port as master port, the ports are now called slaves.
If you want to use the CPU, bridge the ports you want to have Layer 2 access together.
1 2 | # Show which bridge ports are bridged to: /interface bridge port print |
Rename the interfaces, so they represent your chosen setup and where they are connected to. Example: ether1-slave-crs-17 (ether1 is a slave port, and is cabled to your CRS switch on the CRS switch port 17).
If you are unsure what is included in your device, you can check the cpu with /system resource print and check if a switch chip is present with /interface ethernet switch print.
See RouterOS 6.41 master-port to bridge changes.
There is no technical difference as to what private network you use internally, but if you happen to use the exact same /24 network as your technicians use at home or elsewhere, it might become a nuisance for VPNs. Therefor a common way is:
10.0.x.x: Your company networks
192.168.0.x-192.168.10.x: Your own home or your users private home networks
192.168.11-192.168.255.x: Other business networks
172.16.0.0-172.31.255.255: VPN connections and SAN networks
The above is just a common usage, you may choose freely from these networks that are reserved for private networks:
10.0.0.0-10.255.255.255 (10.0.0.0/8)
192.168.0.0-192.168.255.255 (192.168.0.0/16)
172.16.0.0-172.31.255.255 (172.16.0.0/12)
I have local network access from same local subnet, but no internet access?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Script to secure RouterOS # remove the hashtags below this line after you've set your values # set your time zone below # /system clock # set time-zone-autodetect=no time-zone-name=Country/City /ip firewall filter # ensure this is at the top of the rule list add action=accept chain=input comment="allow admin access to router from authorized clients" dst-port=22222,8888,8291 in-interface-list=!WAN protocol=tcp /ip service set telnet disabled=yes set ftp disabled=yes set api disabled=yes set api-ssl disabled=yes set ssh port=22222 set www port=8888 # change the below to your admin network # set winbox address=192.168.88.0/24 # set your preferred admin username below # /user set 0 name=myuser /ip cloud set update-time=no # Disable discovery on WAN port /ip neighbor discovery-settings set numbers=0 discover=no # Force SSH encryption, prefer 256 bit keys and sha256 hashing /ip ssh set strong-crypto=yes # Disable bandwidth-server, as it listens on the WAN interface /tool bandwidth-server set enabled=no # Disable MAC server listening on all interfaces, enable only first bridge /tool mac-server set [ find default=yes ] disabled=yes add interface=bridge1 # Disable MAC server listening on all interfaces, enable only first bridge /tool mac-server mac-winbox set [ find default=yes ] disabled=yes add interface=bridge1 |
More info at https://wiki.mikrotik.com/wiki/Manual:Securing_Your_Router
Want to see how secure your router is? Check your routers IP on https://www.shodan.io/host/x.x.x.x
1 2 3 4 5 | # Check certificate is enabled for user /user ssh-keys print # 0 R admin 2048 user@host # Disallow password login /ip ssh set always-allow-password-login=no |
RouterOS ssh server supports port forwarding. So if you want to manage a remote device via web interface you can open ssh service for WAN, but close http/https. Then connect to ssh with port forwarding to port 80/443 enabled and use web interface through the tunnel.