5

I've been using WDS for a while, and now we want to move to iPXE and chain into WDS, but due to some DHCP issues (we are not the owners and cannot configure it) I'm unable to configure the DHCP options for two boot files.

I know that WDS can somehow detect if a booting machine is UEFI or Legacy bios, but how does it do that?

If I can somehow use only that feature on a linux machine or a windows server that would be great, I just can't find any documentation online about it.

Alex Zel
  • 182
  • 2
  • 12

2 Answers2

2
  1. If you have no access to the DHCP infrastructure you can set a proxyDHCP server. In a DHCP + proxyDHCP scenario the DHCP server only provides IP/MASK etc while the proxyDHCP server provides the PXE specific parameters on a complementary DHCP transaction.

    1 IP address 2 Network mask 3 Additional DHCP options (if any) 4 IP address of the TFTP server that hosts the bootstrap loader 5 Boostrap loader File Name

DHCP + proxyDHCP vs PXE DHCP

DHCP + proxyDHCP vs PXE DHCP (Pic from Serva)

  1. The client announces its architecture on boot as a part of the DHCP transaction. The first packet broadcasted by the client is a DHCPDISCOVERY including the DHCP option 93 specified by RFC 4578

         Type   Architecture Name
         ----   -----------------
           0    Intel x86PC              (BIOS pre-OS environment)
           1    NEC/PC98
           2    EFI Itanium
           3    DEC Alpha
           4    Arc x86
           5    Intel Lean Client
           6    EFI IA32                 (UEFI 32 pre-OS environment)
           7    EFI BC                   (UEFI 64 pre-OS environment)
           8    EFI Xscale
           9    EFI x86-64               (UEFI 64 pre-OS environment)
    
Pat
  • 3,020
  • 17
  • 25
  • How can i setup a proxy DHCP server without interfering with the actual server? I'm guessing using dnsmasq right? – Alex Zel Nov 15 '15 at 05:52
  • exactly with dnsmasq or with Serva you can implement a proxyDHCP scenario. See the answer edit for a pic showing how a proxyDHCP works – Pat Nov 15 '15 at 14:20
  • Great thanks, will try it out tomorrow at work, hope I don't brake the main DHCP server somehow. – Alex Zel Nov 15 '15 at 17:11
  • a proxyDHCP strategy is not intrusive; you will not break anything of the already in place DHCP infrastructure but remember there should be only one server providing PXE information and that one should be the prooxyDHCP – Pat Nov 15 '15 at 18:27
  • OK, I will however test this in a closed environment first, set up a regular DHCP server ( our company uses Microsoft server) and a Centos proxy DHCP, since it's a huge company I want to be 100% sure it works. – Alex Zel Nov 16 '15 at 05:46
  • You can rest assured it does work. – Pat Nov 16 '15 at 11:45
  • well I tried it, and it doesn't seem to hand out the boot information. I used server 2012 as the main DHCP, and a Centos 7 server with dnsmasq only for boot information, and it doesn't work, if I use the same configuration in dnsmasq and make it hand out IP addresses as well it does work, but not as a proxy dhcp. – Alex Zel Nov 16 '15 at 13:17
  • Please run a wireshark capture and see what's going on. If you boot a PXE client after broadcasting a DHCPDISCOVER it should receive 2 DHCPOFFERs; one coming from the DHCP server and the second one coming from the proxyDHCP. From the first offer the client will DHCPREQUEST the offered IP/MASK then next it will DHCPREQUEST the PXE parameters to the proxyDHCP. Remember a proxyDHCP only answers requests coming from "PXE" clients never from regular DHCP clients – Pat Nov 16 '15 at 13:30
  • OK I'll try that tomorrow, gotta love wireshark. – Alex Zel Nov 16 '15 at 15:05
  • OK so I got it working, partially, for legacy/bios boot everything works fine, I can see in wireshark two DHCP offers from the main and proxy DHCP servers, and I can boot to a desired file. However, if i try to boot in EFI mode, looking at wireshark i can see a DHCP request, two offers, and to acknowledgment, and then again, it just loops like that for a minute and then goes to the bios (in the client). – Alex Zel Nov 17 '15 at 12:46
  • Depending on the option 93 of the DHCPDISCORY packet the proxyDHCP must provide the corresponding NBP i.e. for BIOS you can define pxelinux.0 as the NBP but for EFI64 you MUST define i.e. the 64 bit version of pxelinux.efi or bootmgfw.efi, etc. If you boot EFI and you provide a BIOS NBP then the client will surely reboot. – Pat Nov 17 '15 at 14:02
  • That's not the issue, idefined two different files for bios and EFI, from what i read online, dnsmasq doesn't work well with EFI in proxy mode. I was able to configure a boot-file and server in the main DHCP for efi, and use the proxy to hand out legacy information, this works, but now I can't chain to WDS from the iPXE menu in EFI (in legacy it works). – Alex Zel Nov 17 '15 at 14:38
  • open a new question for this issue; SU is complaining for this long conversation – Pat Nov 17 '15 at 15:01
-1

When the PXE (or whatever it’s called with UEFI) client requests a DHCP lease, it provides various details (“options”) about itself, including the “Client System Architecture Type”, (option 93).

I’ve encountered the following values:

  • 7 for UEFI
  • 2 for x86

Since DHCP always uses broadcast when sending requests, you can easily discover the values you need using a packet sniffer like Wireshark.

Daniel B
  • 60,360
  • 9
  • 122
  • 163