User avatar
XueHai8
Posts: 42
Joined: Mon Jul 24, 2017 12:19 pm

Multiple Gateways with Failover problem

Mon Dec 10, 2018 3:06 am

I've set up 3 OpenVPN gateway clients on my Pi set as tun0, tun1 and tun2 and they work perfectly interdependently as I am able to ping out those interfaces successfully:

Code: Select all

ping -I tun0 8.8.8.8
ping -I tun1 8.8.8.8
ping -I tun2 8.8.8.8
I am wanting to use this in a failover environment such that tun0 is preferred over tun1 and it is preferred over tun2.
Using these following blogs as guides, I've set my Pi up with the specified rules and routes:
Over Engineering FTW: https://www.whizzy.org/2012/03/over-engineering-ftw/
Setup Multiple Gateways and Multiple Internet Connections One Host: https://www.virtualizationhowto.com/201 ... -one-host/

Primarily using the "Over Enginerring FTW" blog as a guide as he is doing exactly what I'm wanting, just he's using physical Interfaces instead of tunnels.

However, while it connects initially to a tun, it does not appear to EVER fail over to any of the others if that tun fails (ie: no data is returned).

I've tried both of these route/nexthop commands, but neither seems to enable failover:

Code: Select all

ip route replace default proto static scope global nexthop dev tun0 weight 3 nexthop dev tun1 weight 2 nexthop dev tun2 weight 1

Code: Select all

ip route replace default scope global nexthop via 10.8.0.5 dev tun0 weight 3 nexthop via 10.9.0.5 dev tun1 weight 2 nexthop via 10.10.0.5 dev tun2 weight 1
Anyone tried this? Have suggestions? Pointers on where to look for the issue or a web site with more info?

P.S. I tried leaving a comment on the ""Over Enginerring FTW" blog asking for help, but its never appeared, so I guess that page is not being monitored anymore.

Thanks!

Return to “Networking and servers”