Backup Internet with VRRP and Ubiquiti EdgeRouter

Sunday, 15 Oct 2017 Tags: CiscoUbiquitiVRRPbackupnetworkingrouter

One of the easiest ways to gain hight available Internet access with routers from two different vendors is to use VRRP.

Out of the box, VRRP is just checking if the routers can reach each other, and not for a correct working Internet connection. My shell script switches from the main to the backup router when the specified hosts are not pingable and back again to the main router when they are reachable again. In my case, the setup is a combination of one Ubiquiti EdgeRouter Lite as main router and a Cisco device as backup router.

Here is how to setup the script on your Ubiquity EdgeRouter.

Upload the script and modify

Upload the following script on your router to /config/scripts. And change the variables to match your configuration.

Activate the script

Next step is to activate the VRRP tracker script and let it run every minute

set system task-scheduler task vrrp executable path /config/scripts/
set system task-scheduler task vrrp interval 1m