Multiple Pxe boot on DHCP Server
-
We have PC and Mac were I am working and ever time we want to image a Mac we have to change the Pxe file I was wondering if there s any way to and both files on the dhcp server We are using a Linux box as our dhcp server
Thanks
Gary -
Since I don’t know about the Macs, please tell me what you need to switch to be able to PXE boot? Is it a legacy(bios)/uefi (undionly.kpxe/ipxe.efi) thing or something else?
-
I think Mac uses EFI/UEFI itself.
That said, to get Mac’s to PXE/Network boot, I think it needs to be blessed.
-
Instructions here for ISC-DHCP, because Windows DHCP is limited:
https://wiki.fogproject.org/wiki/index.php?title=FOG_on_a_MAC
-
@Tom-Elliott You can bless them, but it’s not necessary if you use the fancy ISC-DHCP setup, FOG iPXE will simply show up as a boot option.
-
@Tom-Elliott On the PC side I use undionly.kkpxe on legacy mode Have gotten it to work with eufi and Ipxe.efi On the mac side I am using boot.efi and it works fine the problem is that on the DHCP server line 67 I have to change the file from Undionly to boot.efi to boot fog up and for a PC I have to change it back am wondering if there is a way to have both files on the dhcp server and then choice either file when booting from a mac or pc without always having to change Hope this makes sense.
Thanks
Gary -
@Gary-Kulovics Can you place the Mac and PC and FOG server on the same subnet for a test?
What I want you to do is get a packet capture of the PC PXE booting in efi mode and the Mac PXE booting (with the correct efi files). Then post the pcap files here.
Where I’m going with this is that on some systems they will send the architecture type as part of the dhcp request. The ISC-DHCP can automatically switch between bios/legacy and uefi modes no problem. The idea would be for ISC-DHCP to switch between efi modes based on the booting system type.
Just for an idea of scope how many Mac and PCs do you have in your environment?
To capture what we need place the fog server and Mac on the same subnet and then…
- (note you may need to install tcpdump for your distro if it is not currently installed) Run this command: tcpdump -w macoutput.pcap port 67 or port 68
- PXE Boot the Mac
- When the Mac starts to boot, stop the tcpdump program
- Start the tcpdump command again with tcpdump -w pcefioutput.pcap port 67 or port 68
- PXE boot the uefi PC
- When the PC starts to boot, stop the tcpdump program
If you want to look at these pcap files with wireshark be my guest. What we are looking for is the initial dhcp request and response from your dhcp server. I want to see if the mac includes its hardware type in the dhcp request. If so then we should be able to work out an answer.
-
@Gary-Kulovics From what I read between the lines you are using an older version of FOG because the new version does generate a DHCP config file which serves the correct iPXE file according to the client’s architecture information send via it DHCP discover request. You can still configure this by hand if you like: https://wiki.fogproject.org/wiki/index.php?title=BIOS_and_UEFI_Co-Existence
@Quazz said:
if you use the fancy ISC-DHCP setup, FOG iPXE will simply show up as a boot option.
It has been some month since I worked with the netboot on Mac but as far as I remember you still need to press ALT key and select netboot or hold down the
n
key… -
@Sebastian-Roth What I read the OP has is actually this contidtion
PC (bois) = undionly.kkpxe
PC (uefi) = ipxe.efi
Mac (uefi) = boot.efiWe know that we can switch between ipxe.efi and unidonly.kpxe no problem. The link you provided is proof of that. What (I see) is an issue is the Mac uefi vs PC uefi boot. We have two different boot kernels based on who is actually requesting dhcp IP. From what I remember there are some bits to the right of the colon in the arch defintion and or the GUID key could be used to select between the efi files. The OP really has a complex dhcp request, beyond telling the Mac to pxe boot.
Depending on the scope of Mac vs PCs the OP could usb boot the Macs with GRUB into the iPXE menu and then not need to switch between the boot files.
-
Here’s an example ISC-DHCP configuration that might work for bios, pc efi, and mac efi. I just copy / pasted from the BIOS and UEFI co-existence article and FOG on a MAC article, but I changed the Mac’s boot file to
boot.efi
.We have some newer macs at work, one site which needs to still image macs.
I’ll try this configuration out there when I can, it’d be nice to throw Deploy Studio and be 100% fog for all imaging needs. Feel free to go ahead and try though, but I have to back burner this until there is time.
option space PXE; option PXE.mtftp-ip code 1 = ip-address; option PXE.mtftp-cport code 2 = unsigned integer 16; option PXE.mtftp-sport code 3 = unsigned integer 16; option PXE.mtftp-tmout code 4 = unsigned integer 8; option PXE.mtftp-delay code 5 = unsigned integer 8; option arch code 93 = unsigned integer 16; # RFC4578 use-host-decl-names on; ddns-update-style interim; ignore client-updates; next-server 10.0.0.3; authoritative; subnet 10.0.0.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; range dynamic-bootp 10.0.0.20 10.0.0.254; default-lease-time 21600; max-lease-time 43200; option domain-name-servers 10.0.0.1; option routers 10.0.0.1; class "UEFI-32-1" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00006"; filename "i386-efi/ipxe.efi"; } class "UEFI-32-2" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00002"; filename "i386-efi/ipxe.efi"; } class "UEFI-64-1" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007"; filename "ipxe.efi"; } class "UEFI-64-2" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00008"; filename "ipxe.efi"; } class "UEFI-64-3" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00009"; filename "ipxe.efi"; } class "Legacy" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000"; filename "undionly.kkpxe"; } class "Apple-Intel-Netboot" { match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386"; option dhcp-parameter-request-list 1,3,17,43,60; if (option dhcp-message-type = 8) { option vendor-class-identifier "AAPLBSDPC"; if (substring(option vendor-encapsulated-options, 0, 3) = 01:01:01) { # BSDP List option vendor-encapsulated-options 01:01:01:04:02:80:00:07:04:81:00:05:2a:09:0D:81:00:05:2a:08:69:50:58:45:2d:46:4f:47; } elsif (substring(option vendor-encapsulated-options, 0, 3) = 01:01:02) { # BSDP Select option vendor-encapsulated-options 01:01:02:08:04:81:00:05:2a:82:0a:4e:65:74:42:6f:6f:74:30:30:31; filename "boot.efi"; } } } }
-
I always booted our Mac Minis with
ipxe.efi
. Just try different ones and see which one is working for you…