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

    Use hostname to reach OpenVPN clients

    Scheduled Pinned Locked Moved OpenVPN
    57 Posts 4 Posters 7.2k 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.
    • Z
      zapador @Unoptanio
      last edited by

      @Unoptanio As long as you have manually added Host Overrides then you'll never find out if "Register connected OpenVPN clients in the DNS Resolver" is working because the Host Overrides will take priority. If you list something in Host Overrides it will ALWAYS work in the sense that the DNS Resolver will return an IP for anything listed in the Host Overrides no matter if it exists or not.

      But is it otherwise working as it should?

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

        @zapador

        At the moment, with the current configuration, everything works for me.

        Before compiling this DNS override table, RDP access using the name.domain format did not work for me.
        7bba8c46-2a7d-442d-a7e8-eb1dddd2a651-image.png

        RDP access only worked using the machine's IP address


        RDP access using name.domain format should theoretically work even without having filled in the DNS resolver override table? yes o no?

        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 That's great!

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

            @zapador

            65cc4152-1a4d-4661-a369-9bf79af1f040-image.png

            e3f8e670-0915-4f3b-98f5-56d0e0ea2954-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 1
            • Z
              zapador @Unoptanio
              last edited by

              @Unoptanio Is what without using Host Overrides?

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

                @zapador
                it was only a question.

                Initially I thought that once connected to openvpn, the names of the machines that are on the 192.168.1.x network would automatically be visible without use dns override

                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 said in Use hostname to reach OpenVPN clients:

                  Initially I thought that once connected to openvpn, the names of the machines that are on the 192.168.1.x network would automatically be visible without use dns override

                  If you use "Register connected OpenVPN clients in the DNS Resolver" it should work without adding any Host Override. If not something is misconfigured or you're trying with an incorrect hostname, something along those lines.

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

                    @zapador

                    the host I need to reach using the name is in the remote office network which has ip 192.168.1.x.

                    From my home PC I connect to OPEN VPN and by checking as you said the name is correctly registered: usernameopenvpn.domain and the IP address returns 10.10.94.x

                    33881d04-4e7b-45ac-a40f-456c417c9e17-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 Ah alright. Not sure exactly why that is, seems a bit odd. Is this an acceptable solution though, manually creating the Host Override entries?

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

                        @zapador

                        could it be a bug in the pfsense 2.7.0 version?

                        For now I'll leave it alone that it works.

                        I'll tell you this last thing:
                        on the office network 192.168.1.x I have a machine called "Server5k".
                        If I go to pfsense--> diasgnostics--> DNS lookup it doesn't resolve the name
                        does not find any machine names on the 192.168.1.x network

                        9b1454c8-413f-4bb0-ab57-af1d22623013-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 There could be many reason for that. Is the Server5K connected directly to this pfSense? If so the pfSense should register the hostname via DHCP, or if there's a static DHCP lease. I really can't give you much info here without knowing the exact setup. But ask yourself - how would the pfSense know about the existence of this Server5K and have the pfSense had a good reason to register the hostname in DHCP?

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

                            @zapador
                            6deedac6-ed29-4c71-9266-36aae7e8dbdb-image.png

                            c21ee34a-407e-4a4e-9f6c-630e4a118c7b-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

                              I would add the pfSense IP in the list of DNS servers:
                              c73d296f-bc86-4d48-b2ed-6e95a4376889-image.png

                              You could just remove 8.8.8.8 and replace it with 192.168.1.1.

                              How does the Server5K get it's IP address? Is it static on the Server5K itself? Or a static lease in pfSense? Or just DHCP without Statis Lease?

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

                                @zapador

                                Server5k have static IP
                                cb68c810-ceb5-417c-90d6-7e23e5bef044-image.png

                                04f3387d-2f2f-44ba-9f57-df9df847e3b7-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 That explains why it isn't working. Set it to use DHCP on the server itself. Then on pfSense go to Services -> DHCP Server and at the bottom Add static mapping. Then fill everything out and make sure you get the MAC address right.

                                  You just have to fill out this:

                                  7b915893-f166-41fa-b0f2-7346ca1b6d3a-image.png

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

                                    @zapador

                                    Are you sure?
                                    But the server's ip address 192.168.1.250 is out of dhcp range

                                    The DHCP range is :
                                    b284d6b4-684a-4b8c-a24b-fe948ede1e03-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 That's exactly as it should be. The DHCP range is for devices where you don't care about what IP they get, so clients, not servers. You cannot make a static mapping that lies within the DHCP range, only outside of it.
                                      When you set the IP static on the server itself then it will never talk to the DHCP on the pfSense and that's why the pfSense doesn't really know that the server is even there. When you set a static mapping the server will talk to the DHCP server on pfSense and based on the MAC address of the server pfSense will assign it the correct IP address (outside of the DHCP range).

                                      You can try to assign the server an IP inside of the DHCP range, that will give you an error. It has to be outside of the DHCP range.

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

                                        @zapador
                                        01346604-4a66-4245-bd76-cc6e5c29e81e-image.png

                                        I'm going to dinner at my place, it's 8pm, I'll talk to you as soon as I make the changes. for now thanks

                                        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 UnoptanioU 2 Replies Last reply Reply Quote 0
                                        • Z
                                          zapador @Unoptanio
                                          last edited by

                                          @Unoptanio I would just leave them blank, assuming you have set some DNS servers in General Setup. Then you can read below the fields what happens by default. Or do as you've done here, adding the pfSense as the first option.

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

                                            @zapador

                                            259ae36d-70a7-4afa-b065-3cda1ae54d11-image.png

                                            d27bab50-4b07-4849-b1ee-2c9249e01927-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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.