Random VPN connection possible?

constidi

New Around Here
Hi,
actually i use a raspberry pi with VPN. The VPN connection changes every 60 minutes randomly to another VPN connection. For example: spain -> canada -> US -> france...

Problem: the pi ist not that fast.

So i wanna buy a better router and thought about asus.

Is it possible to config VPN changes with merlin? Or someone know another router where i can easily config this?

Thank you very much!
 

Purdue

Occasional Visitor
There is no GUI option nor in FreshTomato nor in Merlin that allow the randomize of connection. I think the only possibile way is via scripting, eventually.
 

Viktor Jaep

Regular Contributor
I had a randomizing VPN working with ExpressVPN, but it does require some scripting, but it's actually pretty simple. I'm by all means a complete n00b when it comes ot scripting. You basically make sure your VPN config contains a listing of all the possible vpn hostnames you could make a connection with, then with a cru job, force a reset of your vpn connection on the hour. I have since dropped ExpressVPN in favor of NordVPN, and unfortunately it doesn't make it as easy, as I'm always ending up grabbing a VPN connection in the same city. It's my hopes that the author of vpnmgr will add capabilities like this in the future. If you want any of this stuff for ExpressVPN, I'd be happy to share... just say the word.
 

eibgrad

Part of the Furniture
You can cause OpenVPN to randomly choose a server (i.e., one among many remote directives in the config file) by using the following.

Code:
server-poll-timeout 10
remote-random
remote us-chi.vpnunlimitedapp.com 1194 udp
remote us-dal.vpnunlimitedapp.com 1194 udp
remote us-den.vpnunlimitedapp.com 1194 udp
reneg-sec 0
…

Of course, each VPN provider would be different in terms of the required servers, ports, and protocols. And the server+port+protocol you specify in the GUI is automatically converted into a similar remote directive. You just have to specify any additional ones in the custom config field.

Note: I specified a server-poll-timeout of 10 seconds so the OpenVPN client wouldn't wait too long for what may be an unavailable server. I also disabled the session key change (reneg-sec) that takes place every 60 minutes (by default) to reduce the overhead. If you randomly changed the server less often (e.g., every four hours), perhaps you might want to retain it.

Once the connection is established, you'd have to force a restart every 60 minutes using the scheduler, which you would initialize w/ a services-start script on bootup.

Code:
cru a restart_vpnclient1 "*/60 * * * * service restart_vpnclient1"

Beware, this kind of constant changing of the server can wreak havoc on client applications w/ long running transactions. They may become unresponsive for extended periods until they realize their current connections have been lost (for reasons unknown) and need to restart them.
 

constidi

New Around Here
You can cause OpenVPN to randomly choose a server (i.e., one among many remote directives in the config file) by using the following.

Code:
server-poll-timeout 10
remote-random
remote us-chi.vpnunlimitedapp.com 1194 udp
remote us-dal.vpnunlimitedapp.com 1194 udp
remote us-den.vpnunlimitedapp.com 1194 udp
reneg-sec 0
…

Of course, each VPN provider would be different in terms of the required servers, ports, and protocols. And the server+port+protocol you specify in the GUI is automatically converted into a similar remote directive. You just have to specify any additional ones in the custom config field.

Note: I specified a server-poll-timeout of 10 seconds so the OpenVPN client wouldn't wait too long for what may be an unavailable server. I also disabled the session key change (reneg-sec) that takes place every 60 minutes (by default) to reduce the overhead. If you randomly changed the server less often (e.g., every four hours), perhaps you might want to retain it.

Once the connection is established, you'd have to force a restart every 60 minutes using the scheduler, which you would initialize w/ a services-start script on bootup.

Code:
cru a restart_vpnclient1 "*/60 * * * * service restart_vpnclient1"

Beware, this kind of constant changing of the server can wreak havoc on client applications w/ long running transactions. They may become unresponsive for extended periods until they realize their current connections have been lost (for reasons unknown) and need to restart them.

Thank you Viktor Jaep and eibgrad.

Actually i've NordVPN. So this scripting is possible with an asus router and wrt-merlin?
 

Jack Yaz

Part of the Furniture
you might want to take a look at the vpnmgr addon, it might serve as a good starting point
 

Viktor Jaep

Regular Contributor
you might want to take a look at the vpnmgr addon, it might serve as a good starting point
Hi @Jack Yaz ... I had posted a question/possible feature request for vpnmgr under its thread (http://www.snbforums.com/threads/vp...rations-for-nordvpn-and-pia.64930/post-718012), and wondering if you had any feedback on the possibilities of this? It basically revolves around the same problem that @constidi was trying to solve with scripting here above. Is it possible to somehow use the nordvpn API through your vpnmgr interface to randomly exit through (a) the US as a whole, or (b) perhaps a picklist of different states? I've noticed that nordvpn hostnames are numerous and aren't easily identifiable where they exit based on the hostname compared to expressvpn... they seem to come and go, or get renamed?
 

Viktor Jaep

Regular Contributor
Thank you Viktor Jaep and eibgrad.

Actually i've NordVPN. So this scripting is possible with an asus router and wrt-merlin?

Hi @constidi ... yes, it is possible... however, I have not found a good reliable way to find stable hostnames in various cities that I would want to add to my remote-random list. Nordvpn seems to do things in a different way. Nordvpn uses an API to determine which exit points are closest to you in order to provide you with the greatest speed (is my guess). For this reason, I always seem to exit from the same city. The hostnames also continually seem to change. What may work one day, may not work the next, and I'm not going to keep trimming/updating this config. I'm hopeful that @Jack Yaz might be able to provide some insight to see if perhaps the API could be used in a way to randomly pick an exit point instead?
 

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