Hello to all! A pleasure to write here. I happen to have a problem with my private PPtP network setup that I need to make it work by connecting through a setup of two internet connections, using only one of them and changing if the first one goes down.
TL;DR: I want my PPtP VPN interface to connect correctly using two internet connections in a failover setup. I cannot achieve this. I am using Openwrt 19.07.4 on a TP LINK Archer C7 v5 and have tried with MWAN3 and configuring the appropriate metrics.
I have actually tried to use mwan3 for this, creating rules and routing policies but they have no effect.
I'm using an Archer C7 TP LINK router, configuring VLANs to separate Wan1, Wan2 and LAN ports. It happens that when one of them is cut off, the PPtP interface keeps trying to connect through the downed network, instead of switching to another network.
This VPN I am talking about is only used for some services, it is not a VPN to connect to the Internet. Rather it is used to connect to some IPs, which I have configured using static routes.
I am not near the router at the moment to post the settings as I have done, I will probably do it tomorrow if I have time after work to go to the location where it is installed.
I read this bug tracker: VPN Policy-Based Routing + Web UI -- Discussion
Perhaps my mind is somewhat blocked, but I don't understand what I should do or if there is a solution, or if even this applies to my case.
Thank you very much for your attention! I hope someone can give me a hand.
I get it, but thing is that when WAN1 (eth0.2) goes down, then VPN interface keeps trying to connect through WAN1 instead of going through WAN2 (eth0.3). I tryed to do that also, not so elegantly as your code but with the same results.
There should be a logical explanation why this is happening in terms of routing.
Probably you need to dynamically toggle routes based on hotplug events.