Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    use pfsense to run wireguard client (mullvad)

    Scheduled Pinned Locked Moved WireGuard
    15 Posts 3 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      strangegopher
      last edited by strangegopher

      1. Purpose & Problem

      • Purpose Direct all traffic on one of my local networks to use wireguard vpn (visualized below)

        Computer 1,2,3...n -> pfsense -> mullvad -> internet
        
      • Problem I cannot get the any internet traffic to reply to traffic generated from Computers on my local network (timeout)

      2. Setup

      My setup is fairly typical. Please have a look.


      2.1 Wireguard

      Tunnel

      wg_tunnel.png

      Peers

      wg_peers.png

      Status

      wg_status.png

      2.2 Firewall

      Local Interface

      fw_main_net.png

      Wireguard Group

      fw_wireguard.png

      VPN Interface

      fw_vpn.png

      2.3 Interface

      interface.png

      2.4 Routes, Gateways & Outbound NAT

      Routes

      routes.png

      Outbound NAT

      nat.png

      Gateways

      routing.png

      Static Routes

      static_route.png

      2.5 DNS

      dns_servers.png


      3. Diagnostics

      3.1 Firewall States

      fw_closed_syn_sent.png

      3.2 Traceroute

      traceroute.png

      3.3 Ping

      ping.png

      3.4 DNS Lookup

      dns_lookup.png

      Any suggestions would be appreciated!

      Please & Thanks!

      G 1 Reply Last reply Reply Quote 0
      • G
        gabacho4 Rebel Alliance @strangegopher
        last edited by gabacho4

        @strangegopher you need to have allow all rules on the WireGuard and VPN firewall tabs; both of them. This is absolutely what is impeding you from having internet service via the VPN.

        You don’t need the static route. Remove that.

        Make those changes and tell us how things are working. The only other thing you’re doing that I’m not is the DNS settings. I use DNS resolver in forwarding mode and have DNS servers set but not assigned to any gateway. But your settings appear to work.

        S 1 Reply Last reply Reply Quote 0
        • S
          strangegopher @gabacho4
          last edited by strangegopher

          @gabacho4 removed static route and added vpn and mullvad rules (see screenshoot). I also got more firewall state screenshots for vpn and main interface. I still don't get any reply packets.

          wireguard interface

          wg_if.png

          vpn interface

          vpn_if.png

          vpn states

          vpn_states.png !

          main states

          main_states.png

          G 1 Reply Last reply Reply Quote 0
          • G
            gabacho4 Rebel Alliance @strangegopher
            last edited by gabacho4

            @strangegopher on your computer, if you ping Google.com what happens? If you ping 8.8.8.8 what happens? If you do an nslookup google.com what is the dns server that Is queried?

            Do this from your computer not the router.

            G S 2 Replies Last reply Reply Quote 0
            • G
              gabacho4 Rebel Alliance @gabacho4
              last edited by

              @gabacho4 also, did you set a default IPv4 and IPv6 gateway or did you leave it at automatic? If automatic, you need to set one. In your case I’d set the default WAN (IPv4 and IPv6) as them.

              S 1 Reply Last reply Reply Quote 0
              • S
                strangegopher @gabacho4
                last edited by

                @gabacho4 yes I did set default gateway (attached). ping and nslookup results below as well.

                I also tried to redo all the steps based on above screenshots just in case i missed a step. I also reinstalled wireguard (unchecked keep config) just to make sure there was no issue there.

                ping 8.8.8.8 from pc (timeout)

                ping_pc.png

                nslookup from pc

                nslookup.png

                default gateway

                gateway_def.png

                dns settings

                dns_settings.png

                1 Reply Last reply Reply Quote 0
                • S
                  strangegopher
                  last edited by strangegopher

                  @gabacho4 i also noticed that dns seems to be working for whatever reason in the state table... (and its using wan ip address, not vpn gw address)

                  I do have ports 443 and 80 forwared on the wan interface to my lan interface reverse proxy on a raspi....

                  1996820b-9d2f-4595-8096-15603e7166fd-image.png

                  1 Reply Last reply Reply Quote 0
                  • S
                    strangegopher @gabacho4
                    last edited by strangegopher

                    @gabacho4 i changed outgoing interface to vpn and changed settngs in general and dns still seems to work (using vpn interface)

                    82ab7aa1-0ec4-42d8-8cc9-a0e92a9691db-image.png

                    2a45ad3d-796c-4111-9fee-c47097b47d49-image.png

                    G 1 Reply Last reply Reply Quote 0
                    • G
                      gabacho4 Rebel Alliance @strangegopher
                      last edited by

                      @strangegopher you’ve got too many other variables in your setup right now imho. I’d set up a basic router configuration, then get WireGuard working, the add your other configs one at a time so that you can identify when things break. I think you have a problem with your resolver/dns settings. Pfsense can clearly see the world and communicate with it. But your devices, which get their dns resolution from pfsense, seem to have issues. One way to rest this would be to manually specify dns in your computer using maybe 1.1.1.1 and see if your computer magically has internet service through the vpn connection. I do not have a dns address specified for the VPN gateway in the general tab in settings. I just set 8.8.8.8 and 8.8.4.4 and have forwarding in dns resolver turned on. My understanding is that Mullvad intercepts dns requests over a vpn connection and inserts theirs so you don’t have to worry about leaking.

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        strangegopher @gabacho4
                        last edited by strangegopher

                        @gabacho4 just did a full reset and setup basic config (backed it up).tried wireguard again. exact same issue. restored basic backup i did.

                        basic config took me 30 mins to get going. i just set password, wan and lan interfaces/ip/dhcp, add 1.1.1.1 and 1.0.0.1 dns in general and set to use remote dns ignore local dns, make vlans, set vlan interface, set vlan dhcp, set static dhcp, dns overrides, dns set to “forwarding mode”, port forward wan ports 443/80 to lan raspi and finally ddns to cloudflare.

                        for wireguard i first made a tunnel, used generated key to get mulvad to assign me a ip, added peer, checked successful handshake, make wireguard interface, make gateway for wireguard interface, add NAT entry with wireguard interface just created with my local network subnet, and finally changed interface rule to allow all traffic to use the newly created gateway. i also added allow any to any rules as u suggested for wireguard and vpn tabs.

                        that’s it.

                        G 1 Reply Last reply Reply Quote 0
                        • G
                          gabacho4 Rebel Alliance @strangegopher
                          last edited by

                          @strangegopher this is really perplexing. I am using Mullvad as we speak and have no issues. My setup is everything you have with exception of the port forwarding. Can you try to disable that really quickly to see if it is causing the issue? I don't remember seeing anything else "custom" that you have set up but would you mind clarifying if there is indeed anything outside of the basic setup that you have or are using? Did you ever set manually set the DNS for your computer to something else other than your pfsense box? Again, maybe using 8.8.8.8 or something like that. Leave the LAN firewall rule as you have it for the Policy Based Routing via the VPN. Manually set the DNS and let's see if you have connectivity. Other than that, I'm at a loss at this point.

                          1 Reply Last reply Reply Quote 0
                          • S
                            strangegopher
                            last edited by

                            just to update @gabacho4 and I did a remote desktop session and we were not able to resolve this issue. I am moving on from wireguard for now.

                            B 1 Reply Last reply Reply Quote 0
                            • B
                              bcruze @strangegopher
                              last edited by

                              @strangegopher

                              i had an issue very similar when i first attempted to use wireguard. i found the key was copy and pasted incorrectly. i REGENERATED a new key and paste the entire key and it started to work

                              i guess i don't understand why you are forwarding to 1.1.1.1 and you are also using a piehole? -confused look! have you tried just using the unbound resolver out of the box configuration?

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                strangegopher @bcruze
                                last edited by strangegopher

                                @bcruze pfsense forwarded 1.1.1.1 by itself. i tired regeneration, no luck.

                                edit: no pihole... I think it forwarded 1.1.1.1 because I have forward dns servers checked.

                                B 1 Reply Last reply Reply Quote 0
                                • B
                                  bcruze @strangegopher
                                  last edited by bcruze

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.