Import Static DHCP from dhcpd.conf
-
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. -
Try to find your config.xml and look if there is some dhcp entries.
-
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 :)
-
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 -
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 :/.
-
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