0

Over ISC-DHCP server I wanted to define a custom DHCP Option, for which I am using below config

option imagefile code 224 = ip-address;

subnet 192.168.29.0 netmask 255.255.255.0 {
 range 192.168.29.1 192.168.29.244;
 option imagefile 192.168.29.113;
}

I am able to restart DHCP server after above configuration.

However on client I am not able to grab this option. I am expecting to have this information in /var/db/dhclient.leases.em0

I am having a freebsd client.

I also tried to define below config in dhclinet (onclient side )

#option imagefile code 224 = ip-address ;
interface "em0" {
  option imagefile code 224 = ip-address;
  request imagefile;
}

However my service did not get start correctly .i.e.

Starting dhclient.
/etc/dhclient.conf line 12: expecting a statement.
  option 
  ^
/etc/dhclient.conf line 13: semicolon expected.
  request 
  ^
DHCPREQUEST on em0 to 255.255.255.255 port 67
DHCPACK from 192.168.29.113
bound to 192.168.29.234 -- renewal in 17669 seconds.

Kindly help with correct dhclient configuration or if I need to change something on isc-dhcp server to automatically get this custom option on client without defining any config on client

3
  • In server, try option option-224 "192.168.29.113"; (see dhcp-options) Mar 15, 2021 at 6:16
  • @VladimirBotka , I tried that on server however ISC-DHCP server did not restart complaining about syntax. for custom option definition on server I have followed this (kb.isc.org/docs/…) If i try same on dhcp client it also saying syntax errors. Mar 15, 2021 at 9:04
  • so in client if I try below in /etc/dhclient.conf request option-224; I get below value in lease file lease { interface "em0"; .... .... option dhcp-server-identifier 192.168.29.113; option option-224 "testing.com"; ..... .... } dhcp server config is like option url code 224 = string; subnet 192.168.29.0 netmask 255.255.255.0 { range 192.168.29.1 192.168.29.244; #option www-server 192.168.29.113; option url "testing.com"; } however yet its not getting on name. Mar 15, 2021 at 10:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.