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

    Suggestions for a long list of DHCP Static Mappings

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 2 Posters 494 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
      preese
      last edited by

      When I first stated using PFS, I had a modest number of hosts in the Mappings file. But as time went on and projects have come and gone, but might come back, the file is now nearly 150 names long.

      I know about exporting the list, modify the json and reload trick and that works well for big changes.

      Does anyone have a suggestion to better handle the day to day changes and updates? Having to first scroll through DHCP Server lines for the LAN in order to get the the long list of DHCP Static lines is getting tedious. Has some one come up with a short cut?

      johnpozJ 1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator @preese
        last edited by

        @preese to add a new entry sure you can just go to your url directly for the interface your wanting to edit

        https://sg4860.home.arpa:8443/services_dhcp_edit.php?if=opt9

        Where that if=opt9 in my case is my dmz network, so you could edit a bookmark to reflect the interface..

        To go directly to add a new entry for my lan, I would go here

        https://sg4860.home.arpa:8443/services_dhcp_edit.php?if=lan

        see how if=lan for your lan

        Now editing a specific old entry you could just jump directly there with something like this

        https://sg4860.home.arpa:8443/services_dhcp_edit.php?if=opt8&id=8

        but problem is - the idX would be the order that the entries were added.. So kind of hard to know exactly, but you could create shortcuts to the ones you update a reg basis, etc. And naming the bookmark something more identifiable for yourself.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • P
          preese
          last edited by

          Thanks Johnpoz for your reply. The suggestions do work and you've outlined the limitations

          After asking the question and seeing your answer, I thought of a clearer, more straight forward question.

          The DHCP static entry has three basic components, IP, MAC and name, and there is a comment field. Most often I have at least one of these but need to know the others. The 'host' command plays well to get two of the three. Does anyone know of a similar way to get the MAC addr quickly? Something specific to PFS?

          Usually I'm setting up a set of VMs and need to prepopulate the MAC address so the VM gets a specific address and linked name when it is created. I was just hoping for an easier way to juggle those three important bits.

          johnpozJ 1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator @preese
            last edited by johnpoz

            @preese said in Suggestions for a long list of DHCP Static Mappings:

            similar way to get the MAC addr quickly?

            Of what, do you know the IP or fqdn, you can just query the arp table

            something like

            [23.09.1-RELEASE][admin@sg4860.home.arpa]/root: arp -a | grep nas.home.arpa
            nas.home.arpa (192.168.9.10) at 00:11:32:7b:29:7d on igb0 permanent [ethernet]
            [23.09.1-RELEASE][admin@sg4860.home.arpa]/root: 
            
            

            Or you mean in your vm.. until the device has been online pfsense would not know the mac.. You can look in your vm software for what mac a device is going to use before it even boots.

            mac.jpg

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • P
              preese
              last edited by

              Ah that looks promising Johnpoz! I use Vagrant and/or Cockpit to build projects. I take an existing IP/MAC entry and use that MAC as I edit the Vagrantfile or confi the VM so I know what IP and name it will have.

              I'm not sure how fast the arp table turns over but I sure will give it a try! Thanks for the follow up!

              johnpozJ 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator @preese
                last edited by

                @preese pfsense out of the box will cache an arp entry for 20 minutes.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                1 Reply Last reply Reply Quote 0
                • P
                  preese
                  last edited by

                  Hmm, that might be a little too quick. I often retest projects after a week or more. Still, you've made two helpful suggestions. I'm a little surprised others haven't experienced similar issues and frustrations. But since everything does work, a little extra scrolling is really just a first world problem.

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