====== Using the Microsoft DHCP server ====== The Microsoft DHCP server is the default DHCP server on Microsoft Windows. It can be configured to support iPXE. It cannot easily be used to support some of the more advanced iPXE options; if you have the choice then you may find it easier to use [[:howto:dhcpd|ISC dhcpd]]. The Microsoft DHCP server is configured using the DHCP MMC plug-in. Go to **Start** -> **Administrative Tools** -> **DHCP**: {{ :screenshots:msdhcp_start.png?404x359 |The Microsoft DHCP server}} Right-click on **Server Options** and choose **Configure Options**. You can instruct iPXE to boot using the **067 Bootfile Name** option. For example, to instruct iPXE to boot the demonstration image from ''%%http://boot.ipxe.org/demo/boot.php%%'', you can scroll down to option **067 Bootfile Name** and set it to ''%%http://boot.ipxe.org/demo/boot.php%%'': {{ :screenshots:msdhcp_set_filename.png?414x462 |Setting the boot filename}} To boot from a SAN, you must use the **017 Root Path** option instead of the **067 Bootfile Name** option: {{ :screenshots:msdhcp_set_root_path.png?414x462 |Setting the root-path}} ===== PXE chainloading ===== To use [[:howto:chainloading|PXE chainloading]], you need to set up the Microsoft DHCP server to hand out [[http://boot.ipxe.org/undionly.kpxe|undionly.kpxe]] to legacy PXE clients, and then hand out the "real" boot configuration only to iPXE clients. You can do this by telling the Microsoft DHCP server to use different configurations based on the DHCP user class. First, define a user class for iPXE. Right-click on your DHCP server and choose **Define User Classes**: {{ :screenshots:msdhcp_define_user_class.png?344x499 |Defining a DHCP User Class}} Click on **Add** to add a new user class. Set the **display name** to ''iPXE'', the **description** to ''iPXE clients'', and the **ID** to ''iPXE'': {{ :screenshots:msdhcp_define_ipxe_user_class.png?379x393 |Defining the iPXE DHCP User Class}} Right-click on **Server Options** and choose **Configure Options**. Scroll down to option **067 Bootfile Name** and set it to ''undionly.kpxe'': {{ :screenshots:msdhcp_set_chainload_filename.png?414x462 |Setting the chainloading boot filename}} Right-click on **Policies** and choose **New Policy**. Create a policy with a single condition that **User Class** is equal to **iPXE**: {{ :screenshots:msdhcp_policy_user_class.png?513x502 |Setting the policy condition}} In the **Configure settings for the policy** page, scroll down to option **067 Bootfile Name** and set it to ''%%http://my.web.server/real_boot_script.php%%'': {{ :screenshots:msdhcp_policy_filename.png?513x502 |Setting the policy filename}} If everything has worked, then you should see a policy which will set the **Boot Filename** to ''%%http://my.web.server/real_boot_script.php%%'' if the **User Class** is equal to ''iPXE'': {{ :screenshots:msdhcp_policy.png?513x502 |Completed iPXE policy}} This will ensure that the iPXE image (''undionly.kpxe'') is handed out only when the DHCP request comes from a legacy PXE client. Once iPXE has been loaded, the DHCP server will direct it to boot from ''%%http://my.web.server/real_boot_script.php%%''. (You should replace ''%%http://my.web.server/real_boot_script.php%%'' with whatever you want iPXE to boot from.) ===== Older Windows versions ===== If you are using Windows Server 2008, then you cannot create a policy as described above. Instead, right-click on **Server Options** and choose **Configure Options**. On the **Advanced** tab, select **iPXE** from the **User class** drop-down list. Scroll down to option **067 Bootfile Name** and set it to ''%%http://my.web.server/real_boot_script.php%%'': {{ :screenshots:msdhcp_set_ipxe_filename.png?404x448 |Setting the boot filename for iPXE clients}} If everything has worked, then you should see two settings for **067 Bootfile Name** in your DHCP configuration: one containing ''undionly.kpxe'' and one containing ''%%http://my.web.server/real_boot_script.php%%'': {{ :screenshots:msdhcp_chainloading.png?619x277 |A working chainloading DHCP configuration}} (You should replace ''%%http://my.web.server/real_boot_script.php%%'' with whatever you want iPXE to boot from.)