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

  • In server, try `option option-224 "192.168.29.113";` (see [dhcp-options](https://www.freebsd.org/cgi/man.cgi?query=dhcp-options&sektion=5&manpath=freebsd-release-ports)) – Vladimir Botka Mar 15 '21 at 06: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 (https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcp-options#DEFINING%20NEW%20OPTIONS) If i try same on dhcp client it also saying syntax errors. – Ruchir Bharadwaj Mar 15 '21 at 09: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 "http://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 "http://testing.com"; } however yet its not getting on name. – Ruchir Bharadwaj Mar 15 '21 at 10:09

0 Answers0