Wireguard - Setup Remote Access VPN (2024)

How to Setup a Wireguard Remote Access VPN

Here are instructions on how to set up a Remote Access VPN using the Built-In Wireguard capabilities of VergeOS. More information can be found in the Help section of the VergeOS User Interface.

Create the Wireguard Setup on your Internal Network

You can use an existing Internal Network or create a new Internal Network.

  1. In the Verge OS UI, Navigate to Networks->Internals and View or double-click on the Internal Network that you want to use.

  2. In the left menu, Click on Wireguard (VPN)

  3. Click on Add New Interface
    Wireguard - Setup Remote Access VPN (1)

  4. Enter the Information below:

    • Enter a unique Name for this Interface
    • Enter a Description (optional)
    • Check Enabled
    • Enter the IP Address to be used for this Wireguard Internal Network. This must be separate from your existing Internal network IP scheme. For example: If your Internal Network is using 192.168.0.1/24, you must choose a different unique IP scheme like 192.168.255.1/24.
    • Enter the Listen Port to be used when connecting to the VPN (Default: 51820). This is the port that you will use on your External network to send VPN traffic into your Internal Network.
    • Enter a Private Key or leave it blank to Auto-generate a key.
    • Enter an Endpoint IP or leave it blank and the system will attempt to auto-detect the IP. We highly recommend you enter the IP manually to ensure the correct config. This IP is the External IP of your environment, Usually, it is the same IP as your UI. You can find your External IP by going to Networks->Externals and viewing your External network. In the Network Router section, it should be the IP address as seen below:
      Wireguard - Setup Remote Access VPN (2)
  5. Click Submit to add the new interface

  6. After adding the interface, it will take you to the dashboard where you will see your new interface.
    Wireguard - Setup Remote Access VPN (3)

  7. Click Apply Rules on the left menu bar to apply the firewall rules. Here are the rules that it adds:
    Wireguard - Setup Remote Access VPN (4)

  • It automatically creates two firewall rules to accept inbound UDP traffic on port 51820 to both the Router IP and the DMZ IP of the Internal Network.

External Network PAT Rule

In order for the internal network to be connected, we need an external PAT (Port Address Translation) rule to translate the port (default 51820) to the internal network.

Wireguard - Setup Remote Access VPN (5)

Add External PAT Rule

  1. From the External network Dashboard, Click Rules on the left menu.
  2. Click New on the left menu.
  3. Enter a Name that will be helpful to future administration.
  4. Optionally, a Description can be entered to record additional administration information.
  5. In the Action dropdown, select Translate.
  6. In the Protocol dropdown, select UDP.
  7. In the Direction dropdown, select Incoming.

Source:
8. In the Type dropdown, select Any/None. Optionally you can source-lock the VPN traffic here if you have that requirement.

Destination:
9. In the Type dropdown, select My Router IP. If you are inside of a Tenant, change this to My IP Addresses and choose the IP of the Tenant UI. This should be the same as the Endpoint IP used above. If you plan to use a different IP than the UI IP, we recommend that you to create a SNAT rule on the External network. See below for instructions.
10. In the Destination Ports/Ranges field, enter the Port (Default Port is 51820)

Target:
11. In the Type dropdown, select Other Network DMZ IP.
12. In the Target Network dropdown, select the Target Network.
13. In the Target Ports/Ranges field, leave this blank.
14. Click Submit.
15. Click Apply Rules on the left menu to put the new rule into effect.


SNAT rule recommended if not using the UI IP

If you are adding Wireguard and you are not using the IP address of the UI, we recommend creating an SNAT rule on the External network.

  1. From the External network Dashboard, Click Rules on the left menu.
  2. Click New on the left menu.
  3. Enter a Name that will be helpful to future administration.
  4. Optionally, a Description can be entered to record additional administration information.
  5. In the Action dropdown, select Translate.
  6. In the Protocol dropdown, select UDP.
  7. In the Direction dropdown, select Outgoing.

Source:
8. In the Type dropdown, select Other Network DMZ IP.
9. In the Network dropdown, select the Internal Network that Wireguard is on.
10. In the Source Ports/Ranges field, leave this blank.

Destination:
11. In the Type dropdown, select Any / None.
12. In the Destination Ports/Ranges field, leave this blank.

Target:
13. In the Type dropdown, select My IP Addresses.
14. In the IP Address dropdown, select the IP address you want to use.
15. In the Target Ports/Ranges field, leave this blank.
16. Click Submit.
17. Click Apply Rules on the left menu to put the new rule into effect.

This SNAT rule is recommended to force any outgoing traffic coming from the DMZ IP of the internal network to use the correct IP instead. By default it will go out the IP of the UI and this can cause some flapping issues.


Adding a Remote User Peer

You will set up a Peer for each User connecting to the VPN

  1. From the Wireguard Interface screen, Click Add new peer.
    Wireguard - Setup Remote Access VPN (6)

  2. Assign a Name to the peer, such as the remote user's name.

  3. Optionally, a Description can be entered to store additional information about this peer.

  4. Check the Auto-Generate Peer Configuration checkbox to automate settings and create a configuration file that can be used on the client.

  5. Enter the Endpoint for the Peer (the external-facing IP address, hostname, or URL this system will use to communicate with the peer). This can be left blank if the internal network will never be initiating traffic across the VPN (i.e. roaming client).

  6. For Allowed IPs, Enter the /32 IP for this peer.

  7. In the Configure Firewall dropdown, select Remote User

  8. Click Submit to save the new peer entry.

  1. This will create a Firewall rule to allow the Peer to connect through UDP on port 51820 to the Router IP on the Internal Network.
    Wireguard - Setup Remote Access VPN (7)

Download the Configuration File:

  1. Click the Download Config button on the peer record and select a location for the file; download to a location that will be accessible to the client computer or from which can otherwise be transferred to the client.

Wireguard - Setup Remote Access VPN (8)
Wireguard - Setup Remote Access VPN (9)

Install WireGuard Software on Client:

WireGuard Client software can be downloaded from: https://wireguard.com/install . (In this example, we download and install WireGuard for Windows-64bit to use on a Windows 10 Pro machine.)

Wireguard - Setup Remote Access VPN (10)

  1. Click Add Tunnel.
  2. Navigate to and select the generated configuration file.
  3. The configuration file is used to automatically create interface and peer on the client machine. Click the Activate button to open the tunnel, if it was not automatically activated.
    Wireguard - Setup Remote Access VPN (11)

Need more Help? Email support@verge.io or call us at (855) 855-8300


Wireguard - Setup Remote Access VPN (2024)
Top Articles
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6548

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.