Chainloading iPXE from PXELINUX

I prefer PXELINUX’s menu system and config, though the TFTP installs can be slow because of using TFTP vs HTTP. We can get the best of both worlds by chainloading iPXE (which supports HTTP) from PXELINUX.

First, download the iPXE kernel to your tftproot
$ wget http://boot.ipxe.org/ipxe.lkrn

Next, place what will be the iPXE config file (or menu) on a local HTTP server

#!ipxe

# defaults
set boot-url http://192.168.88.82/tftproot
set menu-timeout 60000
set submenu-timeout ${menu-timeout}
isset ${menu-default} || set menu-default exit


:start
menu iPXE ${version} Boot Menu (ip ${net0/ip}, mac ${net0/mac})
item --gap -- ------------------------- Installers -------------------------------------
item centos7              Install CentOS 7 x86-64
item ubuntu1604           Install Ubuntu 16.04 LTS amd64 (Xenial Xerus)
item ubuntu1804           Install Ubuntu 18.04 LTS amd64 (Bionic Beaver)
item --gap -- ------------------------- Advanced Options -------------------------------
item shell                Drop to iPXE shell
item reboot               Reboot computer
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}

:cancel
echo You cancelled the menu, dropping you to a shell

:shell
echo Type 'exit' to get the back to the menu
shell
set menu-timeout 0
set submenu-timeout 0
goto start

:failed
echo Booting failed, dropping to shell
goto shell

:reboot
reboot

:exit
exit


:centos7
echo Starting CentOS 7 installer
set base-url ${boot-url}/pxelinux.cfg/installer/centos-7/repo
kernel ${base-url}/isolinux/vmlinuz ksdevice= inst.repo=${base-url}/
initrd ${base-url}/isolinux/initrd.img
boot || goto failed
goto start

:ubuntu1604
echo Starting Ubuntu 16.04 installer
set base-url ${boot-url}/pxelinux.cfg/installer/ubuntu-16.04/amd64 
kernel ${base-url}/linux vga=768
initrd ${base-url}/initrd.gz
boot || goto failed
goto start

:ubuntu1804
echo Starting Ubuntu 18.04 installer
set base-url ${boot-url}/pxelinux.cfg/installer/ubuntu-18.04/amd64
kernel ${base-url}/linux vga=768
initrd ${base-url}/initrd.gz
boot || goto failed
goto start

Finally, we configure a PXELINUX menu item for chainloading iPXE

LABEL -
MENU LABEL Load iPXE (for faster HTTP installs)
  KERNEL ipxe.lkrn
  APPEND dhcp && chain http://192.168.88.82/tftproot/ipxeboot.pxe