[by Nugraha, 2009.05.08]
We want to make a diskless computing system so that we need a PXE Server. PXE stands for "Pre-boot eXecution Environment". PXE is a special extension of services provided by the Dynamic Host Configuration Protocol (DHCP). It uses a Trivial File Transfer Protocol (TFTP) server to provide minimal boot to a network client. Let's try to configure it!
What we need†
- A computer with linux operating system to be configured as a server. Here we use Fedora Linux. This computer should have at least two network interface cards (NIC). One of the cards will be used to connect the server with client.
- Computer that acts as a client. For a checking purpose we need this computer to have SSH facility (it does not matter to use Windows or Linux).
- Network hub and cables.
Checking†
Network setting†
- Turn on the hub, connect a network cable from Fedora Linux computer (server) to the hub (e.g. to channel 1).
- Connect again a network cable from the client computer (Windows/Linux) to the hub (e.g. to channel 2).
- Open Network configuration on Fedora Linux using root privilege. We should set network interface card that has been connected to the hub.
- Assuming the network card is eth1, we set it to have:
- IP Address: 192.168.1.1
- Subnet Mask: 255.255.255.0
- On the client computer, set the IP Address statically to be:
- IP Address: 192.168.1.2
- Subnet Mask: 255.255.255.0
SSH check†
- Open SSH software on client computer, for example, Putty or any command line software:
ssh username@192.168.1.1
- If username is "nugraha" and hostname of server is "rsaito-necPC", we must get the following line after succesfully login:
nugraha@rsaito-necPC:~$
it means that we can access the server from the client.
DHCP and TFTP Server†
DHCP Configuration†
- Edit /etc/dhcpd.conf. The following is a configuration for a network that uses:
- 192.168.1.0/24 addressing
- Dynamic address will be provided between 192.168.1.100 and 192.168.1.240
- DHCP/PXE server at IP address 192.168.1.1
allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
range dynamic-bootp 192.168.1.100 192.168.1.240;
next-server 192.168.1.1;
}
- Turn on dhcp and xinetd
# /sbin/service dhcpd start
# /sbin/service xinetd start
# chkconfig dhcpd on
(the last line is for activating dhcp on booting process)
- Check if the dhcp server can work. Open a client computer which is connected to server and set the TCP/IP to dynamically set for IP address. Then try again:
ssh username@192.168.1.1
If we can connect, it means DHCP has successfully been configured.
TFTP Configuration†
- System boot will be put on /tftpboot and we need to copy the PXE boot image too.
su -
cd /tftpboot
cp /usr/lib/syslinux/pxelinux.0 .
- Create a minimal /tftpboot/pxelinux.cfg file
DEFAULT pxeboot
TIMEOUT 50
LABEL pxeboot
KERNEL vmlinuz
APPEND initrd=initrd.img
ONERROR LOCALBOOT 0
- Turn on the tftp service:
# /sbin/chkconfig tftp on
Copy system data for booting†
# yum install busybox-anaconda
# mkdir /tftpboot/f9
# mkdir /tftpboot/f9/root
# mkdir /tftpboot/f9/snapshot
# rsync -v -a -e ssh \
--exclude='/proc/*' --exclude='/sys/*' --exclude='/dev/*'\
--exclude='/media/*' --exclude='/tmp/*' --exclude='/misc/*'\
172.17.4.178:/ /tftpboot/f9/root