What's new

VPN and connection management in general

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

MatteoPV

Senior Member
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
 
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
 
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?
 
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
 
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
 
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'.
 
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
 
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.
 
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?
 
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:
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
 
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.
 
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
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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