iPXE discussion forum
DHCP option 203 - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: DHCP option 203 (/showthread.php?tid=6027)



DHCP option 203 - digitalis99 - 2012-10-09 17:06

So, I need to base the IQN of my iPXE-booted initiators off of MAC addresses rather than uuid. I have multiple, identical hardware platforms, so the identical uuid is throwing off my iSCSI target software. I'm running dnsmasq on my network, and already have all the hardware mounting the iSCSI target and booting from it normally. I added the following to my dnsmasq.conf file:

dhcp-option=203,"iqn.2010-04.org.ipxe:${mac:hexhyp}"

This sort of works, as every iPXE booted machine uses that exact string for the IQN. Is there any way to use the variable like you would in a script via DHCP instead? I'm not using a script at all, and I'd like every needed option to come from DHCP.


RE: DHCP option 203 - mcb30 - 2012-10-10 02:02

(2012-10-09 17:06)digitalis99 Wrote:  So, I need to base the IQN of my iPXE-booted initiators off of MAC addresses rather than uuid. I have multiple, identical hardware platforms, so the identical uuid is throwing off my iSCSI target software. I'm running dnsmasq on my network, and already have all the hardware mounting the iSCSI target and booting from it normally. I added the following to my dnsmasq.conf file:

dhcp-option=203,"iqn.2010-04.org.ipxe:${mac:hexhyp}"

This sort of works, as every iPXE booted machine uses that exact string for the IQN. Is there any way to use the variable like you would in a script via DHCP instead? I'm not using a script at all, and I'd like every needed option to come from DHCP.

You'll need to use a script to get that behaviour. Use something like:

Code:
#!ipxe

set initiator-iqn iqn.2010-04.org.ipxe:${mac:hexhyp}
sanboot ${root-path}

Michael


RE: DHCP option 203 - digitalis99 - 2012-10-10 16:03

Thanks. I figured out how to do it by script, I was just hoping to not have to hit the TFTP server a second time, since I'm chainloading iPXE. If script is the only method, then script it is.


RE: DHCP option 203 - mcb30 - 2012-10-10 16:10

(2012-10-10 16:03)digitalis99 Wrote:  Thanks. I figured out how to do it by script, I was just hoping to not have to hit the TFTP server a second time, since I'm chainloading iPXE. If script is the only method, then script it is.

You can embed the script within the iPXE binary: http://ipxe.org/embed

Michael