WireGuard Gateway for Remote Access & Local IP VPN on OpenWRT

Last updated: September 11, 2025
Table of Contents

🌐 About WireGuard Gateway

TorGuard's Private VPN Cloud service can be configured as a WireGuard gateway on OpenWRT routers, enabling secure remote access to your local network or allowing remote users to share your local IP address through an encrypted WireGuard tunnel.

What is a VPN Gateway?

A VPN gateway allows you to:

  • Access your home network securely from anywhere
  • Share your residential IP with remote users
  • Create a secure bridge between multiple locations
  • Bypass geo-restrictions using your home connection

Use Cases

🏠

Remote Home Access

Access home servers, NAS, smart devices from anywhere

🌍

Local IP Sharing

Let family/friends use your residential IP remotely

🏢

Office Network Access

Secure remote work with office network access

📺

Streaming Access

Access local streaming services while traveling

🔒

Secure Bridge

Connect multiple locations securely

🎮

Gaming

Host game servers with stable connection

Network Architecture

🔗 How It Works

WireGuard Gateway Network Diagram

Remote devices → WireGuard tunnel → Your OpenWRT router → Local network/Internet with your IP

Prerequisites

📋 What You'll Need

  • ✅ Active TorGuard Private VPN Cloud subscription
  • ✅ OpenWRT router (or DD-WRT/pfSense/OPNsense)
  • TorGuard WireGuard package for OpenWRT
  • ✅ Basic networking knowledge
  • ✅ Access to router configuration

⚠️ Router Compatibility

This guide focuses on OpenWRT, but the setup is similar for DD-WRT, pfSense, and OPNsense routers.

WireGuard Performance

3-5x

Faster than OpenVPN

<1ms

Connection time

25%

Less CPU usage

256-bit

ChaCha20 encryption

Step-by-Step Setup

1

Access TorGuard Client Area

Log in to your TorGuard account:

  1. Go to TorGuard Client Area
  2. Log in with your credentials
2

Navigate to VPN Cloud

Access your Private VPN Cloud service:

  1. Search for your service
  2. Click Manage dropdown
  3. Select Manage VPN Cloud
Access VPN Cloud Management
3

VPN Cloud Control Panel

In your VPN Cloud control panel, you'll see:

  • Service info and billing status
  • VPN server status
  • Start/Stop/Reboot controls
  • WireGuard configuration section
VPN Cloud Control Panel
4

Enable WireGuard Gateway

Scroll down to the WireGuard VPN Configuration section:

  1. Click WireGuard VPN Configuration dropdown
  2. Enable the gateway feature
  3. Configure your settings
WireGuard Configuration Section

💡 Gateway Mode

When enabled, this allows remote devices to access your local network and use your local IP address for outbound connections.

5

Add Gateway Device

Add your OpenWRT router as a gateway device:

  1. Click Add Device button
  2. Enter a descriptive name (e.g., "Home Gateway")
  3. Select Gateway as device type
  4. Click Add to generate configuration
Add Gateway Device
6

Download Configuration

Download the generated WireGuard configuration:

  1. Click Download Config for your gateway device
  2. Save the .conf file to your computer
  3. Open it with a text editor to view the settings

Configuration Parameters

Parameter Description
PrivateKey Your gateway's private key
Address VPN IP address for gateway
PublicKey Server's public key
Endpoint VPN server address:port
AllowedIPs Traffic routing configuration
7

Install TorGuard WireGuard Package

Install the TorGuard WireGuard package on your OpenWRT router:

  1. Download the TorGuard WireGuard package
  2. Access your OpenWRT router's web interface
  3. Go to System → Software
  4. Click Upload Package
  5. Select the downloaded .ipk file
  6. Click Install

✅ Package Features

  • Easy WireGuard configuration
  • Gateway mode support
  • Automatic routing setup
  • Compatible with all OpenWRT versions
8

Configure WireGuard on OpenWRT

Set up WireGuard using the downloaded configuration:

  1. In OpenWRT, go to VPN → TorGuard WireGuard
  2. Copy values from your .conf file to matching fields
  3. Enable Gateway Mode option
  4. Click Save & Apply
  5. Click Start WireGuard
OpenWRT WireGuard Configuration
9

Configure Local Network Routing

Set up routing for your local network access:

For Remote Access to Local Network:

# Add route for your local subnet uci add network route uci set network.@route[-1].interface='wg0' uci set network.@route[-1].target='192.168.1.0' uci set network.@route[-1].netmask='255.255.255.0' uci commit network /etc/init.d/network restart

For Sharing Local IP:

# Enable NAT masquerading uci set firewall.@zone[1].masq='1' uci commit firewall /etc/init.d/firewall restart
10

Add Remote Devices

Add devices that will connect through your gateway:

  1. Return to VPN Cloud control panel
  2. Click Add Device
  3. Enter device name (e.g., "Laptop", "Phone")
  4. Select Standard device type
  5. Download config for each device
Add Remote Devices
11

Configure Remote Devices

Set up WireGuard on your remote devices:

Windows/Mac/Linux:

  1. Install WireGuard client
  2. Import the downloaded .conf file
  3. Connect to establish tunnel

iOS/Android:

  1. Install WireGuard app
  2. Scan QR code or import config
  3. Enable connection

✅ Connection Test

Once connected, visit https://torguard.net/whats-my-ip.php - you should see your home IP address!

Port Forwarding (Optional)

🔌 Configure Port Forwarding

To access specific services on your local network:

Service Port Protocol Example Use
Web Server 80, 443 TCP Home automation
SSH 22 TCP Remote management
RDP 3389 TCP Windows remote desktop
Plex 32400 TCP Media server

Add Port Forward in VPN Cloud:

  1. Go to Port Forwarding section
  2. Click Add Rule
  3. Configure external and internal ports
  4. Save configuration

Device Requirements

📡 Compatible Routers

🔧

OpenWRT

Recommended - Full support

🌐

DD-WRT

Supported with manual config

🛡️

pfSense

Enterprise-grade option

OPNsense

Open source alternative

Security Benefits

🔐 Enhanced Security

  • End-to-End Encryption: All traffic encrypted with ChaCha20-Poly1305
  • No Port Exposure: Your home ports stay closed to the internet
  • Authentication: Only authorized devices can connect
  • Perfect Forward Secrecy: Compromised keys don't affect past sessions
  • DDoS Protection: Your real IP remains hidden
  • Zero Trust Model: Each device authenticated individually

Troubleshooting

🔧 Common Issues & Solutions

Can't Access Local Network

  • Check AllowedIPs includes local subnet
  • Verify routing table on router
  • Ensure firewall allows forwarding
  • Check MTU settings (try 1420)

Connection Drops

  • Enable persistent keepalive
  • Check router CPU/memory
  • Verify stable internet
  • Update router firmware

Slow Performance

  • Check upload bandwidth
  • Enable hardware acceleration
  • Optimize MTU size
  • Reduce encryption overhead

DNS Not Working

  • Set DNS in WireGuard config
  • Use router's DNS server
  • Check DNS forwarding
  • Try public DNS (8.8.8.8)

IP Not Changing

  • Verify gateway mode enabled
  • Check NAT configuration
  • Restart WireGuard service
  • Clear device DNS cache

Can't Connect

  • Verify server is running
  • Check firewall rules
  • Confirm keys match
  • Test with different port

Advanced Configuration

🔧 Advanced Options

Split Tunneling:

Route only specific traffic through the VPN:

# Add specific routes AllowedIPs = 192.168.1.0/24, 10.0.0.0/8

Multiple Gateways:

Set up failover or load balancing between locations

Site-to-Site VPN:

Connect multiple locations permanently

Custom DNS:

Use your home DNS server for all queries

Best Practices

✅ Recommendations

  • Regular Updates: Keep router firmware and WireGuard updated
  • Strong Keys: Never share private keys
  • Backup Configs: Save all configuration files securely
  • Monitor Usage: Check logs for unauthorized access
  • Bandwidth Planning: Ensure adequate upload speed
  • Firewall Rules: Only open necessary ports
  • Access Control: Limit device access as needed

Need Help?

If you need assistance setting up your WireGuard gateway:

Contact Support

Our team can help with configuration and troubleshooting

Was this article helpful?

Share:

Ready to Get Help?

Our support team is available 24/7 to assist you with any questions.