Internet access through a WireGuard VPN tunnel (2024)

Table of Contents
Important Note Note Note FAQs References

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

Internet access through a WireGuard VPN tunnel? ›

[en] 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. [en] After that, all clients connected directly to the Keenetic

Keenetic
Founded in 2010, Keenetic is an ambitious, innovative designer/developer & vendor, focused on Wi-Fi routers for SOHO and retail clients. Keenetic has a mission to deliver commercially useful cutting-edge Wi-Fi router performance without energy & memory thirsty pointless gimmicks.
https://keenetic.com › company › about
router will access the Internet through the VPN tunnel.

How do I access the Internet through WireGuard VPN? ›

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 I use VPN to access internet? ›

A VPN cannot give you free internet connection. A VPN operates by shielding your IP address and encrypting your online traffic, but it does not provide a free internet connection or internet access. On the contrary, you need an internet connection for a VPN to work.

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.

How do I run internet through VPN? ›

  1. If you haven't already, add a VPN.
  2. Open your device's Settings app.
  3. Tap Network & internet. VPN. ...
  4. Next to the VPN you want to change, tap Settings .
  5. Turn Always-on VPN on or off. If you've set up a VPN through an app, you won't have the always-on option.
  6. If needed, tap Save.

Does WireGuard have a web interface? ›

A web user interface to manage your WireGuard setup.

How do you use a WireGuard tunnel? ›

Configure a WireGuard Tunnel
  1. Navigate to VPN > WireGuard > Tunnels.
  2. Click. ...
  3. Fill in the WireGuard Tunnel settings as described in WireGuard Package Settings.
  4. Click Save Tunnel.
  5. Add firewall rules on Firewall > Rules, WAN tab to allow UDP traffic to the port for this WireGuard tunnel (WireGuard and Rules / NAT)
May 1, 2023

Why is there no internet access when connected to VPN? ›

If the internet is not working when you're connected to VPN, using an older VPN version might be the reason. Having an updated VPN is important to avoid connection issues. If you are running an outdated version, update it. You can also re-install the VPN software again.

Why is my VPN not allowing internet access? ›

It could be related to unstable internet connections, conflicts with other software such as firewalls or antivirus programs or issues with the VPN server itself, such as overload or maintenance. Additionally, some routers or network configurations may have settings that interfere with VPN connections.

How can I get free internet through VPN? ›

The VPN with the most free data is ProtonVPN – it has an unlimited free version, which includes unlimited data, unlimited simultaneous connections, good speeds, and excellent features for unlimited safe browsing on the internet.

Does WireGuard send all traffic through VPN? ›

WireGuard can be set up to route all traffic through the VPN, and not just specific remote networks. There could be many reasons to do this, but mostly they are related to privacy.

Does WireGuard tunnel all traffic? ›

1 Answer. Like most other VPN systems, Wireguard doesn't make any such decisions on its own – it will route exactly those prefixes that you've configured to be routed through the connection, which may be anywhere from "all traffic" (/0 route) to "a single IP address" (/32 route).

Is WireGuard a full tunnel? ›

WireGuard supports Full Tunnel VPN routing. This means that when the client connects, all Internet traffic routes over the tunnel. This is useful to ensure that the device is fully protected by all security layers of NG Firewall.

Can I route my router through a VPN? ›

Can I use a VPN on a Wi-Fi router? Yes, you can install and use a VPN on your router, but first, check if it's VPN-compatible and the router model. A VPN on a router encrypts ALL of your network's data, ensuring a surefire way of staying safe online on any device using Wi-Fi.

Does VPN bypass internet? ›

A VPN doesn't bypass an ISP, it still uses the ISP's network, but instead of creating a plain connection (over which you get access to websites), it actually creates an encrypted tunnel through which your traffic passes.

How do I allow local traffic in WireGuard? ›

WireGuard® Local Network
  1. Open the WireGuard® Windows client.
  2. In the left pane, select the connection that you want local network routing to work, if you have more than one configuration.
  3. Click onto the 'Edit' button.
  4. Uncheck 'Block untunneled traffic (kill-switch)' option.
  5. Click 'Save'.

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.

How does a VPN route traffic? ›

When the user connects to the web using their VPN, their computer submits information to websites through the encrypted connection created by the VPN. The VPN then forwards that request and sends a response from the requested website back to the connection.

References

Top Articles
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 6039

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.