What's new
  • 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!

VPNMON VPNMON-R3 Custom WireGuard Server List Generation Tutorials and Examples

iTyPsIDg

Senior Member
This thread will share the same essence as VPNMON-R3 Custom OVPN Server List Generation Tutorials and Examples; however, this is for generating WireGuard server lists.

I currently only have Nord and Proton as VPN providers, so I'll focus on those for now.

Current VPN Providers Supported that utilize API functionality and include WireGuard details:
  • NordVPN
The examples below are provided to demonstrate how CURL + JQ queries can be used to auto-populate custom WG Server Lists within VPNMON-R3. For example, you may want your WG Client Slot 1 to only connect to servers in New York. WG Slot 2 might be populated with all the servers within the United States. Etc. I'm providing examples of what might be possible, and how to craft these statements so you can copy/paste them directly into VPNMON-R3 with minimal effort.

As shown below, the "WG/VPN Client Slot Server List Automation" menu allows you to View/Edit and Execute these statements, which will then pull the required VPN Server IPs from these various VPN Providers, and copy them into local server lists that VPNMON-R3 uses to reconnect your connections to.

1753111256996.png


NordVPN
Step 1)
Nord uses a single private key for all VPN servers. You will need to visit Nord and generate an access token before you can locate your private key.
  1. Go to this NordVPN link.
  2. Click the "Set up NordVPN manually" button.
    1753111577873.png
  3. After completing the email verification, you will be directed to a page that allows you to generate an access token. Click the "Generate new token" button.
    1753111602065.png
  4. Leave the token expiration as is (private keys don't seem to change, so it is fine if it expires in 30 days). Click the "Generate token" button.
    1753111618334.png
  5. Copy the access token for use in the next step and close the pop-up dialog.
    1753111630906.png

Step 2) Obtain your private key
Bash:
curl -s -u token:"{ACCESS_TOKEN_FROM_PREVIOUS_STEP}" "https://api.nordvpn.com/v1/users/services/credentials" | jq -r .nordlynx_private_key
Use this private key in the following curl examples.

Step 3) Generate your server list query using the Private Key you generated above. Examples:
  1. Top 5 Recommended WireGuard NordVPN Servers: This example shows you how to export all recommended NordVPN Server IPs based on a NordVPN algorithm per your location, and should be the fastest with the lowest load. Copy and paste the curl statements into an SSH window on your router to test their output.

    First, determine the ID for your chosen country. (Exact number is of great importance!). The ID is in [ ] directly next to your country name.
    Bash:
    curl --silent "https://api.nordvpn.com/v1/servers/countries" | jq --raw-output '.[] | . as $parent | .cities[] | [$parent.name, $parent.id, .name, .id] | "\(.[0]) [\(.[1])] - \(.[2]) [\(.[3])]"'
    Once you have found your Country ID, replace the ID in the curl statement below. In this example, I'm using the United States, which is ID 228. Also, replace your Private Key with the value you obtained previously. If the output creates a five-column list that looks like a CSV (example output below), you can copy/paste this statement into your VPNMON-R3 Server List Automation Slot and execute it in order to generate a list.
    Bash:
    curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors "https://api.nordvpn.com/v1/servers/recommendations?filters\[country_id\]=228&filters\[servers_groups\]\[identifier\]=legacy_standard&filters\[servers_technologies\]\[identifier\]=wireguard_udp&limit=5" | jq --raw-output '.[] | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.name, $parent.station, .metadata[0].value] | "\(.[0]),\(.[1]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[2])"'
    Output:
    Code:
    United States #9397,185.203.218.154,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    United States #9391,185.203.218.142,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    United States #9392,185.203.218.144,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    Another option, if you want to display the city and server ID in column one, looks like this (and is my preferred method):
    Bash:
    curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors "https://api.nordvpn.com/v1/servers/recommendations?filters\[country_id\]=228&filters\[servers_groups\]\[identifier\]=legacy_standard&filters\[servers_technologies\]\[identifier\]=wireguard_udp&limit=5" | jq --raw-output '.[] | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
    Output:
    Code:
    Miami #6610,37.120.215.35,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    Miami #9382,185.203.218.124,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    Miami #9396,185.203.218.152,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    Miami #5940,185.245.86.54,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
    Miami #9394,185.203.218.148,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
  2. All NordVPN Servers in a certain Country: This example shows you how to export all VPN Server IPs for a certain country. Copy and paste the curl statements into an SSH window on your router to test their output.

    First, determine the name of your chosen country using the same query as above that provided the ID number. (Exact spelling is of great importance!)

    Once you have found your country's name, replace it with the corresponding name in the curl statement below; repeat for the private key. In this example, I'm using "United States". If the output creates a five-column list that looks like a CSV, you can copy/paste this statement into your VPNMON-R3 Server List Automation Slot and execute it in order to generate a list.
    Bash:
    curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.nordvpn.com/v1/servers?limit=16354 | jq --raw-output '.[] | select(.locations[0].country.name == "United States") | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
  3. All NordVPN Servers in a certain City: In this example, I will show you how to filter all VPN Servers for a certain city. Copy and paste the curl statements into an SSH window on your router to test their output.

    Use the same query above to obtain country names/IDs to also determine accurate city names/IDs.

    Once you have found your country/city in the list, replace the city name (exact spelling) in the curl statement below. In this example, I'm using "New York". If the output creates a five-column list that looks like a CSV, you can copy/paste this statement into your VPNMON-R3 Server List Automation Slot and execute it in order to generate a list.
    Bash:
    curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.nordvpn.com/v1/servers?limit=16354 | jq --raw-output '.[] | select(.locations[0].country.city.name == "New York") | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
 
Last edited:
Note: VPNMON-R3 does not add the address or allowed IPs to the WireGuard configuration. You need to add these two items manually and ensure you enable WireGuard for the client you configured. I use 0.0.0.0/0 in allowed IPs. I also configured the Network section the way I wanted it.
1753299925215.png

NordVPN uses 10.5.0.2/32
ProtonVPN uses 10.2.0.2/32
 
Last edited:
Reserved Post #2
 
Reserved Post #3
 
Reserved Post #4
 
Reserved Post #5
 
Awesome @iTyPsIDg!! Thanks so much for doing this! :)

If you get a chance, could you also please include that step on how to create a .conf file to import and get your slot configured? That was also super helpful and a necessary step!
 

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!
Back
Top