Configure Mikrotik Failover with 2 ISPs

Konfigurasi Failover Mikrotik

In the network world, there is something called the Mikrotik Failover Configuration Technique. This technique is a technique used to provide two connection lines where if one connection line dies, the connection will continue to run by being diverted to another line.

The way this Failover works is where when there is a broken link (Main Link), the internet will be redirected using the backup link. Actually, there is more than one way to Failover the Mikrotik Router, such as using the check-gateway and distance parameters or using a script. If you want to set up the proxy in more detail, you can read the article about various settings in proxy this.

For example for Failover Mikrotik, this is the topology used:

Konfigurasi Failover Mikrotik Dengan 2 ISP

To shorten, this way is a method that has only gotten to the point. This Mikrotik failover technique also uses a Script blend.

  1. Make sure the 2 internet connections that you are going to use have happened well in Mikrotik.
  2. Go to System -> Script -> Add. Add the following 2 Mikrotik scripts:

Failover script::

if ([/ ip route get [/ ip route find comment = “main”] disabled] = yes) do = {/ ip route enable [/ ip route find comment = “main” ]} else = {/ ip route disable [/ ip route find comment = “main”]}

Konfigurasi Failover Mikrotik Dengan 2 ISP

Script to return to main path

: if ([/ ip route get [/ ip route find comment = “main”] disabled] = yes) do = {/ ip route enable [/ ip route find comment = “main”]}

Konfigurasi Failover Mikrotik Dengan 2 ISP

  • The next step in Mikrotik failover is to create a Netwatch rule. Go to Tools -> Netwatch -> Add. Create the following two rules:

Netwatch Failover:

[Tab Host]

– Host: 8.8.8.8

– Interval: 00:00:03

– Timeout: 1000 ms [Tab Down]

– On Down: failover (adjust to the script name)

Konfigurasi Failover Mikrotik Dengan 2 ISP

[Tab Up ]

– On Up: back2main (adjust to the name of the script)

Konfigurasi Failover Mikrotik Dengan 2 ISP

  • The next step is to edit the Mikrotik cable routing. The trick is to go to IP -> Routes. Make it like the following picture:

Konfigurasi Failover Mikrotik Dengan 2 ISP

  • To route for the main line:

Manually create a route for the main line with the configuration:

– Dst Address: 0.0.0.0/0

– Gateway: ether1 (select the interface connected to the main line)

– Distance: 1

– Check Gateway :ping

Interested With mikrotik failover engineering service from NetData? Immediately check our mikrotik products below :

Bandwidth Management

Mikrotik CCR

Networks

Mikrotik CSS

Leave a Reply

Your email address will not be published. Required fields are marked *

Semua operasional PT. Network Data Sistem akan menggunakan domain nds.id per tanggal 8 Mei 2019. Semua informasi/promosi dalam bentuk apapun selain menggunakan domain nds.id bukan tanggung jawab PT. Network Data Sistem Dismiss