Internet access through a WireGuard VPN tunnel (2024)

Table of Contents
Important Note Note Note FAQs

Internet access through a WireGuard VPN tunnel

What should the settings be so that clients connected via the WireGuard VPN have access to the Internet?

Important

This configuration increases the load on the VPN channel and the Internet channel, to which Keenetic is connected as a VPN server.

  1. Allowed IPs 0.0.0.0/0 must be specified in the client peer settings. If the client is a Keenetic router, the 'Use for accessing the Internet' option should be enabled in the interface parameters.

  2. Also, the client side configuration must have a DNS server specified (e.g. Google's public DNS server address 8.8.8.8).

    Note

    The client of WireGuard VPN-server can be aKeenetic router, mobile devices based onAndroidandiOS, or computers based onWindows, Linux,macOS.

  3. On the server side, which should be used to access the Internet, the following settings are required.

    Note

    In the case of WireGuard, it does not matter who the server is in this scheme, i.e. who accepts the connection and initiates it. But usually, it's the server that's waiting for the connection.

    You must assign the private security level to the WireGuard interface. To do this, you need to enter the following command in thecommand-line interface(CLI) of the router (in our example, for the Wireguard0 interface):

    interface Wireguard0 security-level private

    Also, the network address translation (NAT) option must be enabled for the interface. To do this, you will need to enter the command:

    ip nat Wireguard0

    These are necessary and sufficient conditions. The settings on the server should be saved with the command:

    system configuration save
  4. Keep in mind that changing the tunnel interface's security level from public to private causes a change in the rules for traffic transfer to this interface from other local networks of the router and back. You can find the settings needed to resolve this situation in the note to theNetwork segmentsarticle.

    For traffic from hosts connected to the tunnel to be sent to the local segment, you must add a permit rule on the tunnel interface in the incoming direction. In this rule, the range of addresses on the local network segment must be specified as the destination.

    As this setting, the rule that allows all incoming traffic, which we set up on the tunnel interface in theConfiguring a WireGuard VPN between two Keenetic routersarticle, will be suitable. After changing the interface security level configured by this instruction, the firewall rule will remain and continue to perform another function.

    In addition to configuring static routing, you will also need to add permit firewall rules on each local segment. In these rules, the destination addresses must include host IP ranges on remote networks behind the tunnel that require access from this local segment.

Example

Consider an example where clients connected to a Keenetic router that acts as a VPN client will access the Internet through this VPN tunnel. In other words, from the VPN client, all traffic will be routed to the WireGuard tunnel, both to access the remote network and the Internet.

Take the scheme shown in the manualConfiguring a WireGuard VPN between two Keenetic routersas a basis.

  1. On the VPN server, change the security level of the Wireguard0 interface and enable the automatic address translation rule for it.

    interface Wireguard0 security-level privateip nat Wireguard0system configuration save
  2. In theweb interface, add permit rules on the local network interfaces to allow traffic to pass through the network behind the remote router. Permission to send traffic to the VPN client's local network:

    Internet access through a WireGuard VPN tunnel (1)

    And on the VPN client side, add a permit rule for the Home network to allow traffic to the VPN server's LAN.

  3. For a VPN client, it is necessary to correct the configuration of the WireGuard interface. It is required to add the address space 0.0.0.0/0 to the allowed networks. In the configuration of the interface itself, enable the 'Use for accessing the Internet' option and specify the DNS server(s). In our example, we specified a public Google DNS server (8.8.8.8), but you can also use local addresses available in the tunnel, such as the VPN server's address (172.16.82.1).

    Internet access through a WireGuard VPN tunnel (2)

    Save the setting.

  4. The WireGuard interface will appear on the VPN client in the 'Internet' menu on the 'Connection priorities' page. Drag and drop it to the top of the list to make it the primary connection.

    Internet access through a WireGuard VPN tunnel (3)

    After that, all clients connected directly to the Keenetic router will access the Internet through the VPN tunnel. If you need to configure access only for some devices, in this case, we recommend you to create an individual profile and bind specific devices to it. How to do this is shown in the 'Connection priorities' instruction.

    The setup is complete.

Note

To disable the configured feature, all you have to do is enter the commands on the VPN serverinterface Wireguard0 security-level publicandno ip nat Wireguard0, then save the settings with the commandsystem configuration save. On the VPN client, for the WireGuard interface, you need to disable the 'Use for accessing the Internet' option and remove the 0.0.0.0/0 network from allowed.

Firewall rules and the specified DNS servers will not interfere with the configuration from the article 'Configuring a WireGuard VPN between two Keenetic routers' too.

In this section:

Internet access through a WireGuard VPN tunnel (2024)

FAQs

How do I access the internet through WireGuard? ›

Obtain the VPN configuration file from your provider or set up your own WireGuard server. Import the configuration file into the WireGuard app. Connect to the VPN by tapping the "Connect" button. You can now access the internet securely and privately through the WireGuard VPN on your phone.

Can you access internet through VPN? ›

Install the VPN app on your smartphone. Connect to a server in your chosen location. Voilà – surf the internet safely while on the go.

How to route traffic through VPN WireGuard? ›

WireGuard Selective Routing to External VPN Endpoint
  1. Step 1 - Configure the peer. ...
  2. Step 2 - Configure the WireGuard Instance. ...
  3. Step 3 - Turn on WireGuard. ...
  4. Step 4 - Assign an interface to WireGuard and enable it. ...
  5. Step 5 - Restart WireGuard. ...
  6. Step 6 - Create a gateway.

Why am I connected to VPN but Cannot access internet? ›

The likely causes for these issues include: Poor connectivity at the chosen VPN server location. Interference by internet service providers for certain VPN protocols. Interference from your antivirus or online security application's outgoing packet transmission.

Does private Internet access use WireGuard? ›

PIA VPN automatically uses WireGuard® and you can switch between WireGuard® and OpenVPN in our app.

Does WireGuard have a web interface? ›

A web user interface to manage your WireGuard setup.

How to get free internet through VPN? ›

You can't get free internet with a VPN. Free internet doesn't exist, first of all. You'll need to pay for a provider and then use a VPN to go online safely. VPNs don't provide an internet connection.

How to use local network to access internet while connected in VPN? ›

Accessing Local Network Resources While Using VPN
  1. Step 1: Open “Network and Sharing Center” ...
  2. Step 2: In the window that appears, select “Change Adapter Settings” ...
  3. Step 3: A window should appear showing all of your network connections. ...
  4. Step 4: Select the “Networking” Tab.
Mar 31, 2015

Can you share internet through VPN? ›

You can share your VPN using Wi-Fi, Ethernet, or a router. With a robust VPN, such as NordVPN, and detailed guides on how to share an encrypted connection, you will be able to enjoy unblocked content and secure browsing on all your home devices within minutes.

Is WireGuard full tunnel? ›

WireGuard supports Full Tunnel VPN routing.

How do I route all Internet traffic through VPN? ›

Navigate to VPN | Settings and create the VPN policy for the Remote site. You can name the policy as VPN to Central Network. Select the Network tab and under Local Networks you can chose X0 Subnet. Under Remote Networks, select Use this VPN Tunnel as the default route for all Internet traffic.

How does routing work in WireGuard? ›

At the heart of WireGuard is a concept called Cryptokey Routing, which works by associating public keys with a list of tunnel IP addresses that are allowed inside the tunnel. Each network interface has a private key and a list of peers. Each peer has a public key.

How do I stop a VPN from blocking my internet? ›

How to Avoid VPN Blocks
  1. Server switching. You can often bypass a VPN block by switching servers or going to a different VPN provider. ...
  2. Obfuscated servers. An obfuscated server is able to hide the fact that a user is using a VPN. ...
  3. Dedicated IP addresses. ...
  4. Change ports. ...
  5. Change security protocols. ...
  6. Switch to Mobile Data.

Why does Wi-Fi not work when connected to VPN? ›

There can be multiple reasons why you can't connect to a VPN while using a wifi connection: network restrictions (some wifi networks, especially public ones, can have restrictions that prevent VPN usage), firewall settings (if the wifi network has a firewall enabled, it can be blocking a VPN), and more.

Why do I lose my internet connection when I connect to VPN? ›

Various factors can cause VPN disconnection. These primarily include an unstable internet connection, outdated VPN software, slow internet connection or obstructions from other applications, such as firewalls or antivirus programs.

How do I use WireGuard on my router? ›

Go to [VPN] > [VPN Server] > enable and click [WireGuard® VPN] > click add button. 4. For general devices like laptops or phones, you can just click the Apply button.

How do I connect to WireGuard? ›

  1. Step 1: Expose Wireguard VPN Server to the Internet. Your Public IP Address. ...
  2. Step 2: Setup Wireguard VPN Server. Install the wireguard software and dependencies. ...
  3. Step 3: Setup client connections. ...
  4. Step 4: Setup clients. ...
  5. Step 5: Test Connection.
Sep 29, 2023

Can I use a VPN to connect to my home network from anywhere? ›

Remote access: A VPN allows you to access your home network from anywhere, enabling you to use your devices and files as if you were at home.

How do I use WireGuard for remote access? ›

Create the Wireguard Setup on your Internal Network
  1. Enter a unique Name for this Interface.
  2. Enter a Description (optional)
  3. Check Enabled.
  4. Enter the IP Address to be used for this Wireguard Internal Network. ...
  5. Enter the Listen Port to be used when connecting to the VPN (Default: 51820).

Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 6065

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.