openvpn client service auto restart method? (for site to site)

Started by chienchou.pan, January 15, 2021, 07:40:41 AM

Previous topic - Next topic
Hi sir,

    Our company use openvpn server with three WAN lines(different ISP provide[china telecom,china mobile,unicom]) to provide VPN service for each branch offices.
    The branch office use openvpn client service to connect to server with two WAN lines(Unicom,China telecom).
    But sometimes the network quility is not good, and the client will connect to wrong WAN line then the openvpn connection will lose packages(different ISP's connection is not always good in china).
    If the opnsense can build a funtion to detect the line survival to reconnect to better ISP in openvpn , or can provide a cron rule to restart openvpn client service automatically for user define, thanks.

For example,

     headquarter have three WAN Lines to provide openvpn service:

     1. china telecom ==> 192.168.1.1
     2. unicom telecom ==> 192.168.2.1
     3  china mobile ==> 192.168.3.1

     
     branch office have two WAN lines to connect to headquarter:

     1. china telecom ==>  192.168.1.2
     2. unicom telecom ==> 192.168.2.2

     branch office defaule setup  is use 192.168.2.2 to connect to 192.168.2.1 (the same ISP network, the quality is the best)
     but when unicom telecom network quality is abnormal, it will change to use 192.168.1.2 to connect to 192.168.2.1 (different ISP network), and the connection quality will not good.   

       





There is a setting in OpenVPN that attempts to restore connections after network interruptions. VPN, OpenVPN, Servers, Advanced and add a line with:

persist-tun

Note that you may have to add this to the config files manually in future versions of OPNsense.

Bart...

I think this setting is not helpful to sovle my issus. Because when the primary WAN disconect to change to backup line, the openvpn connection is look like good always, but it will not have good quality between different ISP(loss packages).Use the setting "persist-tun" will not restore original connection(the same ISP connection).

Is there a solution for this problem yet? I have the same issue, all I can find is are solutions that involve manually changing config files, which are overridden by a firmware update. This is not practical if you have a dozen of routers with regular firmware updates.

Best regards,

Maarten