I configured an OpenVPN client to tunnel all of my traffic through NordVPN.
I copied/pasted a dozen or so remote servers in my region and enabled the "Select remote server at random" flag in my configuration.
I know NordVPN offers nearly 100 servers in my region, so I downloaded a list of their names through the NordVPN API.
Is there a way to import this list into my OpenVPN client configuration instead of manually entering them?
I think editing the config.xml is here the easiest way ..., at least easier to script it then adding 100 Host entries via the Web UI. And updating the list will be easier too.
Fetch the config, update the xml (scripted), upload it and issue a configctl service reload all
As I had no need for openvpn client config, the https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense playbook just offers the server config part for openvpn.
But contributions in form of pull requests are welcome ... ;)
Would this work?
1. Download the configuration from System: Configuration: Backups.
2. Edit the openvpn/openvpn-client section of the configuration file in a text editor:
<opnsense>
...
<openvpn>
<openvpn-client>
...
<server_addr>(Comma-separated list of remote server hosts)</server_addr>
<server_port>(Comma-separated list of remote server port numbers)</server_port>
...
</openvpn-client>
</openvpn>
...
</opnsense>
3. Restore the edited configuration file in System: Configuration: Backups.
Thank you, @zerwes, for pointing me in the right direction.
The download, edit and restore configuration procedure using System: Configuration: Backups worked for me.
One caveat: Each OpenVPN client configuration supports max 64 remote server addresses. The OpenVPN service will fail to load and you will see this message in VPN: OpenVPN: Log File:
Options error: Maximum number of 'remote' options (64) exceeded
Another option that should work. I use ProtonVPN and several weeks ago the DNS stopped resolving for us-free-01 thru us-free-08 and nl-free-01 thru nl-free-11 for some strange reason. Once the DNS resolv issue was corrected, pulled all the IP address's via nslookup/dig and put them into a file "/usr/local/etc/unbound.opnsense.d/protonvpncom.conf" using a different hostname for each. As you can see in the attachment us-free and nl-free was used as to not interfere with external resolution.
I think this could be used in a similar fashion to create upto 64 hostnames with multiple IP's, plus this would survive any kind of software update. I've modified file(s) in the past and they were wiped out with update/upgrades, so keeping the info somewhere that it doesn't get erased.
Just another idea to consider.
Quote from: zz00mm on April 28, 2022, 03:27:12 AMAnother option that should work. I use ProtonVPN and several weeks ago the DNS stopped resolving for us-free-01 thru us-free-08 and nl-free-01 thru nl-free-11 for some strange reason. Once the DNS resolv issue was corrected, pulled all the IP address's via nslookup/dig and put them into a file "/usr/local/etc/unbound.opnsense.d/protonvpncom.conf" using a different hostname for each. As you can see in the attachment us-free and nl-free was used as to not interfere with external resolution.
I think this could be used in a similar fashion to create upto 64 hostnames with multiple IP's, plus this would survive any kind of software update. I've modified file(s) in the past and they were wiped out with update/upgrades, so keeping the info somewhere that it doesn't get erased.
Just another idea to consider.
EDIT: I fixed it with this guide https://protonvpn.com/support/pfsense-openvpn
That's great.
Im from the netherlands too. And also using proton. Could you pass my your main opnsense configuratino backup?? :-)
I can't get it to work. And! What a work to enter everything by hand :-)
you can email me at opnsense.domestic227@passmail.net
Thanks in advance my fellow countryman