Transfer boot file base on client's MAC
|
2014-03-07, 08:51
Post: #1
|
|||
|
|||
Transfer boot file base on client's MAC
Hi there,
I see this script on the homepage: Code: if exists user-class and option user-class = "iPXE" { Can you show me how to make the script "real_boot_script.php" change the filename based on client's MAC ? For example, a client with MAC aa-bb-cc-dd-ee-ff requests the DHCP. I want DHCP to transfer the boot script aa-bb-cc-dd-ee-ff.php to it. If this file is not existed, the default.php will be chose. |
|||
2014-03-10, 10:58
Post: #2
|
|||
|
|||
RE: Transfer boot file base on client's MAC
This is how I do it with an iPXE script instead of having to declare it all in the DHCP server. https://gist.github.com/robinsmidsrod/2234639
Check boot.ipxe which optionally loads an override script for a specific machine (based on hostname, ip, uuid, mac or nic driver) and boot/testvm.ipxe which is a customization based on the hostname assigned to the machine. |
|||
2014-03-10, 15:01
Post: #3
|
|||
|
|||
RE: Transfer boot file base on client's MAC
(2014-03-07 08:51)vielktus Wrote: Can you show me how to make the script "real_boot_script.php" change the filename based on client's MAC ? You can include ${mac} within the DHCP filename, e.g.: Code: filename "http://my.web.server/boot.php?mac=${mac}"; Alternatively, you can use an iPXE script. This gives you the option to fall back to an alternative script if the one you want doesn't exist. For example: Code: #!ipxe (Note the use of the ":hexhyp" settings type to obtain the MAC address with hyphen separators rather than colons, since colons are generally not valid in filenames.) Michael |
|||
2014-03-23, 13:44
Post: #4
|
|||
|
|||
RE: Transfer boot file base on client's MAC
The "mac:hexhyp" and "github" saved my day.
Thank you so much mcb30 and robin. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)