I have 2 backup internet to support WAN if it goes down

I have 2 Backup Internet to support WAN if it goes down

1 = wan - MAIN internet connection
2 = wanb - BACKUP internet connection
3 = usbmodem - BACKUP internet connection

I have a configuration for a failover using MWAN3

Which is working, if WAN is offline WANB supplies the connection, if WANB goes offline, USBMODEM supplies the connection.

Here is the problem.
When i connect openvpn client, it only works on WAN

Once the WAN is offline, it switches to WANB or USBMODEM, but the openvpn client stop working except i manually disable the WAN interface.

What i want to achieve is for the openvpn client to work both on all backup network. not only when the WAN is active.

I think i am doing something wrongly. please I need the help of the openwrt forum members.

Thank you

Restart OpenVPN client on fail over ?

You can restart openvpn either with making a hotplug script which is triggered by WAN going up/down, see:

Or use an OpenVPN watchdog script which restarts OpenVPN if it is no longer working, there are several but my personal choice :wink: see:

Yes, i have restarted the openvpn client it is not working except i stop the WAN interface. i think it PBR is forcing the WAN to stay as active even when it is offline. Once i stop the WAN pbr sees WANB as a default service gateway.

Using PBR is valuable information which you left out unil now :frowning:

In the PBR config you have to set the uplink interface to work properly.

I dont want to set up a manual default inteface

In my case i am using wan which i dont need to set it on uplink interface

if i set uplink interface what will happen to usbmodem and wanb

Can you place give an example