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

    Import Static DHCP from dhcpd.conf

    Scheduled Pinned Locked Moved DHCP and DNS
    6 Posts 3 Posters 4.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.
    • P
      Pre100n
      last edited by

      Hi, I have a little problem with importing a list of hosts for static DHCP.
      I need to import a list of about 500 entries for static DHCP hosts, but the list of hosts in a dhcpd.conf from another system.
      I found the path to the file dhcpd.conf (/var/dhcpd/etc/dhcpd.conf), I replace this file I exported earlier, but after restarting the DHCP service all goes back to the old settings without a list of my hosts. Is it possible to somehow solve this problem?
      I do not want to add new entries for more than 500 computers.

      1 Reply Last reply Reply Quote 0
      • M
        Metu69salemi
        last edited by

        Try to find your config.xml and look if there is some dhcp entries.

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

          That's right, there are entries in config.xml, but it does not solve the problem. I feel that on the basis of config.xml pfSense builds dhcpd.conf file after restarting the service. What can I do to change that? Copy the dhcpd.conf file and chmod to read only, then export to XML? PF is a test virtual machine - you can suggest any solution, even deadly :)

          1 Reply Last reply Reply Quote 0
          • M
            Metu69salemi
            last edited by

            Download both config.xml's edit that one which your going to use to include those leases.
            upload back to pfsense and boot your box

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

              The problem is that I have a dhcpd.conf file, not xml :/ I can not do anything with it :/ Rewriting dhcpd.conf to config.xml is not an option - over 1500 lines to write :/.

              1 Reply Last reply Reply Quote 0
              • GruensFroeschliG
                GruensFroeschli
                last edited by

                Just write a small shellscript or some lines of C-code to convert it.
                The content is "basically" the same and it should not be that complicated to parse it.

                Actually i think there was already once a thread about this exact same thing and someone already wrote a parser.
                Have to see if the person posted it somewhere.

                Edit: found it:
                http://forum.pfsense.org/index.php/topic,25610.0.html

                We do what we must, because we can.

                Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

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