PXE Installation - How to configure PXE

Moderators: alok, Linux Moderators

PXE Installation - How to configure PXE

Postby sunil datta on Wed Jan 13, 2010 5:12 am

Introduction
Red Hat Enterprise Linux supports network installation using the NFS, FTP, or HTTP protocols. A network installation can be started from a boot CD-ROM or Red Hat Enterprise Linux CD #1, a bootable flash memory drive. Alternatively, Pre-Execution Environment (PXE) can also be used to install RHEL, if the system to be installed contains a network interface card (NIC) with Pre-Execution Environment (PXE) support.

How PXE works
The client's NIC with PXE support sends out a broadcast request for DHCP information and the DHCP server provides the client with an IP address, name server information, the hostname or IP address of the tftp server and the location of the installation files on the tftp server.

Basic steps required for preparation of PXE server
1. Configure the network (either NFS or FTP or HTTP) server to export the installation tree.
2. Configure the files on the tftp server necessary for PXE booting.
3. Configure DHCP

* Here we will use ftp server for our pxe installation server.
* In my case the media used is CD, if your OS is on DVD, few steps may vary.


Configuring vsftpd for PXE
Setting up vsftpd for basic use require just two steps. Installation of vsftpd rpm and starting the vsftpd service. We also need to chkconfig vsftpd so that vsftpd starts automatically when system reboots.

Step 1:
install vsftpd, if is not installed. On RHEL5. If RHEL5 is on CD, this file will be in CD-2:
Code: Select all
rpm -ivh vsftpd-2.0.5-12.el5.i386.rpm


Step 2:
Starting vsftpd service as:
Code: Select all
service vsftpd start
chkconfig --level 345 vsftpd on


Copying CDs to /var/ftp/pub
/var/ftp/pub directory path is automatically created when we install vsftpd rpm. So, now we need to copy all the cds in /var/ftp/pub/rhel5.3/
Code: Select all
mkdir /var/ftp/pub/rhel5.3/
cp -rvf /media/RHEL-5.3\ i386\ Disc\ 1/* /var/ftp/pub/rhel5.3/
cp -rvf /media/RHEL-5.3\ i386\ Disc\ 2/* /var/ftp/pub/rhel5.3/
cp -rvf /media/RHEL-5.3\ i386\ Disc\ 3/* /var/ftp/pub/rhel5.3/
cp -rvf /media/RHEL-5.3\ i386\ Disc\ 4/* /var/ftp/pub/rhel5.3/
cp -rvf /media/RHEL-5.3\ i386\ Disc\ 5/* /var/ftp/pub/rhel5.3/


Configuring tftp for PXE
Step 1:
You need to install tftp, as it is not installed when you install your Linux box with "Customize Later" option selected. On RHEL5 it is present on CD-2 or CD-3 depending upon the version of RHEL5 you are using:
Code: Select all
rpm -ivh tftp-server-0.42-3.1.i386.rpm


tftp-server is a xinetd dependent, if xinetd is not installed, you need to install xinetd rpm (which is present on CD-2) before can can successfully install tftp-server.


Step 2:
tftp is an xinetd based service, and requires to be started manually as:
Code: Select all
chkconfig --level 345 tftp on


Configuring dhcp server for PXE
DHCP (Dynamic Host Configuration Protocol), is a network protocol for automatically not allowed TCP/IP information to client machines, which includes, IP address, gateway, and DNS Server information.

You need to install dhcp rpm, as it is not installed, when you install you system by selecting the option "Customize Later". The rpm dhcp-3.0.5-18.el5.i386.rpm is present in CD-3.

Configuration dhcpd.conf File
By default the dhcpd.conf file is not present in /etc/. The sample file is present at /usr/share/doc/dhcp<version>/dhcp.conf.sample which can be copied to /etc/ for use.
/etc/dhcpd.conf ;main configuration file

/var/lib/dhcp/dhcpd.leases ;store the client lease database

Configuring /etc/dhcpd.conf
dhcp-for-pxe.GIF
dhcp file for pxe
dhcp-for-pxe.GIF (5.21 KiB) Viewed 1530 times


192.168.1.100 is the ip address of my server on which I am configuring PXE.


After dhcpd.conf file is being configured, start dhcpd service and chkconfig it so that it start automatically on next boot.
Code: Select all
service dhcpd start
chkconfig dhcpd on


PXE Boot configuration
The next step is to configure PXE boot configuration, so that tftp-server can serve client requests. This configuration can be done either through GUI tool system-config-netboot or through CLI using pxeos command.


[*] system-config-netboot is available if system-config-netboot-0.1.45.1-1.el5.noarch.rpm is installed.
[*] pxeos and pxeboot commands are available if system-config-netboot-cmd-0.1.45.1-1.el5.noarch.rpm is installed.
[*] Both system-config-netboot-0.1.45.1-1.el5.noarch.rpm and system-config-netboot-cmd-0.1.45.1-1.el5.noarch.rpm are present on CD-2.
[*] In this post I have mentioned how to use cmd tool to configure PXE boot, so, installation of system-config-netboot-0.1.45.1-1.el5.noarch.rpm is not required. Installation of system-config-netboot-cmd-0.1.45.1-1.el5.noarch.rpm will serve our purpose.


We need to execute the following command to configure PXE configuration as:

Code: Select all
pxeos -a -i "Redhat 5.3" -p FTP -D 0 -s 192.168.1.100 -L /pub/rhel5.3/ redhat-el5.3


Where:
-a
add a new Operating System description

-i <description>
set short description not allowed with the Operating System.

-p <NFS | HTTP | FTP>
specify protocol used to access the Operating System

-D <1|0>
specify whether the configuration is diskless or not, zero specifies that it is not a diskless configuration

-s <server name or ip address>
specify the machine containing the Operating System

-L <netlocation>
specify the directory on the sever machine containing the Operating System.

<os-identifier>Specify the unique Operating System identifier, which is used as the directory name in the /tftpboot/linux-install/directory.

After execution pxeos command, the initrd.img and vmlinuz files required are transferred from
/var/ftp/pub/rhel5.3/images/pxeboot/ to /tftpboot/linux-install/<os-identifier>

In our case <os-identifier> is rhel5.3

At this stage, you can boot your PXE enabled system to install redhat 5.3. There are few other thinks we can configure in PXE, other than what I have wrote.


Writing such an short article is erring, so, If you find any error, plz don't hesitate to comment/correct.


Sunil Datta
User avatar
sunil datta
 
Posts: 47
Joined: Sun Feb 08, 2009 2:55 pm

Re: PXE Installation - How to configure PXE

Postby alok on Wed Jan 13, 2010 8:05 am

amazing explanation... great
Alok Srivastava
User avatar
alok
 
Posts: 164
Joined: Tue Dec 23, 2008 5:41 am

Re: PXE Installation - How to configure PXE

Postby vikas.shri on Fri Jan 15, 2010 7:58 am

jai HO !!!!!!!!!!!!!!!!!!!!!! sir ji
:)

thats gr888888888888888888!!!!!!!!!!!1
vikas.shri
 
Posts: 2
Joined: Sun Nov 22, 2009 11:57 am

Re: PXE Installation - How to configure PXE

Postby sunil datta on Sat Jan 16, 2010 1:30 pm

Vikas Ji, if you and others continue supporting, I will always try writing good.
User avatar
sunil datta
 
Posts: 47
Joined: Sun Feb 08, 2009 2:55 pm

Re: PXE Installation - How to configure PXE

Postby anuj.teotia09 on Thu Mar 04, 2010 11:11 am

sunil sir i m unable to find system-config-netboot rpm even from internet for rhel 5 so i m unable to run pxeos command. plz tell me how can i configure my my server
anuj.teotia09
 
Posts: 7
Joined: Tue Feb 02, 2010 11:11 am

Re: PXE Installation - How to configure PXE

Postby sunil datta on Thu Mar 04, 2010 1:56 pm

Hi anuj,

It is available on server RHEL 5.2 DVD, but I think it is not available on RHEL 5.2 client media. You need to look for RHEL 5.2 Server media.

Sunil Datta
sunil_prog@yahoo.com
User avatar
sunil datta
 
Posts: 47
Joined: Sun Feb 08, 2009 2:55 pm

Re: PXE Installation - How to configure PXE

Postby anuj.teotia09 on Fri Mar 05, 2010 5:26 am

:) thank you sir. can u tell me how can i use pxe with kickstart & how can i create my setup fully unattended
anuj.teotia09
 
Posts: 7
Joined: Tue Feb 02, 2010 11:11 am

Re: PXE Installation - How to configure PXE

Postby alok on Fri Mar 12, 2010 3:33 pm

Sir because of the "word restrictions" here in the forum.. some words like "not allowed" is not coming correct. Can you please take a print-screen of the dhcpd.conf file and paste it here, thus making things easier and less confusing to the students.

God Bless.
Alok Srivastava
User avatar
alok
 
Posts: 164
Joined: Tue Dec 23, 2008 5:41 am

Re: PXE Installation - How to configure PXE

Postby sunil datta on Sat Mar 13, 2010 7:38 am

Anuj

You have to add a -k option in pxeos as:
Code: Select all
pxeos -a -i "Redhat 5.3" -k ftp://192.168.1.100/pub/kickstart/rhel52.cfg -p FTP -D 0 -s 192.168.1.100 -L /pub/rhel5.3/ redhat-el5.3


where
ftp://192.168.1.100/pub/kickstart/ is the path where my kickstart file resides.
rhel52.cfg is my kickstart file
User avatar
sunil datta
 
Posts: 47
Joined: Sun Feb 08, 2009 2:55 pm

Re: PXE Installation - How to configure PXE

Postby sonu on Mon Mar 15, 2010 5:13 am

Dear All,
I am problem with Wlan Configuration in rhel 5.4.
plz help me ???

Wlan Card Details:
Broadcom 802.11g Network Adapter
Driver Provider Broadcom
Driver Date 10/1/2008
Driver Version 5.30.21.0
sonu
 
Posts: 3
Joined: Tue Jan 19, 2010 12:58 pm

Next

Return to Linux Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron