Setting up a netboot server is surprisingly easy, but I could not find comprehensive guides. What you really need:
- DHCP Server, from which your client receives an IP-Address and the Address to a tftp server
- TFTP Server, where a bootloader and one or more images are located
TFTP Server #
First install a tftp server package with support for xinet (usually included in plain xinet)
xinetd
is a daemon, which listens on specified ports and pipes the
traffic to a program one can specify in config. In this case we want
a tftp config file, where you can also specify a root path for your
tftp server:
# /etc/xinetd.d/tftp`
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /home/max/kolibrios/netboot/
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
Note: If you are using SELinux and want to use a directory in a users home directory (as in the example above), you will have to tell SELinux about it:
setsebool -P tftp_home_dir 1
DHCP Server #
The installation package is most likely called dhcp or dhcp-server or dhcpd. It will not be preinstalled in most cases.
The most important part in our dhcpd.conf
-file is the subnet part. It acts
like a filter and will only become active for interfaces, which are in its IP
range, starting with 192.168.178.0
in the following example:
# /etc/dhcp/dhcpd.conf
allow booting;
allow bootp;
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16; # RFC4578
subnet 192.168.178.0 netmask 255.255.255.0
{
option routers 192.168.178.1;
range 192.168.178.60 192.168.178.100;
next-server 192.168.178.26;
filename "pxelinux.0";
}
Open your firewall #
Do not forget to open the firewall ports for DHCP Server!
We need:
67/udp
,68/udp
for dhcpd69/udp
for the TFTP server
Now get something running… #
Put files from the syslinux project in your tftp-root-directy, namely:
-
/usr/share/syslinux/vesamenu.c32
-
/usr/share/syslinux/memdisk
-
KolibriOS can good be used for testing because it is so tiny.
-
a file called
pxelinux.cfg
is required for configuration, like so:# FTP-ROOT-PATH/pxelinux.cfg/default` UI vesamenu.c32 LABEL kolibri.iso LINUX memdisk INITRD kolibri.iso APPEND iso LABEL kolibri.img LINUX memdisk INITRD kolibri.img APPEND raw
-
Your network computer should now be able to start
Troubleshooting #
You can run qemu in order to test whether or not your tftp folder is correctly set up:
qemu-kvm -boot n -net user,tftp=/path/to/tftp,bootfile=/pxelinux.0