-1

I am running a DHCP server in CentOS 6.5 and in my network, 3 clients can issue an DHCP request. The host needs to send the address of the tftp server and also the name of a config file. The order in which the 3 clients can send a request is a don't care. They can come in any order, and the server will need to send ip1 in the range provided, tftp server ip address and file1 for request1, file 2 for request2 and file3 for request 3. So it needs to provide an unique file for each of the request. Again the order of the request is a don't care as long as each client has a unique file. I don't know the mac-address of the clients and I can't add a host specific configuration in the dhcpd.conf. Is there any way I can add this to dhcpd.conf file?

Thanks

1 Answers1

0

You should be able to configure dhcpd to answer with a filename containing the MAC address of the device:

filename = concat(suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 1, 1))),2),
                  suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 2, 1))),2),
                  suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 3, 1))),2),
                  suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 4, 1))),2),
                  suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 5, 1))),2),
                  suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 6, 1))),2));

So this means if 00:11:22:33:44:55 issues a DHCP request, it will receive an answer with filename 001122334455. See dhcp-eval(5) for more information.

Oliver
  • 5,973
  • 24
  • 33