Configure PXE Boot
Enable PXE & TFTP Server on your NAS. In this specific guide, I will be storing build media and PXE boot image on the NAS; and the DHCP server on the router (ASUS RT-AC5300). So the router will be forwarding PXE boot TFTP requests (port 69/UDP) to the NAS.
I have an Asus RT-AC5300 with Merlin. This adds additional features not available in the stock firmware (e.g PXE support). I want to keep the DHCP (and PXE) server enabled on my router, as my NAS is not on 24/7.
Credit to http://programmingflow.com/2015/04/08/boot-any-machine-in-your-home-with-pxe.html for information about how to direct TFTP requests in Merlin.
- Make sure you enable JFFS on your router.
- Login to your router with SSH
- Create file /jffs/configs/dnsmasq.conf.add and paste this
where 10.0.0.x is the LAN IP of a Synology NAS.
Note: ,, is not a mistake!
The first option specifies the bootfile to load. The second (blank) parameter is the hostname of the TFTP server, and the last parameter is the IP address of the TFTP server. Having the “.add” file extension in the dnsmasq .conf ensures that the config is appended to dnsmasq.conf and not overwriting it.
So now we have the Synology responding to TFTP requests, but we need to actually configure the TFTP server to do something. Simply download the zip and extract to the root of your TFTP server. Note the pxelinux.0 boot file that this already comes with.
Copy your ISO to <tftproot>/images
You’ll need to edit the pxelinux.cfg/default file which will contain the boot menu entries. File paths and filenames are case-sensitive!
Mine looks like this:
default menu.c32 prompt 0 timeout 100 ONTIMEOUT local PATH boot LABEL local MENU LABEL Boot local hard drive LOCALBOOT 0 LABEL chainlocal MENU LABEL Chain boot to local hard drive KERNEL chain.c32 APPEND hd0 LABEL Win10 MENU LABEL Install Win 10 x64 LINUX memdisk APPEND iso raw INITRD images/Win10x64.iso
- default menu.c32 sets the default menu style. “menu.c32” is the text-based style with a blue background. Alternative for this would be the graphical menu style “vesamenu.c32”. Since it takes several steps from here and I’m here on the essentials, I will not go into the graphical menu style here.
- Prompt 0 means that the focus is when loading the PXE boat screen on the first entry. (0 = 1st entry, 1 = 2nd entry … etc.)
- timeout 100 means that after 10.0 seconds, the user is automatically selected without the user’s interaction, which was stored with ONTIMEOUT . In this case “chainlocal”.
Now follow the individual menu items, whose order can be changed as desired. An entry is organized as follows:
- LABEL is simply the name of the entry in the configuration file itself. This must consist of one word (without spaces or special characters), is totally irrelevant and does not occur anywhere else and is only for orientation in the configuration file. All further points are LABEL’s subpages and are merely an optic (no must!)
- MENU LABEL The title of the entry in the PXE boot menu is defined here and can be selected freely.
- KERNEL This specifies the path to the (Linux) kernel used. The path is always from the above selected “TFTP root folder”. Later (with exceptions) all kernels are in “images / …”
- APPEND Here, certain parameters can be specified for the individual kernels. These differ from kernel to kernel. This line can be quite long for some images by specifying many parameters. We must take care not to interrupt this line by a line break!
- LOCALBOOT 0 is the entry, which should always be the first and simply boot the first local hard disk.
Now you’ll be able to PXE boot and the following PXE boot menu will appear: