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

How to best debug Wireguard

Scheduled Pinned Locked Moved WireGuard
7 Posts 3 Posters 649 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.
  • K
    kevdog
    last edited by kevdog Sep 7, 2024, 7:35 PM Sep 7, 2024, 7:34 PM

    A little frustrated here. I've been running a road-warrior-configuration for wireguard from a Digital Ocean Droplet to a home pfSense Server running 2.7.2 for a couple of years. Everything just worked until a couple of days ago -- now the DO droplet can not connect:

    [  +0.000053] wireguard: wg1: Sending handshake initiation to peer 3 (99.xx.xx.xxx:51821)
    [  +5.119909] wireguard: wg1: Handshake for peer 3 (99..xx.xx.xxx:51821) did not complete after 5 seconds, retrying (try 2)
    

    Within pfSense I've configured a dynamic endpoint with wireguard listening over port 51821.
    I haven't changed anything from pfsense side which is frustrating.

    I've port scanned the pfsense from the remote computer using nmap:

    # nmap -sU -p 58121 xx.xx.xxx
    Starting Nmap 7.80 ( https://nmap.org ) at 2024-09-07 14:28 CDT
    
    PORT      STATE         SERVICE
    58121/udp open|filtered unknown
    

    I have a firewall rule on pfSense in regards to an open UDP port on WAN passing all traffic through 51821. I've setup logging on this rule.

    I see nothing in the firewall logs when the remote tries to initiate the handshake from within pfsense. I'm really not sure what to try at this endpoint since I'm kind of stuck.

    T B 2 Replies Last reply Sep 7, 2024, 7:46 PM Reply Quote 0
    • T
      tedquade @kevdog
      last edited by Sep 7, 2024, 7:46 PM

      @kevdog The ports don't match (51821 versus 58121).
      Ted

      K 1 Reply Last reply Sep 7, 2024, 7:49 PM Reply Quote 0
      • K
        kevdog @tedquade
        last edited by Sep 7, 2024, 7:49 PM

        @tedquade said in How to best debug Wireguard:

        Reply

        Hey thanks for catching my error -- however it was an error how I wrote the post -- not the configuration. Here is my updated "post correction":

        # nmap -sU -p 51821 xx.xx.xx.xx
        Starting Nmap 7.80 ( https://nmap.org ) at 2024-09-07 14:47 CDT
        
        PORT      STATE         SERVICE
        51821/udp open|filtered unknown
        
        B 1 Reply Last reply Sep 7, 2024, 7:53 PM Reply Quote 0
        • B
          Bob.Dig LAYER 8 @kevdog
          last edited by Sep 7, 2024, 7:53 PM

          @kevdog You can not expect an answer with nmap for a wireguard port.

          K 1 Reply Last reply Sep 7, 2024, 7:57 PM Reply Quote 0
          • K
            kevdog @Bob.Dig
            last edited by kevdog Sep 7, 2024, 7:59 PM Sep 7, 2024, 7:57 PM

            @Bob-Dig Thanks -- I didn't know that in regards to port scanning WG ports. Are there any specific logs within pfSense I could use to see why the handshake isn't being established?

            Looking through the firewall logs (after enabling all logging on port 51821) I see the following:
            Screenshot 2024-09-07 at 2.55.53 PM.png

            Screenshot 2024-09-07 at 2.59.18 PM.png

            1 Reply Last reply Reply Quote 0
            • B
              Bob.Dig LAYER 8 @kevdog
              last edited by Sep 7, 2024, 8:05 PM

              @kevdog said in How to best debug Wireguard:

              I've been running a road-warrior-configuration for wireguard from a Digital Ocean Droplet to a home pfSense Server running 2.7.2 for a couple of years.

              WireGuard hardly exists a couple of years for pfSense. Any why a road warrior setup?

              There is no sudden problem with pfSense and WireGuard so your best chance might be to post a lot of screenshots what you did within pfSense. I don't know about Digital Ocean Droplet.

              K 1 Reply Last reply Sep 7, 2024, 8:17 PM Reply Quote 0
              • K
                kevdog @Bob.Dig
                last edited by kevdog Sep 7, 2024, 8:33 PM Sep 7, 2024, 8:17 PM

                @Bob-Dig

                Hey thanks for chiming in just really stumped why things exactly 2 days ago stopped working.

                Hopefully this might help from the pfsense side:

                Wireguard Tunnels:

                Screenshot 2024-09-07 at 3.11.40 PM.png

                wg1 interface settings:

                Screenshot 2024-09-07 at 3.13.45 PM.png

                Firewall for the WG interface (wg1)
                Screenshot 2024-09-07 at 3.14.56 PM.png

                Digital_Ocean_WG_S2S_VPN has value of 10.8.110.0/24

                Screenshot 2024-09-07 at 3.33.04 PM.png

                Isn't there a log file somewhere where the WG service would log attempted connections? It seems based on firewall rules and firewall logs there would be traffick passed through to the listening process on 51821. Within the linux client on digital ocean its possible to do dynamic kernel logging. I think within pfSense the wireguard stuff isn't within the kernel but a user space utility?

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received