apt-get install dhcp3-server, edit /etc/default.dhcp3-server to use the right interface(s), and create a sensible /etc/dhcpd.conf with shared networks and subnets.
Then, in /etc/dhcpd.conf, in one of your subnets, create a group:
group lwp-gpxe
{
if exists user-class and option user-class = "gPXE"
{ # This is when gPXE is already loaded
filename "http://lwp22.service.rug.nl/boot/boot.php";
}
else
{ # This is the first step: the PXE bootROM loads the gPXE bootstrap
next-server 129.125.36.117;
filename "/tftpboot/undionly.kpxe";
}
# host example101 { hardware ethernet 00:11:22:33:44:55 ; fixed-address 192.168.5.101 ; } # Comment
} # end group lwp-gpxe
As you can see, this is a two-stage boot: the PXE bootstrap retrieves undionly.kpxe, which is a suitable version of gPXE.
Once gPXE is loaded, it does another DHCP request, and gets its configuration file from boot.php.
Uncomment the example01 line to add a host, and copy/modify to add more hosts.
Then sudo /etc/init.d/dhcp3-server restart and start rebooting clients.