If so , just go to IP FIREWALL and select NAT.
Then if you dont have destination port showing on the columns, add it using the far right selector (typically shows ALL as default choice).
If you click on dst nat header in the column it will change to sequential order etc… quite easy to read…
/ip fire nat
:if ( [get [find where comment="pihole_bypass"] disabled] = yes) do={
:put "pihole_bypass disabled"
} else={
:put "pihole_bypass enabled"
}
# *** or ***
/ip fire nat
:if ( [:len [find where comment="pihole_bypass" and disabled=yes] ] > 0) do={
:put "all or a least one pihole_bypass disabled"
} else={
:put "all pihole_bypass enabled or none exist"
}
/ip fire nat
:if ( [get [find where comment="pihole_bypass"] disabled] = yes) do={
:local noerror true
:put "pihole_bypass is disabled, check if working"
:do { :resolve google.com server=192.168.188.25
} on-error={
:put "unresolvable, pihole still disabled"
:set $noerror false
}
:if ($noerror) do={
:put "but now is working, enable pihole_bypass"
set [find where comment="pihole_bypass"] disabled=no
}
} else={
:put "pihole_bypass is enabled, check if working"
:do { :resolve google.com server=192.168.188.25
} on-error={
:put "but now do not work and I disable pihole_bypass"
set [find where comment="pihole_bypass"] disabled=yes
}
}
Kinda, but still not working. The script should enable some NAT rule when pihole is down, and disable it when it is up again. ref:http://forum.mikrotik.com/t/mikrotik-pihole-unbound/148772/18 For some weird reason scheduler doing nothing. But, the script was nice though, thank you
Update: Solved my issue