Setup for ethernet boot on lan with iPXE
Shell ApacheConf
Fetching latest commit…
Cannot retrieve the latest commit at this time.


This is setup to use ethernet cards "boot on lan" feature with Debian netboot.
It is shamefully based on 
and advertised at

To set this up:

On the server (you have a home server, right? *plonk*), assuming your network is 192.168.1.?

Put this directory somewhere clever, like /srv/pxe for instance (yes, that's what I did; but you can put it in /opt/my/too/long/path/i/cannot/remember if you really really want).

(Note: if you are using a dpkg-based distribution, you can get this with apt-get instead of git. Read and get stalag13-utils-pxe)

Run the main script. It will build up ipxe-boot config files and (by default) download GNULinux kernels and initrd.
(It will run any additional that you may add in subdirectories. See the one in GNULinux as example)

You may add a symlink to this script inside /etc/cron.monthly so you keep stuff up-to-date.

Then, you must install a "Trivial FTP Daemon" on you local server which will, in the context of PXE (Preboot Execution Environment), serve these files you just got:
      apt-get install tftpd-hpa
      update-rc.d tftpd-hpa defaults
Edit /etc/default/tftpd-hpa, especially TFTP_DIRECTORY setting (you know, /opt/my/what/the/...).

We'll, instead of using the basic PXE stuff, use iPXE by chainloading it.
(We could apt-get ipxe but the current version in Debian does not support useful commands like menu or cpuid) We'll simply do:
       cd /srv/pxe

Finally, you must update your DHCP Daemon so it advertises we're running PXE (filename and next-server options). With ISC dhcpd, in /etc/dhcp/dhcpd.conf, for my subnet, I have now:
 subnet netmask {

	# iPXE
	if exists user-class and option user-class = "iPXE" {
	    filename "ipxe-boot";
	} else {
    	    filename "undionly.kpxe";

Obviously, you wont forget to do:
      invoke-rc.d isc-dhcp-server restart
      invoke-rc.d tftpd-hpa start

To use it:

On your client,

Go in the BIOS, look for "boot on lan" and whatever crap it may be called (it varies greatly), activate it. Then boot. It'll do some DHCP magic to find the path to the PXE and the menu should be printed on your screen at some point. 


You can decide to use http instead of tftpd for faster file transfer once
 iPXE is loaded (which means tfpd will still be necessary though), assuming you have an http server like nginx running.

With the default setup, you first need to add a symlink from /srv/pxe to /var/www/pxe 

Then, for instance, you can run 
    export PREFIX=http://URL/pxe/
before starting the script.

(you should also edit /etc/cron.monthly/pxe accordingly)