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

    OpenVPN Not Connecting - Unable To Contact Daemon

    Scheduled Pinned Locked Moved OpenVPN
    41 Posts 2 Posters 4.5k 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.
    • P
      panzerscope @viragomann
      last edited by

      @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

      @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

      I use remote DNS, namely cloudflare @ 1.1.1.1 on my PfSense config for resolution.

      The question is, which DNS the concerned devices are using.

      I have configured it on my VPN Client that it pulls the VPN DNS, to avoid any leaks for any devices going out over the VPN

      The screenshot above is showing something different.
      Anyway, this setting affects pfSense only.

      So which DNS server is configured on the devices??

      Do you forward DNS?

      Still waiting for a screenshot of the gateway statues, when the VPN is connected.

      So I checked the Gateways and my defaults are correct as below

      Was the VPN client enabled, when you checked this?

      The devices on my network are set to either Auto/192.168.1.1 which either way will get the DNS from PfSense which is currently configured on PfSense to look remotely at 1.1.1.1.

      DNS Forwarding is not enabled on my PfSense.

      Here is the screenshot of the Gateway Status when VPN is enabled and connected :

      0759a574-d4be-4579-b339-671dba316101-image.png

      Many thanks !

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @panzerscope
        last edited by

        @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

        The devices on my network are set to either Auto/192.168.1.1 which either way will get the DNS from PfSense

        So they try to request pfSense. But the LAN ruleset does not allow this, as long as the is no floating rule passing it, as I tried hard to explain above.

        which is currently configured on PfSense to look remotely at 1.1.1.1.

        What pfSense does on its own, is another part.
        In fact it passes out requests to the default gateway, which is WAN according to gateway status.

        DNS Forwarding is not enabled on my PfSense.

        I also tried to explain the benefit of this and behavior and drawback without.

        The issue I am facing is per my last post where disabling or enabling the Lan Subnet rule (as per the last screenshot) will either force all my clients over VPN, or none of them.

        From your rules and gateway status I have no idea why this should be the case, if it's not on DNS.
        In which case is the traffic passing over the VPN?
        Ans as you said any, I assume, this concerns any LAN device.

        From one of the devices included in the VPN alias try to simply ping 1.1.1.1 and 8.8.8.8 in both cases, VPN connected and disconnected.
        What do you get?

        P 1 Reply Last reply Reply Quote 0
        • P
          panzerscope @viragomann
          last edited by

          @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

          @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

          The devices on my network are set to either Auto/192.168.1.1 which either way will get the DNS from PfSense

          So they try to request pfSense. But the LAN ruleset does not allow this, as long as the is no floating rule passing it, as I tried hard to explain above.

          which is currently configured on PfSense to look remotely at 1.1.1.1.

          What pfSense does on its own, is another part.
          In fact it passes out requests to the default gateway, which is WAN according to gateway status.

          DNS Forwarding is not enabled on my PfSense.

          I also tried to explain the benefit of this and behavior and drawback without.

          The issue I am facing is per my last post where disabling or enabling the Lan Subnet rule (as per the last screenshot) will either force all my clients over VPN, or none of them.

          From your rules and gateway status I have no idea why this should be the case, if it's not on DNS.
          In which case is the traffic passing over the VPN?
          Ans as you said any, I assume, this concerns any LAN device.

          From one of the devices included in the VPN alias try to simply ping 1.1.1.1 and 8.8.8.8 in both cases, VPN connected and disconnected.
          What do you get?

          Ok, so I went back and added the rule you suggested on LAN tab regarding DNS as seen below.

          a7b02d7a-6d40-4269-864e-5b4bb06e1a33-image.png

          Look ok to you ?

          I re-read your responses, but I cannot see anything mentioning the setup of any DNS Forwarding.

          Yes all my LAN devices will use the VPN, assuming I have disabled the following rule.

          482057f9-91be-45db-9cdf-5c594c96db92-image.png

          I can ping 1.1.1.1 or 8.8.8.8 from any device on my network whether its running over the connected VPN or over standard WAN.

          V 1 Reply Last reply Reply Quote 0
          • V
            viragomann @panzerscope
            last edited by

            @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

            Ok, so I went back and added the rule you suggested on LAN tab regarding DNS as seen below.
            Look ok to you ?

            No, the protocol has to be "TCP/UDP" for DNS.
            And this assumes, that the devices really use pfSense.

            My suggestion is to combine this with two port forwarding rules. One for the devices, which should go over VPN. This avoid DNS leaking, as mentioned multiple times. And a second for the rest.

            This are port forwarding rule to redirect DNS and NTP to pfSense:
            bd976468-98e2-4de8-9729-4fdda0aa03e6-grafik.png
            You have to ensure the "localhost" is added to the listening interfaces in the DNS Resolver settings.

            AND to the VPN add a similar rule ABOVE of this one, but set the source to the VPN devices alias and the destination to 1.1.1.1 for Cloudflare (assumes, that Cloudflare allows access from the VPN provider) or better enter the DNS of the VPN provider.

            P 1 Reply Last reply Reply Quote 1
            • P
              panzerscope @viragomann
              last edited by panzerscope

              @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

              @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

              Ok, so I went back and added the rule you suggested on LAN tab regarding DNS as seen below.
              Look ok to you ?

              No, the protocol has to be "TCP/UDP" for DNS.
              And this assumes, that the devices really use pfSense.

              My suggestion is to combine this with two port forwarding rules. One for the devices, which should go over VPN. This avoid DNS leaking, as mentioned multiple times. And a second for the rest.

              This are port forwarding rule to redirect DNS and NTP to pfSense:
              bd976468-98e2-4de8-9729-4fdda0aa03e6-grafik.png
              You have to ensure the "localhost" is added to the listening interfaces in the DNS Resolver settings.

              AND to the VPN add a similar rule ABOVE of this one, but set the source to the VPN devices alias and the destination to 1.1.1.1 for Cloudflare (assumes, that Cloudflare allows access from the VPN provider) or better enter the DNS of the VPN provider.

              No problem, I can give that ago.

              Looking at the screenshot provided, how are you getting the Interface to show as "Internal" ? and how are you getting the Source Address to show as RFC1918, Did you setup an Alias ?

              Or do I just follow this article : https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html

              V 1 Reply Last reply Reply Quote 0
              • V
                viragomann @panzerscope
                last edited by viragomann

                @panzerscope
                "Internal" is an interface group, which includes my internal interfaces.

                RFC1918 is an alias for private network ranges (RFC 1918).

                So these rules are applied to all internal interface and only to private source IPs (no forwarded traffic).

                The RFC1918 alias is also good to use in policy routing rules. With this you can apply the rule to none-RFC1918 only ("invert. match" checked).
                So the rule is not applied to traffic for local destinations.

                Or do I just follow this article : https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html

                Yes, I know this suggestion. It does pretty the same, except DNS request to the pfSense LAN address are not forwarded to localhost. But I don't see an advantage of this.

                P 1 Reply Last reply Reply Quote 1
                • P
                  panzerscope @viragomann
                  last edited by

                  @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                  @panzerscope
                  "Internal" is an interface group, which includes my internal interfaces.

                  RFC1918 is an alias for private network ranges (RFC 1918).

                  So these rules are applied to all internal interface and only to private source IPs (no forwarded traffic).

                  The RFC1918 alias is also good to use in policy routing rules. With this you can apply the rule to none-RFC1918 only ("invert. match" checked).
                  So the rule is not applied to traffic for local destinations.

                  Thanks.

                  So to make sure I am setting this up, as I have not setup "Internal" group for my interfaces, can I just set the Source address to "LAN Address" ? I will setup an alias for RFC1918 but what IP's should this be covering ?

                  I did check this article : https://docs.netgate.com/pfsense/en/latest/recipes/rfc1918-egress.html

                  I cannot add these to an Alias as I get an error:

                  a4618550-999a-496f-923e-5ee98885d4e1-image.png

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    viragomann @panzerscope
                    last edited by

                    @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

                    So to make sure I am setting this up, as I have not setup "Internal" group for my interfaces, can I just set the Source address to "LAN Address"

                    "LAN subnets"!
                    However, this is the source, not the interface. Since you only have one interface, there no need for an interface group.

                    You have to select "networks" for the type in the alias.

                    6c4509fc-a330-47de-a84e-744a3beff027-grafik.png

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      panzerscope @viragomann
                      last edited by

                      @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                      @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

                      So to make sure I am setting this up, as I have not setup "Internal" group for my interfaces, can I just set the Source address to "LAN Address"

                      "LAN subnets"!
                      However, this is the source, not the interface. Since you only have one interface, there no need for an interface group.

                      You have to select "networks" for the type in the alias.

                      6c4509fc-a330-47de-a84e-744a3beff027-grafik.png

                      Awesome thanks.

                      I have created the RFC1918 Alias, my Port Forward rule for DNS now looks like :

                      42f81756-180c-4690-9231-fd877ce68ae5-image.png

                      Checking that is correct before I move ahead with NTP and then the rules for VPN.

                      I also ensured that the localhost is added to the listening interface for DNS:

                      ef75dc7b-4dce-4eed-9446-1d549913721a-image.png

                      V 1 Reply Last reply Reply Quote 0
                      • V
                        viragomann @panzerscope
                        last edited by

                        @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

                        Checking that is correct before I move ahead with NTP and then the rules for VPN.

                        Yes, looks well.
                        But you will need an additional rule for the VPN devices, as mentioned above.

                        I also ensured that the localhost is added to the listening interface for DNS:

                        Again, this setting is for pfSense only.

                        If you want to forward client requests to Cloudflare go to the DNS Resolver settings and check "DNS Query Forwarding".
                        If you do this with DoT also check the SSL/TLS option below:

                        5c0d8dc4-d6f8-440c-8cac-b82705e42330-grafik.png

                        P 1 Reply Last reply Reply Quote 1
                        • P
                          panzerscope @viragomann
                          last edited by

                          @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                          @panzerscope said in OpenVPN Not Connecting - Unable To Contact Daemon:

                          Checking that is correct before I move ahead with NTP and then the rules for VPN.

                          Yes, looks well.
                          But you will need an additional rule for the VPN devices, as mentioned above.

                          I also ensured that the localhost is added to the listening interface for DNS:

                          Again, this setting is for pfSense only.

                          If you want to forward client requests to Cloudflare go to the DNS Resolver settings and check "DNS Query Forwarding".
                          If you do this with DoT also check the SSL/TLS option below:

                          5c0d8dc4-d6f8-440c-8cac-b82705e42330-grafik.png

                          Many thanks for all your help.

                          So my rules are now as below:

                          d0570687-f2f9-4454-9a9c-e24771ffceb6-image.png

                          "Valak Server Apps" is the device I am wanting over the VPN as that contains my Plex server.

                          I would have chosen the PureVPN's DNS servers but they are being a pain about it at the moment, will switch that later.

                          V 1 Reply Last reply Reply Quote 0
                          • V
                            viragomann @panzerscope
                            last edited by

                            @panzerscope
                            Exactly this way.

                            I would have chosen the PureVPN's DNS servers but they are being a pain about it at the moment, will switch that later.

                            Ensure that DNS works on the concerned device.

                            P 1 Reply Last reply Reply Quote 1
                            • P
                              panzerscope @viragomann
                              last edited by

                              @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                              @panzerscope
                              Exactly this way.

                              I would have chosen the PureVPN's DNS servers but they are being a pain about it at the moment, will switch that later.

                              Ensure that DNS works on the concerned device.

                              Thanks.

                              I have checked, I can ping 1.1.1.1 from my VPN connected device (Valak Server Apps). I just wandered over to the Firewall>Rules>LAN Tab and noted the following DNS entry

                              8c42abe6-064d-4e64-94a2-dbc51fe040a9-image.png

                              I assume this is normal? I am fairly sure that has been there since day one, but cannot be confident.

                              I can also see the rules I just setup on Port forwarding are showing in the same area as well. I assume I do not need to set a specific Gateway for the rules ?

                              66ab1ba7-32bf-44fa-a4fb-bf8d6024d2af-image.png

                              Thanks again.

                              V 1 Reply Last reply Reply Quote 0
                              • V
                                viragomann @panzerscope
                                last edited by

                                @panzerscope
                                The first one might be manually added.
                                The red framed are from the NAT rules.
                                e0b173ea-f8ae-4ecd-bf17-1e716794f5ad-grafik.png

                                With your recent rule set they will never be applied, since the are other matching rule above of them.

                                You can also disable the filter rule association for these rules.

                                P 1 Reply Last reply Reply Quote 0
                                • P
                                  panzerscope @viragomann
                                  last edited by

                                  @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                                  @panzerscope
                                  The first one might be manually added.
                                  The red framed are from the NAT rules.
                                  e0b173ea-f8ae-4ecd-bf17-1e716794f5ad-grafik.png

                                  With your recent rule set they will never be applied, since the are other matching rule above of them.

                                  You can also disable the filter rule association for these rules.

                                  Many thanks.

                                  Where would I find the "Filter Rule Association" setting ?

                                  V 1 Reply Last reply Reply Quote 0
                                  • V
                                    viragomann @panzerscope
                                    last edited by

                                    @panzerscope
                                    In the NAT rule.
                                    If you have this selected pfSense adds a filter rule.
                                    If you select "pass" it lets the traffic pass without a filter rule.

                                    P 1 Reply Last reply Reply Quote 0
                                    • P
                                      panzerscope @viragomann
                                      last edited by

                                      @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                                      @panzerscope
                                      In the NAT rule.
                                      If you have this selected pfSense adds a filter rule.
                                      If you select "pass" it lets the traffic pass without a filter rule.

                                      Thanks.

                                      I may be oversimplifying my next question, but isn't it easer to just set the Filter to "Pass" ?

                                      V 1 Reply Last reply Reply Quote 0
                                      • V
                                        viragomann @panzerscope
                                        last edited by

                                        @panzerscope
                                        This depends on your needs. If you let pfSense create a rule you can verify it in your rule set.
                                        If you let it create an "unassociated" rule you can also edit it. For instance, turn it into a policy-routing.

                                        P 1 Reply Last reply Reply Quote 0
                                        • P
                                          panzerscope @viragomann
                                          last edited by

                                          @viragomann said in OpenVPN Not Connecting - Unable To Contact Daemon:

                                          @panzerscope
                                          This depends on your needs. If you let pfSense create a rule you can verify it in your rule set.
                                          If you let it create an "unassociated" rule you can also edit it. For instance, turn it into a policy-routing.

                                          Ok thanks, will leave it as it is.

                                          I note that since changing these rules with respect to DNS that my pfBlockerNG is seemingly no longer blocking ads. I have loaded up a few websites now and ads are now displaying. Worth noting that I have killed the VPN connection to make sure it was nothing to do with that.

                                          As we have used the RF1918 in recent DNS rules I am wondering if it is causing issues, I ask as when I go to pfBlockerNG configuration, that the IP and DNSBL use these private addresses for it to operate (as per below screenshots) and wondered if I have inadvertently done something.

                                          fb7d29d5-7e46-4621-bc43-52e2854e096d-image.png

                                          a6a09305-8897-4717-b3ee-849e1e1bb2ff-image.png

                                          Any thoughts ?

                                          V 1 Reply Last reply Reply Quote 0
                                          • V
                                            viragomann @panzerscope
                                            last edited by

                                            @panzerscope
                                            This might be due to DNSBL. Is the service even running? If not, try to restart it.

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