1
General Discussion / [SOLVED] dhcp static mappings import using modified backup-file
« on: August 23, 2018, 09:34:58 am »
Hello,
i'm trying to import static DHCP entries into OPNsense since i have i.e. lots of printers in various subnets.
Since there seems to be no official way, nore did i found anything except for pfsense, itried to modify the related sections of a downloaded backup (.xml) and reimport that again.
I added entries for <ipaddr>, <mac>, <decr> and <hostname> in the xml-code, so it loooks identically to entries done by the GUI
Is the back.xml-file secured via checksum or can't be modified at all?
Did anyone tried to import static DHCP mappings or has a better guess how to do this?
Thank you for reading and any ideas.
i'm trying to import static DHCP entries into OPNsense since i have i.e. lots of printers in various subnets.
Since there seems to be no official way, nore did i found anything except for pfsense, itried to modify the related sections of a downloaded backup (.xml) and reimport that again.
I added entries for <ipaddr>, <mac>, <decr> and <hostname> in the xml-code, so it loooks identically to entries done by the GUI
Code: [Select]
<dhcpd>
<opt3>
<enable>1</enable>
<numberoptions/>
<range>
<from>192.168.110.50</from>
<to>192.168.110.55</to>
</range>
<staticmap>
<mac>00:25:90:cd:0d:98</mac>
<ipaddr>192.168.110.100</ipaddr>
<hostname>110-100</hostname>
<descr>Backup</descr>
</staticmap>
</opt3>
<opt7>
<enable>1</enable>
<numberoptions/>
<range>
<from>192.168.245.46</from>
<to>192.168.245.56</to>
</range>
<staticmap>
<mac>c8:5b:76:4f:ae:a0</mac>
<ipaddr>192.168.245.34</ipaddr>
<hostname>245-34</hostname>
<descr> laptop 28.11.2016</descr>
<mac>c8:5b:76:4f:a4:f3</mac>
<ipaddr>192.168.245.35</ipaddr>
<hostname>245-35</hostname>
<descr> laptop 28.11.2016</descr>
<mac>50:7B:9D:E4:7B:F0</mac>
<ipaddr>192.168.245.36</ipaddr>
<hostname>245-36</hostname>
<descr> laptop 20.12.2016</descr>
</staticmap>
</opt7>
When importing the XML-file i receive the following error in one line for all the added entires (existing mappings, done via the GUI remain and stay the same):Code: [Select]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /usr/local/www/services_dhcp.php on line 1121 / 1124 /1127 /1130.
Reviewing te code of services_dhcp.php doesn't help, i don't find an error on my site - did i miss anything here?Is the back.xml-file secured via checksum or can't be modified at all?
Did anyone tried to import static DHCP mappings or has a better guess how to do this?
Thank you for reading and any ideas.