<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I'm attempting to create a mechanism that sets option 67 <i class="">boot-file-name</i> to a URL w/ the client's hostname as a URL param. I found that I needed to use the flex_option hook to do this. The following code works partially:</div><div class=""><br class=""></div><div class=""><div class="">"hooks-libraries": [</div><div class=""> {</div><div class=""> "library": "/usr/lib64/kea/hooks/libdhcp_flex_option.so",</div><div class=""> "parameters": {</div><div class=""> "options": [</div><div class=""> {</div><div class=""> "code": 67,</div><div class=""> "name": "boot-file-name",</div><div class=""> "add": "ifelse( ( (substring(option[77].hex,0,4) == 'iPXE') and (option[host-name].exists) ), concat('<a href="http://x.x.x.x/ipxe.php?host=',option[host-name].text" class="">http://x.x.x.x/ipxe.php?host=',option[host-name].text</a>), '')"</div><div class=""> }</div><div class=""> ]</div><div class=""> }</div><div class=""> }</div><div class="">],</div><div class=""><br class="webkit-block-placeholder"></div><div class="">If the DHCP client matches option 77 user-class with the string "iPXE" && the DHCP client sends option 12 <i class="">host-name, </i>the URL is set w/ that client's hostname. I need the same code to work with fixed address host entries. So, if I have a host record created that reserves that client's IP address and Hostname via the Mac address, I need that declared hostname to be passed in the URL. I can't seen to find a way to do that. Again, if the client sends a value for option 12, it works (fixed host record or not), but if it doesn't send option 12 it does not. </div><div class=""><br class=""></div><div class="">When I use the host record - the server already knows the value for option 12 and returns it back to the client, and was thinking this SHOULD work. Anyone have any ideas? </div><div class=""><br class=""></div><div class="">Thanks</div></div><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><br class=""><b class="">DDI Guru<br class=""></b>Patrick Piper<br class=""><a href="http://ddiguru.com/" class="">http://ddiguru.com</a></div></div></div>
</div>
<br class=""></body></html>