Tuesday, April 24, 2012

STEP BY STEP PROCEDURE TO MAKE PXE BOOT SERVER IN REDHAT LINUX

Software requirement;
dhcp-3.0.5-21.el5
tftp-0.49-2
syslinux-3.11-4

Installing and enabling tftp service
#yum –y install tftp-server
#vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

#service xinetd restart
Installing and configuring syslinux
#yum install syslinux
#mkdir /tftpboot

Copying necessary files into /tftpboot
#cp /usr/lib/syslinux/pxelinux.0 /tftpboot
#cp /usr/lib/syslinux/menu.c32 /tftpboot
#cp /usr/lib/syslinux/memdisk /tftpboot
#cp /usr/lib/syslinux/mboot.c32 /tftpboot
#cp /usr/lib/syslinux/chain.c32 /tftpboot

#mkdir /tftpboot/pxelinux.cfg
#mkdir -p /tftpboot/centos/5_2_32
#mkdir -p /tftpboot/redhat/5_3_32
#mkdir -p /tftpboot/redhat/5_4_64

Copy vmlinz and initrd.img from Disc-1 to each of its respective directory
Installing and configuring dhcp
#yum install dhcp
#vim /etc/dhcpd.conf
ddns-update-style interim;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.235 192.168.0.241;
default-lease-time 3600;
max-lease-time 4800;
option routers 192.168.0.3;
option domain-name-servers 192.168.0.203;
option subnet-mask 255.255.255.0;
option domain-name “swadesh.bbsr”;
option time-offset -8;
}

allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server 192.168.0.212;
filename “/pxelinux.0″;

As per my setup, pxeserver ip address is 192.168.0.212
Restart DHCP Server
#service dhcpd restart

Configuring the MENU
This is the method by which one can do a PXE installation from a package and image archive served by a local web server, FTP server, or NFS server
As per my setup;
#vim /tftpboot/pxelinux.cfg/default
#/tftpboot/pxelinux.cfg/default:
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE Welcome to PXE Installation of Swadesh Sampad

LABEL Redhat 5.3/32
MENU LABEL RHEL V.5.3 32-Bit
KERNEL linux/5_3_32/vmlinuz
APPEND ks initrd=linux/5_3_32/initrd.img ramdisk_size=100000 ksdevice=eth1 ip=dhcp url –url http://192.168.0.200/rhel53_32/

LABEL Redhat 5.4/64
MENU LABEL RHEL V.5.4 64-Bit Kickstart
kernel linux/5_4_64/vmlinuz
append ksdevice=eth0
initrd=linux/5_4_64/initrd.img console=ttyS0,9600n8
ramdisk_size=100000
ks=http://192.168.0.212/rhel_64_ks.cfg

LABEL CentOS NO 5.2/32
MENU LABEL CentOS V.5.2 32-bit
KERNEL centos/5_2_32/vmlinuz
APPEND ks initrd=centos/5_2_32/initrd.img ramdisk_size=100000 ksdevice=eth1 ip=dhcp url –url http://192.168.0.200/centos/

LABEL Ubuntu/32
MENU LABEL Ubuntu 32-bit
KERNEL ubuntu/dapper/i386/linux
APPEND ks initrd=ubuntu/dapper/i386/initrd.gz ramdisk_size=100000 ksdevice=eth1 ip=dhcp url –url http://192.168.0.204/ubuntu/ root=/dev/rd/0 rw –

Now our PXE server is ready. We can go to client box and boot from pxemethod by pressing F12 bottom.

No comments: