Hi all!
I’m running a routerboard with load balancing PCC and I want to change the address that router send ping to check alive. Well I want to change it to a DNS IP like 8.8.4.4.
Any idea? Thanks!
You can’t, as the pinged ip is that of the gateway.
If you want to use 8.8.4.4 to monitor this, you’ll need to resort to use Tools > Netwatch along with up and down scripts.
This is the script I use for multi wan auto failover
This is very useful as the gateway is usually your ISP’s CPE that is on premise but the ISP may be having an issue upstream.
Netwach checks the host every 10 seconds
If it goes down it will ping the host 10 times ( verify that it is really down and not just a single time out )
If it the host is really down it will change the distance on your route so another ISP will assume connections
Once the host is reachable again it will ping it 50 times to ensure that the connection is stable before changing the route back to the lower default value
The script will also send emails advising what changes are occurring.
host=8.8.8.8 timeout=1s interval=10s since=jun/20/2017 23:44:20
status=up up-script=:local i\r\n\r\n:do {:set i [/ping 8.8.8.8
interface=ether3 count=50]} while=($i != 50);\r\n\r\n:if ($i = 50)
do={\r\n:log info "ISP1 Netwatch up."\r\n/ip route set [find
comment="ISP1_Primary"] distance=170\r\n/tool e-mail send
to="email@example.com" subject=([/system identity get name]."
Netwatch ISP1up.")\r\n}
down-script=:if ([/ping 8.8.8.8 interface=ether3 count=10] =0)
do={\r\n:log info "ISP1 Netwatch down."\r\n/ip route set [find
comment="ISP1_Primary"] distance=173\r\n/tool e-mail send
to="email@example.com" subject=([/system identity get name]."
Netwatch ISP1 down.")\r\n} else={\r\n:log info "ISP1 Netwatch
OK."\r\n}
This should be possible using recursive routing without requiring a script, something like:
add gateway=8.8.4.4 scope=10 target-scope=10 check-gateway=ping
add dst-address=8.8.4.4 gateway= scope=10
hi, would you mind to share more about this?
if i got 4 WAN, and all is under ISP router.
ISP Router LAN 1 is my Mikrotik WAN1;
ISP Router LAN 2 is my Mikrotik WAN2;
ISP Router LAN 3 is my Mikrotik WAN3;
ISP Router LAN 4 is my Mikrotik WAN4.
my issue is, when my ISP Router WAN 1 is down, but my mikrotik WAN1 still up. this become my Mikrotik LAN cannot go internet due to WAN1 is down.
how to make use of that to change WAN1 to distance higher than the other 3.