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

    Additional BOOTP/DHCP Options: new option to be assign with respect to another

    Scheduled Pinned Locked Moved DHCP and DNS
    1 Posts 1 Posters 2.9k 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.
    • S
      simonbaev
      last edited by

      Hi,

      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:

      
      option custom-lan-3 "option user-class";
      
      

      instead of

      
      option custom-lan-3 = option user-class;
      
      

      where custom-lan-3 is declared in the same configuration file as

      
      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:

      
      #!/bin/sh
      daemon=/usr/local/sbin/dhcpd
      conf=/var/dhcpd/etc/dhcpd.conf
      temp=$$.conf
      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.

      –
      Simon

      –
      Simon

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