alistairphillips.com

I’m : a web and mobile developer based in the Manning Valley, Australia.


Mikrotik RouterOS notes

Continually updated list of anything useful I find in RouterOS.

Export

From the CLI issue /export file=backup.txt to generate a human-readable file containing everything you'd need to restore your device. One great benefit of doing this is you're able to see how to perform the relevant GUI config over CLI.

Redirect DNS requests for a particulator host to another DNS server

Here we're redirecting requests for *.netflix.com from DNS server 192.168.1.1 to 8.8.8.8

/ip firewall layer7-protocol add name=netflix.com regexp=netflix.com
/ip firewall mangle add chain=prerouting dst-address=192.168.1.1 layer7-protocol=netflix.com action=mark-connection new-connection-mark=netflix.com-forward protocol=tcp dst-port=53
/ip firewall mangle add chain=prerouting dst-address=192.168.1.1 layer7-protocol=netflix.com action=mark-connection new-connection-mark=netflix.com-forward protocol=udp dst-port=53
/ip firewall nat add action=dst-nat chain=dstnat connection-mark=netflix.com-forward to-addresses=8.8.8.8
/ip firewall nat add action=masquerade chain=srcnat connection-mark=netflix.com-forward

IPv6