What's new

[Q] [Solved] How can I randomly choose a VPN I connect to at boot?

  • 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!

peepsnet

Regular Contributor
I want to have the router load one of 12 different My-OpenVPN-XX.ovpn randomly at boot and once every 12 hours as a bonus

I tried just injecting the "route my.openvpnserver.com" to the config from openvpnclient1.postconf but that failed to launch the VPN at all.

Ideas??
 
Do they all share the same configuration except for the connected server? if so, add the following lines in the VPN custom config section

remote server-url server-port (repeat for each server)
remote-random

EDIT: If that works for you, the second part to do it every 12 hours is just a cron job that issues a 'service restart_vpnclientx'
 
Last edited:
WOW awesome!! Testing

Edit:
It seems the .ovpn file provided from the VPN Service has the crt and ca in it and it is not matching once exited

I am asking the support for a file with all the servers in it.
 
Last edited:
Are they all the same certs? For most providers, they are. If so, just enter them thru the gui into the VPN configuration.
 
Ok I was given a zip containing about 10 ovpn files one for each server. each with a crt and ca block in the .opvn

Now I have another issue
my router cannot resolve the URL

Code:
/tmp/home/root# nslookup us-atlanta.privateinternetaccess.com 
Server:    127.0.1.1
Address 1: 127.0.1.1

nslookup: can't resolve 'us-atlanta.privateinternetaccess.com'

Code:
/tmp/home/root# nslookup us-atlanta.privateinternetaccess.com 1.1.1.1
Server:    1.1.1.1
Address 1: 1.1.1.1 one.one.one.one

Name:      us-atlanta.privateinternetaccess.com
Address 1: 66.115.168.12
Address 2: 66.115.168.18
Address 3: 66.115.168.20
Address 4: 66.115.168.21
Address 5: 66.115.168.23
Address 6: 66.115.168.25
Address 7: 66.115.168.27
Address 8: 66.115.169.204
Address 9: 66.115.169.205
Address 10: 66.115.169.216
Address 11: 66.115.169.232
Address 12: 66.115.169.244
Address 13: 66.115.168.2
 
Are you using DNS Privacy DoT? If so, try turning it off.

EDIT: On one of the 384.16 betas
 
Yes, I use PIA too.....and use what I posted to randomize against a couple of servers.

EDIT: And...hit the same problem on my fork with name resolution on the pia servers that I had to fix. I was wondering why nobody on Merlin had reported a problem, and maybe there was some other difference that prevented it from showing up.
 
Turn
Are you using DNS Privacy DoT? If so, try turning it off.

EDIT: On one of the 384.16 betas

turned it off and:
Code:
 nslookup us-atlanta.privateinternetaccess.com
Server:    24.233.167.167
Address 1: 24.233.167.167 seattle.myacc.net

Name:      us-atlanta.privateinternetaccess.com
Address 1: 66.115.169.206
Address 2: 66.115.169.231
Address 3: 66.115.168.21
Address 4: 66.115.169.233
Address 5: 66.115.168.29
Address 6: 66.115.169.222
Address 7: 66.115.169.227
Address 8: 66.115.169.217
Address 9: 66.115.168.15
Address 10: 66.115.169.205
Address 11: 66.115.169.197
Address 12: 66.115.168.2
Address 13: 66.115.169.234

What is that about??
 
Well I guess I can nslookup all the servers and get the IPs...

Its that or Animal Crossing!!!
 
well I think it is working...

I added all the IPs and remote-random like you suggested in post#2

I would like to be able to check which server the VPN connected to. How can I do that??

To be specific:

I loaded a single .ovpn file on the VPN Client Page.
Changed the URL to an IP
I added the CA and CRT files(the edit button and copy/paste) included in the zip on the VPN Client page also.
Then added all the IPs to the Custom Configuration section


I dont know if the included CA and CRT files needed to be added but it is what I did and it is working.

I would like to be able to check which server the VPN connected to. How can I do that??
 
Last edited:
I got it!!

I would like to be able to check which server the VPN connected to. How can I do that??

Code:
cat /tmp/etc/openvpn/client1/status
 
@john9527
I was able to get the the URL to resolve by adding 1.1.1.1 and 1.0.0.1 in the DNS server 1 and 2.

I originally had them blank and the DOT valuse filled in below. Filling them in still allows me to use DOT but I guess it rolls over to regular DNS when DOT fails

I don't know if this is something you can try also
 

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