Jump to content
Not connected, Your IP: 216.73.217.95
Sign in to follow this  
MadeUpName12

How to allow LAN trafic without DNS leaks using Wireguard?

Recommended Posts

Posted ... (edited)

I setup Wireguard, imported the generated configs, it was all very easy but...

My LAN is completely blocked while connected to the VPN now.

If I turn off the kill switch in Wireguard, I can access the LAN but all my DNS stops going through the tunnel.

Note: I run a pi-hole on a Linux PC and use it's LAN address for my DNS.

I would think a million people have the same question but I can't find a definitive answer. :think:

Edited ... by MadeUpName12
Hoping to follow, i forgot to when posted.

Share this post


Link to post
@MadeUpName12

Hello!

We assume you are on Windows, because the "Block untunneled traffic (kill-switch)" checkbox exists only in WireGuard for Windows. Please tell us if that is not the case.

What you see is how that client works:

- With the kill switch on, the client's firewall lets through only the tunnel, loopback, DHCP and DNS queries to the servers in the "DNS =" line. Everything else is blocked, including your LAN, and there is no option for a LAN exception. Putting the Pi-hole's address in the "DNS =" line would let DNS reach it, but the rest of the LAN would stay blocked.
- With the kill switch off, there is no firewall, so Windows can also send DNS queries to the resolver of your network adapter (your Pi-hole or your router, possibly an IPv6 resolver announced by the router).

There is also a second point: the Pi-hole forwards queries to its upstream servers from the Linux PC's own Internet connection, outside the tunnel. So when a leak test shows your ISP's or a public resolver, it is a real leak, not a false alarm. Keeping the Pi-hole without leaks means the Pi-hole itself must resolve through AirVPN.

You have two options.

1. Eddie with WireGuard (simplest)
  • Install Eddie, log in, and in Preferences > Protocols select a WireGuard protocol.
  • Enable Network Lock. In Preferences > Network Lock, "Allow lan/private" is on by default, so your LAN stays reachable while everything else is locked to the tunnel.
  • DNS: use Eddie 2.27.2 (experimental, https://airvpn.org/forums/topic/81340-eddie-desktop-edition-227-beta-released/ ), which blocks every DNS query outside the tunnel. With 2.26.2 (current stable), you must enable Preferences > DNS > "Force all network interfaces for DNS", otherwise Windows can keep asking the Pi-hole and you leak again.
  • Either way, this PC will no longer use the Pi-hole. For ad blocking, enable our DNS block lists at https://airvpn.org/dns/ . The VPN DNS server applies them. Your other LAN devices can keep using the Pi-hole.

2. Keep the Pi-hole and make it resolve through AirVPN
  • In the Client Area, add a new device for the Linux PC and generate a WireGuard configuration for it (do not use the same configuration on two machines at once).
  • On the Linux PC, bring the tunnel up with wg-quick (for example, save it as /etc/wireguard/airvpn.conf, then "sudo wg-quick up airvpn" and "sudo systemctl enable wg-quick@airvpn"). wg-quick keeps your LAN routes, so the other devices should still reach the Pi-hole.
  • In the Pi-hole, Settings > DNS: untick all the preset upstream servers and set 10.128.0.1 as the only custom upstream. That address answers only inside the tunnel, so if the tunnel goes down, the Pi-hole stops resolving instead of leaking.
  • On Windows, keep the kill switch off and put the Pi-hole's LAN address in the "DNS =" line of your WireGuard configuration.

The drawback of option 2: Windows has no kill switch, so if its tunnel drops, your traffic goes out in the clear.

Then test on https://ipleak.net with your browser's secure DNS (DNS over HTTPS) turned off, otherwise the test shows the DoH provider. Every DNS server listed should belong to AirVPN. With option 2 it may be a different AirVPN server than the one your PC uses (the one the Pi-hole uses). That is fine. 

If it still does not work, tell us your client, OS and what the leak test shows, and post your WireGuard configuration without the PrivateKey and PresharedKey lines.

Kind regards

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...