# Dual WAN Failover Script Ping Command

**URL:** <https://forum.mikrotik.com/t/dual-wan-failover-script-ping-command/150516>\
**Category:** Beginner Basics\
**Created:** [July 18, 2021, 8:43pm UTC](https://forum.mikrotik.com/t/dual-wan-failover-script-ping-command/150516 "2021-07-18T20:43:50Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kbch](https://forum.mikrotik.com/letter_avatar/kbch/32/6_449c533f586939b6e5f246632a46421f.png) [@kbch](https://forum.mikrotik.com/u/kbch)\
**Post date:** [July 18, 2021, 8:43pm UTC](https://forum.mikrotik.com/t/dual-wan-failover-script-ping-command/150516/1 "2021-07-18T20:43:50Z")

</div>

Hello

I have a setup with Dual WAN. I would like to replicate the current EdgeRouter based setup. The current EdgeRouter Setup pings one IP on the Internet from both Interfaces. It automatically creates two internal Routing Tables with one or the other Interfaces Gateway as Default Gateway. It then uses these two internal Routing Tables to run Pings for one or the other WAN Interface.

My way to solve this now would be to write a Mikrotik Script which on every run does housekeeping on two internal Routing Tables. Housekeeping in terms of creating these internal Routing Tables according to the Default Gateway of both WAN Interfaces. After doing this I can ping the IP on the Internet with internal Routing Table 0 and afterwards with the internal Routing Table 1.

With the results of this I then can run my logic to select the desired WAN and modify the main routing Table.

Is this how this should be done or is there a way easier approach? Both my WAN Interfaces have dynamic IP addresses. I also want to ping the same target from both WAN Interfaces.

---

_[View the full topic](https://forum.mikrotik.com/t/dual-wan-failover-script-ping-command/150516)._
