VPN and connection management in general

  • ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

MatteoPV

Regular Contributor
I apologize if I open this thread but I used the search option and found nothing specific about it.

By constantly using the VPN, it can happen that in a certain geographical location, the VPN manager has several servers and sometimes some are down. Is there an addon that restarts the VPN if the internet connection fails ??? Or is there an addon that if the connection to the network fails, restarts the connection?

I give an example. If I set up my ExpressVPN on Cosenza, there are 3 possible series of IPs, at startup the system will choose the best one but if that series of IPs falls, I'm without connection
 

MatteoPV

Regular Contributor
Nothing changes with the new setting. It would take an addon that sends a ping to google for example and after a certain number of failed pigs, restart the modem. Or a monitor that if it does not detect network access, restarts the modem
 

ColinTaylor

Part of the Furniture
Why do you need to restart your modem? Or do you really mean your router?

Do you have to restart the modem/router, why not restart the VPN?

Can you post the router's complete syslog on pastebin which includes the time period the problem occurs so that we can try and understand what is happening.

Can you also post a screen shot of your VPN client settings.

What router model do you have? What firmware version are you using?
 

MatteoPV

Regular Contributor
I have the Asus AC 68 U modem / router with GNUton Merlin 386.02_04 firmware on board.

Everything works fine. Only sporadically does it happen to me that it disconnects from the network, perhaps after I haven't restarted it for 4 or 5 days.

Everything works fine, I was just wondering if there is an addon that can monitor access to the network and in case of no access you restart the VPN for example
 

Torson

Senior Member

MatteoPV

Regular Contributor
It's an interesting script but to make it work I have to create cronjobs etc. It would be nice if it was integrated into the system so that it was customizable directly from the VPN client menu.
I thought there was a more immediate way to check the VPN connection
 

Torson

Senior Member
Thanks for the reply. I installed the script, but how do you set it up? How to use? I followed the directions on the page but didn't understand much
Since you're using Merlin f/w you can configure up to 5 VPN clients. Configure the first 3 clients for each of the 3 Cosenza servers. Then run:
Code:
/jffs/scripts/VPN_Failover.sh 1
This way if the first server fails it will connect to the second client etc. To test the functionality (after you configured the 3 VPN clients) issue the command:
Code:
service stop_vpnclient1
and you'll see that the script will connect to the next VPN client etc.
Once done with the testing don't forget to restart the VPN client
Code:
service start_vpnclient1
. Note that the connection will stick to the last working client. You can check the status with
Code:
/jffs/scripts/VPN_Failover.sh status
.
Also, if you want the script to run upon router reboot, add the statement to '/jffs/scripts/post-mount'.
 

MatteoPV

Regular Contributor
I can't do it. The choice of the IP happens automatically when I start the modem ........ it connects to Cosenza and ExpressVPN gives me an IP address. I would like the system to check the VPN connection every X minutes or seconds and if it is down to restart it. To do this I must necessarily set cronjobs so that the modem then executes everything automatically even if there should be a random power failure and relative restart. Maybe you can do it but I find it uncomfortable
 

Torson

Senior Member
Then try:
Code:
cru a VPN_Failover "5 */1 * * *" /jffs/scripts/VPN_Failover.sh 1 once #VPN Failover
or adjust to every 30 minutes or whatever suits you.
 

MatteoPV

Regular Contributor
Then try:
Code:
cru a VPN_Failover "5 */1 * * *" /jffs/scripts/VPN_Failover.sh 1 once #VPN Failover
or adjust to every 30 minutes or whatever suits you.
I added this command:

cru a VPN_Failover "5 * * * *" /jffs/scripts/VPN_Failover.sh 1 once #VPN Failover
Inside the file :

'/jffs/scripts/post-mount'


That way it should monitor VPN 1 every 5 minutes and restart if needed. It's correct?
 

ColinTaylor

Part of the Furniture
There is a mistake in those instructions on github. The second quotation mark should be at the end of the cru command.

To run the command every 5 minutes you would use */5 not 5.

cru a VPN_Failover "*/5 * * * * /jffs/scripts/VPN_Failover.sh 1 once" #VPN Failover
 
Last edited:

MatteoPV

Regular Contributor
I added to the file:

'/jffs/scripts/post-mount'

These commands:

/jffs/scripts/VPN_Failover.sh 1 once
cru a VPN_Failover "*/5 * * * *" /jffs/scripts/VPN_Failover.sh 1 once #VPN Failover

I deleted the VPN2, 3, 4, 5 configurations, I only use the VPN1 Cosenza. I did the tests, everything works great !!!! Thank you
 

ColinTaylor

Part of the Furniture
That's good to hear.

Personally I would not include the first command and only use the second (cru) command. Otherwise there is a very small possibility that both commands could be running at the same time.
 

MatteoPV

Regular Contributor
I entered the first command for security as I noticed that a few times when the router was restarted, the cru command was not loaded into the ram
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top