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

    Use hostname to reach OpenVPN clients

    OpenVPN
    4
    57
    7.0k
    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.
    • UnoptanioU
      Unoptanio @zapador
      last edited by

      @zapador

      All other machines that are under dhcp do not have their names resolved.
      Is there a cure for them too?

      pfSensePlus24.03 2U BareMetal Asrock Industrial IMB-X1314MicroATX
      CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
      n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

      Z 1 Reply Last reply Reply Quote 0
      • Z
        zapador @Unoptanio
        last edited by zapador

        @Unoptanio After enabling the option to Register DHCP leases in the DNS Resolver you must release/renew those machines or reboot them. The registration only happens when a machine request info from the DHCP. You can also just wait until their leases run out and they renew them automatically. It seems the leases are valid for 2 hours by default so it's not that long to just wait.

        1 Reply Last reply Reply Quote 1
        • UnoptanioU
          Unoptanio @Unoptanio
          last edited by Unoptanio

          @Unoptanio

          @zapador said in Use hostname to reach OpenVPN clients:

          leases are valid for 2 hours

          Default lease time
          Controls how long a lease will last when a client does not request a specific lease length. Specified in seconds, default value is 7200 seconds (2 hours)

          Maximum lease time
          Limits a requested lease length to a stated maximum amount of time. Specified in seconds, default value is 86400 seconds (1 day).
          https://docs.netgate.com/pfsense/en/latest/services/dhcp/ipv4.html

          pfSensePlus24.03 2U BareMetal Asrock Industrial IMB-X1314MicroATX
          CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
          n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

          Z 1 Reply Last reply Reply Quote 0
          • Z
            zapador @Unoptanio
            last edited by

            @Unoptanio Ah yeah so it could vary depending on the device, but depending on the number of devices it might be easier to just wait 24 hours for all of them to renew their lease.

            UnoptanioU 1 Reply Last reply Reply Quote 0
            • UnoptanioU
              Unoptanio @zapador
              last edited by

              @zapador

              I confirm, name resolution also works for clients under DHCP.

              Why did we say to insert the IP address 192.168.1.1 first in the DNS list?

              This thing had nothing to do with it

              thanks for the support
              145f07ce-6264-4e28-865a-0e8e98b6401e-image.png

              thanks for the support

              pfSensePlus24.03 2U BareMetal Asrock Industrial IMB-X1314MicroATX
              CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
              n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

              Z 1 Reply Last reply Reply Quote 0
              • Z
                zapador @Unoptanio
                last edited by zapador

                @Unoptanio I think just a bit of confusion, it's difficult for me to know your exact setup when I don't have it in front of me.

                What I would recommend is this:

                In General Setup put the DNS servers you want
                cb4e6cfe-28b9-4c43-84b4-969b322acfe1-image.png

                Under DHCP Server leave all DNS fields blank.

                Anywhere else only enter something in DNS fields if there's a good reason, otherwise leave them blank.

                So turn off this:
                51d1b23f-b117-4e0d-b0f2-36fcfb119673-image.png

                UnoptanioU 1 Reply Last reply Reply Quote 1
                • UnoptanioU
                  Unoptanio @zapador
                  last edited by

                  @zapador

                  Done.
                  Now I'm configured like this

                  d4763630-1462-4247-aea9-b770e4850016-image.png

                  pfSensePlus24.03 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                  CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                  n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                  Z 1 Reply Last reply Reply Quote 0
                  • Z
                    zapador @Unoptanio
                    last edited by

                    @Unoptanio Perfect, then everything should work as intended :)

                    You can just set all of the gateways to None, though it will work if you specify the gateway. Really no difference, but generally I would consider leaving things to default to be best practice unless there's a reason not to leave defaults. In this case None is default.

                    UnoptanioU 1 Reply Last reply Reply Quote 1
                    • UnoptanioU
                      Unoptanio @zapador
                      last edited by

                      @zapador

                      Good morning, excuse me , in the openvpn log section I find these IP addresses unknown to me that are trying something.

                      Do I have to worry?
                      What I can do?

                      78ec389e-7d4a-491a-aedc-ef6934257a32-image.png

                      pfSensePlus24.03 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                      CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                      n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                      Z 1 Reply Last reply Reply Quote 0
                      • Z
                        zapador @Unoptanio
                        last edited by zapador

                        @Unoptanio It means that someone is trying connect to your VPN server or otherwise trying to communicate with the port that OpenVPN is running at (default 1194). Because you have enabled TLS Auth in your OpenVPN Server settings the OpenVPN Server expects that the incoming packet contains HMAC which it does not and thus nothing more happens. So it's really nothing to worry about, it's just the security layers working as they should.
                        You can potentially reduce the amount of noise (random connection attempts) by running the OpenVPN Server on another port than default but there's not much reason to do so.

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