PXE Boot server on CentOS

This post will be helpful for linux admins who frequently installs diff linux os. PXE boot is one of the best option to start linux installation & for rescue of the other failed systems. we are using CentOS as pxe boot server.
install syslinux & tftp-server

yum install tftp-server syslinux -y

enable syslinux at boot time.

vi /etc/xinetd.d/tftp
disable = no
server_args = -s -vvvv /tftpboot 
 
service xinetd restart
chkconfig xinetd on

Sample /etc/xinetd.d/tftp

service tftp
{
	socket_type		= dgram
	protocol		= udp
	wait			= yes
	user			= root
	server			= /usr/sbin/in.tftpd
	server_args		= -s -vvvv /tftpboot 
	disable			= no
	per_source		= 11
	cps			= 100 2
	flags			= IPv4
}

Copy needed files from syslinux to the tftpboot directory

cp /usr/share/syslinux/pxelinux.0 /tftpboot
cp /usr/share/syslinux/menu.c32 /tftpboot
cp /usr/share/syslinux/memdisk /tftpboot
cp /usr/share/syslinux/mboot.c32 /tftpboot
cp /usr/share/syslinux/chain.c32 /tftpboot

Create a base directory for images. Create directories for each CentOS release you are supporting.

mkdir -p /tftpboot/images/centos/i386/5.4
cp /tmp/dvd-centos-54/images/pxeboot/vmlinuz /tftpboot/images/centos/i386/5.4/
cp /tmp/dvd-centos-54/images/pxeboot/initrd.img /tftpboot/images/centos/i386/5.4/

Configure dhcp-server. Add this to your existing or new /etc/dhcpd.conf.

Note: xxx.xxx.xxx.xxx is the IP address of your PXE server

How to configure dhcp server on centos

allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server xxx.xxx.xxx.xxx;
filename "/pxelinux.0";
service dhcpd restart

Create the directory for your PXE menus

mkdir /tftpboot/pxelinux.cfg

Sample config file
vi /tftpboot/pxelinux.cfg/default

default menu.c32 
 
 
prompt 0
timeout 50
ONTIMEOUT localboot
 
MENU TITLE PXE Menu
 
LABEL localboot
MENU LABEL Boot From Hard Disk
LOCALBOOT  0
 
LABEL CentoS 5.4 i386 Installer
MENU LABEL CentOS 5.4 i386 Installer
KERNEL images/centos/i386/5.4/vmlinuz
append vga=normal initrd=images/centos/i386/5.4/initrd.img ramdisk_size=32768
 
LABEL CentoS 5.5 i386 Installer
MENU LABEL CentOS 5.5 i386 Installer
KERNEL images/centos/i386/5.5/vmlinuz
append vga=normal initrd=images/centos/i386/5.5/initrd.img ramdisk_size=32768

Refer

if you find any missing point in here, please let us know in comment section or tweet us at @linuxreaders. To get more articles like this, subscribe to our RSS feeds / Mails.

3 Comments

  • TechieNote » PXE Boot server on CentOS says:

    [...] lease, and start booting successfully from the network For troubleshooting check /var/log/messages Credits // Share| Leave a comment | [...]

  • PXE boot Ubuntu -10.04 | LinuxReaders says:

    [...] you are done setting-up PXE Server, you might need few OS booting from network / pxe for rescue [...]

  • Blackberry Speed Comparisons | www.avehot.com says:

    [...] PXE Boot server on CentOS | LinuxReaders [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trending Posts