PXE server helps to install the operating systems through network boot. Its very useful and very time saving.
This post tells how to configure a PXE Server in Redhat linux and other variants.
###PXE Configuration###
dhcp + tftp + syslinux
###Install the packages###
#yum -y install dhcp*
#yum -y install tftp*
#yum -y install syslinux*
###Open the dhcp configuration file and add the following###
#vi /etc/dhcpd.conf
subnet 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1
range From 192.168.1.128 To 192.168.1.254
allow booting;
allow bootp;
next-server 192.168.1.3;
filename "pxelinux.0";
:wq
###Copy the pxlinux.0 file to /tftpboot###
#cd /tftpboot
#cp /usr/lib/syslinux/pxelinux.0 .
###Copy the kernel and initrd.img files from DVD[/media/images/pxeboot/] to /tftpboot/###
#cp -rv /media/images/pxeboot/initrd.img .
#cp -rv /media/images/pxeboot/vmlinuz .
###Add kickstart file to /tftpboot/###
#vi ks.cfg Only if wanted. Otherwise you have to do attended remote installation.
nfs --server 192.168.1.2 --dir /media/rhel5 Just an example line!
###Create PXE configuration directory###
#mkdir /tftpboot/pxelinux.cfg/
#cd /tftpboot/pxelinux.cfg/
###Create PXE configuration file### That is ###/tftpboot/pxelinux.cfg/default file###
#vi default
PROMPT 1 To give the prompt [boot: ]. Otherwise it will automatically install the default label
DISPLAY boot.msg It shows the 1st window for options.
TIMEOUT 100 Wait for the choice this much time and after that will continue with deafult.
DEFAULT main Defines the main installation method. The default one.
ONERROR LOCALBOOT 0 Asking me? Google it :P
LABEL main The declaration of main label. In case if we didint give choice, this will execute.
KERNEL vmlinuz If in /tftpboot/ directory. If it is in /tftpboot/RHEL5-NFS u've to give RHEL5-NFS/vmlinuz
APPEND initrd=initrd.img Path of initrd.img.
LABEL 1
KERNEL Kernel location of choice 1 in boot.msg
APPEND Location of initrd.img
An Example
kernel RHEL5-NFS/vmlinuz
append initrd=RHEL5-NFS/initrd.img ramdisk_size=6457 method=nfs:192.168.1.2:/media/rhel5 ip=dhcp
LABEL 2
settings for option 2.
:wq
###Creating options message for the PXE boot###
#cd /tftpboot/
#vi boot.msg
##########################
Installing RHEL5 You can design this as you like.
##########################
1. RHEL5 NFS
2. RHEL5 FTP Set all these according to the entries in /tftpboot/pxelinux.cfg/default
3. RHEL5 HTTP
4. RHEL5 RESCUE
##########################
NOTE: Give execute permission for all files in /tftpboot/
###Restart the services###
#service dhcpd start
#service xinetd start
#chkconfig tftp on