Skip to main content

Configuration DHCP / PXE

Enable UEFI boot with PXE

DHCP server :

DHCP server needs special option to enable PXE boot,

The DHCP options are :

  • Option 66

  • Option 67

Windows DHCP server configuration

First of all, the DHCP server needs to find out which type of computer is resquesting to assign PXE server and the right file to boot.

To sort computer vendor classes must be defined.

Vendor Classes

Vendor Classes as Detection Method is used to determine how devices are requesting a boot image from the DHCP server.

  • Open the DHCP Console and expand the IPv4 Node

  • Right-Click on ‘IPv4 Node’ and select ‘Define Vendor Classes’

  • Click ‘Add’

  • Create the UEFI 64-Bit Vendor class first by entering the following information

  • Enter the following information for the respective fields:

    • DisplayName: PXEClient (UEFI x64)

    • Description: PXEClient:Arch:00007

    • ASCII: PXEClient:Arch:00007

  • Click ‘OK’

  • Click ‘Add’

    • DisplayName: PXEClient (BIOS x86 & x64)

    • Description: PXEClient:Arch:00000

    • ASCII: PXEClient:Arch:00000

  • Click ‘OK’

Creating Custom DHCP Policies

BIOS 32-Bit & 64-Bit DHCP Policy
  • Right-Click ‘Policies’ and click ‘New Policy’

  • Give the policy a friendly name that coincides with the your vendor class naming scheme:

    • PolicyName: PXEClient (BIOS x86 & x64)

    • Description: Delivers the correct bootfile for BIOS machines

  • Click ‘Next’

  • On the ‘Configure Conditions for the policy’ page click ‘add’

  • Select the ‘Value’ drop-down box and select the PXEClient (BIOS x86 & x64) vendor class that you created in previous steps

  • Ensure that you check the box ‘Append wildcard(*)’

  • Select ‘Add’

  • Select ‘Ok’

  • Click ‘Next’

  • If you want the policy to affect only a specific range within your scope configure it, otherwise select no and click ‘next’

  • On the Configure settings for the policy page ensure that ‘DHCP Standard Options’ is selected from the drop down box

  • Configure the following scope options:

    • 066IP Address of Medulla

    • 067: bootloader/undionly.kpxe

  • Cick ‘Next’

  • On the Summary page click ‘Finish’

 
UEFI DHCP Policy
  • Right-Click ‘Policies’ and click ‘New Policy’

  • Give the policy a friendly name that coincides with the your vendor class naming scheme:

    • PolicyName: PXEClient (UEFI)

    • Description: Delivers the correct bootfile for (UEFI)

  • Click ‘Next’

  • On the ‘Configure Conditions for the policy’ page click ‘add’

  • Select the ‘Value’ drop-down box and select the PXEClient (UEFI) vendor class that you created in previous steps

  • Ensure that you check the box ‘Append wildcard(*)’

  • Select ‘Add’

  • Select ‘Ok’

  • Click ‘Next’

  • If you want the policy to affect only a specific range within your scope configure it, otherwise select no and click ‘next’

  • On the Configure settings for the policy page ensure that ‘DHCP Standard Options’ is selected from the drop down box

  • Configure the following scope options:

    • 066IP Address of Medulla

    • 067: bootloader-uefi64/ipxe.efi

    • Cick ‘Next’

  • On the Summary page click ‘Finish’

Remove Default PXE Options

Ensure that you have removed the 067, 066, 060 options from the default scope options to ensure that the Policies take precedence otherwise you will end up with conflict. As long as you have configured everything correctly you should now have the ability to boot machines from  BIOS or UEFI.

Linux DHCP Server
# PXE definitions
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 PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;
option arch code 93 = unsigned integer 16;
# In initial DHCP DISCOVER packet, PXE client sets option 93 to its arch.
# 0000 == IA x86 PC (BIOS boot)
# 0006 == x86 EFI boot
# 0007 == x64 EFI boot

# PXE boot following the PXE specs
class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
if option arch = 00:07 {
filename "bootloader-uefi64/ipxe.efi";
} else {
filename "/bootloader/undionly.kpxe";
}
}

# Etherboot boot
class "Etherboot" {
match if substring (option vendor-class-identifier, 0, 11) = "Etherboot-5";
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;
option vendor-class-identifier "Etherboot-5.0";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
}

subnet ##MEDULLA_NETWORK## netmask ##MEDULLA_NETMASK## {
option broadcast-address ##MEDULLA_BCAST##; # broadcast address
option domain-name ##MEDULLA_DOMAIN##; # domain name
option domain-name-servers ##MEDULLA_DNS##; # dns servers
option routers ##MEDULLA_GW##; # default gateway

pool { # Only defined pool

# uncomment the two following lines for PXE-only boot
#allow members of "PXE"; # PXE-only
#allow members of "Etherboot"; # PXE-only
range ##MEDULLA_START## ##MEDULLA_END##;
next-server ##MEDULLA_IP##;
}
}