Netgate SG-1000 microFirewall

Author Topic: Additional BOOTP/DHCP Options: new option to be assign with respect to another  (Read 2425 times)

0 Members and 1 Guest are viewing this topic.

Offline simonbaev

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile

My setup needs 4 custom DHCP options 161,162,184,185 (to work with Wyse ThinOS driven terminals). One of them, i.e. 162 must be assigned with respect to the value of "option user-class" passed to DHCP server from DHCP client.

There is no way I can achieve settings like that using Web GUI. The only thing I can do is to assign option 162 a text value of "option user-class" which is incorrect as the latter will be treated _literally_  instead of by value.

By using Web GUI I can introduce above mentioned DHCP options and make the assignment to option 162 as described above. This will result in DHCP configuration file (stored in /var/dhcpd/etc/dhcpd.conf) containing:
Code: [Select]
option custom-lan-3 "option user-class";
instead of
Code: [Select]
option custom-lan-3 = option user-class;
where custom-lan-3 is declared in the same configuration file as
Code: [Select]
option custom-lan-3 code 162 = string;

The manual correction of /var/dhcpd/etc/dhcpd.conf and manual restart of the DHCP server SOLVES the problem but is really inconvenient because Web GUI overwrites the the correct modification by pfSence-logic-driven configuration which wipes off all benefits of manual corrections. I came up with a small shell script which must be invoked any time upon changing something in Web GUI:
Code: [Select]
kill -KILL `ps ax | grep $daemon | head -1 | cut -d" " -f1`
cat $conf | sed 's/option custom-lan-3 "option user-class";/option custom-lan-3 = option user-class;'/g > $temp
mv $temp $conf
$daemon -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf vmx3f2 vmx3f1

My question to pfSense developers: Would it be possible to address the issue by using Web GUI, for instance to have opportunity to set up value of any option (standard or custom) with respect to the value of some other DHCP option.