Skip to content

Routeros

Allow remote winbox connection

/ip firewall filter add action=accept chain=input disabled=no dst-port=8291 protocol=tcp

Enabling HTTPS on MikroTik

  • Create certificates
1
2
3
4
5
/certificate
add name=root-cert common-name=MyRouter days-valid=3650 key-usage=key-cert-sign,crl-sign
sign root-cert
add name=https-cert common-name=MyRouter days-valid=3650
sign ca=root-cert https-cert
  • Enable www-ssl service and disable www service
1
2
3
/ip service
set www-ssl certificate=https-cert disabled=no
set www disabled=yes

DNS Server

  • Redirect all LAN DNS requests to the router
1
ip firewall nat add chain=dstnat action=redirect to-ports=53 protocol=udp dst-port=53 to-address=192.168.88.1 comment="DIRECT ALL DNS REQUESTS TO MIKROTIK INTERNAL DNS SERVER."
  • Forbid all Remove DNS request
1
2
3
4
ip firewall filter.

add action=drop chain=input dst-port=53 protocol=udp
add action=drop chain=input dst-port=53 protocol=tcp
  • Set static DNS record

Setting DoH

Script & scheduler

1
/system script add name=<script_name> source=[/file get <file_name> contents]
  • Scheduler: System > Scheduler
    • Use the script name in On Event section