Actually I want to dinamically assign bootfile-name based on clients MAC.
I have tried this config:
option bootfile-name concat( binary-to-ascii(16, 8, "", substring (hardware, 1, 6)), ".cfg");
But this is wrong config (as dhcp server isn't starting at all). If instead of concat(...) I put just real filename (e.g. "000102030405.cfg") everything is ok. But this is not what I need. Is there any way to dynamically set bootfile-name?
Well, good news. I found an answer by myself. The answer itself was in man pages. All you need is to use EXPRESSIONS. This is correct for any option (not only bootfile-name), to which you want assign a value from client's request.
From the
man dhcp-options
:So, as you can see, the only difference between this code and mine is equal sign!
For curious one, the answer to my question is:
Did you noticed "="?
110022334455 becomes 11022334455 in the ASCII output
see also: https://kb.isc.org/article/AA-01039/0/Formatting-MAC-addresses-in-dhcpd-or-why-does-binary-to-ascii-strip-leading-zeroes.html