:put ([/tool flood-ping [:resolve "www.mikrotik.com"] count=3 as-value]->"avg-rtt")
:put ([/tool flood-ping 1.1.1.1 count=3 as-value]->"avg-rtt")
:global ping2 ([/tool flood-ping 8.8.8.8 count=3 as-value]->"avg-rtt");:global ping1 ([/tool flood-ping 1.1.1.1 count=3 as-value]->"avg-rtt");:if ($ping1>$ping2) do={[/ip dns set servers=1.1.1.1]} else={[/ip dns set servers=8.8.8.8]};
/system script add name=best_DNS source=[:global ping2 ([/tool flood-ping 8.8.8.8 count=3 as-value]->"avg-rtt");:global ping1 ([/tool flood-ping 1.1.1.1 count=3 as-value]->"avg-rtt");:if ($ping1>$ping2) do={[/ip dns set servers=1.1.1.1]} else={[/ip dns set servers=8.8.8.8]};];
system scheduler add name=sch-dns interval=60s on-event=s1
system scripts run s1
one line
/system logging action set memory memory-lines=1
or one hundred lines
/system logging action set memory memory-lines=100
/ip firewall nat add chain=dstnat dst-address=a.b.c.d protocol=tcp dst-port=5900
action=dst-nat to-addresses=192.168.1.101 to-ports=5900
ip firewall nat add chain=dstnat protocol=tcp dst-port=52 action=redirect to port=22
/ip firewall filter
add action=drop chain=forward content=google.com
you can change it to any country you want
/tool fetch url=http://www.iwik.org/ipcountry/mikrotik/IR
/import file-name=IR
/ip dns static add regexp=".*\\.com\$" forward-to=192.168.1.186
after 6.31 version:
/system package update
Check-for-updates once
: delay 1s;
: If ([get status] = "New version is available") do= {install}
before 6.31 version:
System package update
Check-for-updates
: delay 1s;
: if ( [get current-version] != [get latest-version]) do={ upgrade }
save Configuration
/system backup save filename=[backup_filename.backup]
Load Configuration
/system backup load filename=[backup_filename.backup]