Howto mikrotik: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
update router firmware:
update router firmware:
  /system routerboard upgrade
  /system routerboard upgrade
search for file on routeros:
/file print where name~".npk"
change ssh port:
/ip service set ssh port=5000
monitor interface ether1 using torch:
/tool torch ip-protocol=any port=any src-address=0.0.0.0/0 interface=ether1
= timeclock =
= timeclock =
set timezone:
set timezone:
Line 26: Line 20:
update clock with ntp:
update clock with ntp:
  /system ntp client set enabled=yes primary-ntp=0.0.0.0 secondary-ntp=0.0.0.0 server-dns-names=us.pool.ntp.org
  /system ntp client set enabled=yes primary-ntp=0.0.0.0 secondary-ntp=0.0.0.0 server-dns-names=us.pool.ntp.org
= other commands =
search for file on routeros:
/file print where name~".npk"
monitor interface ether1 using torch:
/tool torch ip-protocol=any port=any src-address=0.0.0.0/0 interface=ether1
= secure router =
change ssh port:
/ip service set ssh port=5000
= wireguard =
= wireguard =
for wireguard support we need to switch to development channel:
for wireguard support we need to switch to development channel:

Revision as of 11:34, 5 February 2022

initial setup

update user admin password:

/user set admin password=mypassword

check routeros version:

/system resource print

mikrotik distribution channels are:

stable (former current)
long-term (former bugfix)
testing
development

change the current channel:

/system package update set channel=development

update router os:

/system package update download

update router firmware:

/system routerboard upgrade

timeclock

set timezone:

/system clock set time-zone-name=America/Puerto_Rico

update clock with ntp:

/system ntp client set enabled=yes primary-ntp=0.0.0.0 secondary-ntp=0.0.0.0 server-dns-names=us.pool.ntp.org

other commands

search for file on routeros:

/file print where name~".npk"

monitor interface ether1 using torch:

/tool torch ip-protocol=any port=any src-address=0.0.0.0/0 interface=ether1

secure router

change ssh port:

/ip service set ssh port=5000

wireguard

for wireguard support we need to switch to development channel:

/system package update set channel=development

then download the latest update:

/system package update download

reboot the router:

/system reboot

add wireguard interface:

/interface/wireguard add name=wg0 mtu=1420

add wireguard peer using server information:

/interface/wireguard/peers add endpoint=12.34.56.78:51820 persistent-keepalive=61 public-key="75VNV7HqFh+3QIT5OHZkcjWfbjx8tc6Ck62gZJT/KRA=" allowed-address="10.10.10.0/24" interface=wg0

add ip address to interface:

/ip/address add address=10.10.10.3/24 network=10.10.10.0 interface=wg0

add the following on the server configuration:

[Peer]
PublicKey=pEU+xV6YeWOKT34iECYDPRW99oLZKYodkUtjdIV8CwI=
AllowedIPs=10.10.10.3/32

restart wireguard on server:

systemctl restart wg-quick@wg0.service