How to Setup a Gateway For Remote Access or Local IP VPN through Wireguard on OpenWRT

TorGuard's Private VPN Cloud service can be configured for remote VPN access to your local network. This also provides your VPN users the ability to have your local IP address through a secure encrypted WireGuard connection.

The WireGuard gateway must be setup on an OpenWRT router to provide the correct routing, however DDWRT and pfsense/OPNSense is also compatible. Your VPN devices can be configured on any mobile device or desktop computer. In this tutorial we will show how to setup the WireGuard Gateway on OpenWRT using the TorGuard OpenWRT package. You can add this OpenWRT package for easy Wireguard configuration on any OpenWRT router.

Step 1)

Log in to your TorGuard Website Account here

Step 2)

Click on your service from Active products and services section or Head to Service menu > My Services.





Step 3)

Search
for your serviceclick Manage to open the dropdown and choose Manage VPN Cloud.

 

 

Step 4)

This is your Cloud VPN Control panel, you will find at the very top your current service info and billing. Underneath is your VPN info and status, as well ability to stop/start, and reboot your VPN server anytime you facing an issue like not reachable.

 

 

Step 5 )

First we need to create the WireGuard config for your VPN Gateway device. In this tutorial the Gateway device will be setup on an OpenWRT router from PrivateRouter.com. The Gateway device is the connection that will tunnel your local IP address and local resources through Wireguard making them available to other VPN connections you create.

Under VPN Configuration click the Add Device button. Under device name enter "gateway" or something similar to identify it. Under the Gateway dropdown menu select "Internal Communication Only" since we will be tunneling the local IP address and network to your other VPN devices. Click the Add button.

Step 6 )

Under Default Gateway click the dropdown and select the WireGuard IP address of the newly created gateway device. Click the UPDATE button.



Step 7 )

Next, click the Download Config link and open the WireGuard config file in a text editor like notepad.



Your Gateway WireGuard config file should look similar to the file below. Make note of each value as we will copy paste these into the OpenWRT router in the next step.



Step 8 )

Copy and Paste each value from the WireGuard config text file into the TorGuard WireGuard menu on the OpenWRT router. Under Firewall Zone section change the value from "wan" to lan.


After all the settings are input scroll down and click the Save and Apply button. Then select the Click to Start WireGuard button. You can choose the Click to Stop WireGuard button at anytime to disable the WireGuard gateway connection.



You can verify that WireGuard is connected by clicking the Network menu on the sidebar and selecting Interfaces. You should see the WireGuard interface or "WG" connected with RX and TX data passing through.



Step 9 )


Now that your VPN gateway is up and running with WireGuard it's time to connect to your gateway with another VPN device. Navigate back to the TorGuard members area and click the Add Device button.


Under device name enter a name to identify the VPN connection like iPhone, Android or Desktop1. Under Gateway select the Gateway dropdown menu and select Default Gateway. Click the Add button.


Step 10 )


You have finished setting up your first VPN connection for Remote Access and have assigned this new WireGuard device the local IP address of your Gateway. Click the Download config link to add to your Desktop WireGuard client, or scan the QR code to add the device to your mobile WireGuard app.


You can now connect to WireGuard on this device through your local gateway (OpenWRT Router) and take advantage of local network resources and use the gateway's local IP address. Repeat steps 9 - 10 to add other devices.



Was this answer helpful? 0 Users Found This Useful (0 Votes)