PXE(Pre-eXecution Environment)On
Rhel5.x Versions
Requirements and network orienation for this setup
#PXE Enabled NIC/LAN Card & set as network booting in Client BIOS.
#Configure the network (NFS,FTP,HTTP)Server to export the installation tree.
#Configure DHCP server.
#A TFTP server necessary for PXE booting .
Pacakges required!!
# tftp-server-*
# tftp-client-* (for testing)
# dhcp-*
# xinetd-*
# system-config-netboot-*
I am going to share my lab setup for same.
In my lab I have installed rhel5.4 server as following details
/boot <============>100MB
/ <============>2000MB
Swap <============>4000MB double of my system memory
/home<============>3000MB
/var <============>5000MB
My server ip address is 192.168.0.254/255.255.255.0
This server acting as NFS,TFTP,DHCP.
Let start with my lab scenario !!
My Lab Layout
NFS setup path /var/ftp/pub/rhel5
Here I have copied RHEL5.4
DVD contents & shared this
Directory through NFS service.
DHCP Range provided by Server to Clients is 192.168.0.1 to 192.168.0.10
First of all I am going to configure TFTP server in my machine
[root@iijt ~]#cd /var/ftp/pub/rhel5
[root@iijt Server]#rpm -ivh /dump/Server/tftp-server-0.49-2.i386.rpm
warning: /dump/Server/tftp-server-0.49-2.i386.rpm: Header V3 DSA signature:
NOKEY, key ID 37017186
Preparing… ############################ ####### [100%]
1:tftp-server ################################### [100%]
[root@iijt Server]# vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer
# protocol. The tftp protocol is often used to boot diskless
# workstations, download configuration files to network-aware printers,
# and to start the installation process for some operating systems.
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
# disable = yes # <<===== Change this option with no
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
“/etc/xinetd.d/tftp” 18L, 510C
[root@iijt Server]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@iijt Server]#chkconfig xinetd on
[root@iijt Server]# chkconfig tftp on
[root@iijt Server]# rpm -ivh dhcp*
warning: dhcp-3.0.5-21.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID
37017186
Preparing… ########################################## [100%]
1:dhcp ########################################## [ 25%]
2:dhcp-devel ########################################## [ 50%]
3:dhcpv6 ########################################### [ 75%]
4:dhcpv6-client ########################################### [100%]
[root@iijt Server]# cp -v /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf’?
y
`/usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample’ -> `/etc/dhcpd.conf’
[root@iijt Server]# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# — default gateway
# option routers 192.168.0.1; <===== change with 192.168.0.254
option routers 192.168.0.254;
option subnet-mask 255.255.255.0;
option nis-domain “domain.org”;
# option domain-name “domain.org”;<== I have no DNS server so I
comment this line with # sign
# option domain-name-servers 192.168.1.1; <== this is also commented with #
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.1 192.168.0.10; #<== Client IP range
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}-
– INSERT –
ESC:wq!
[root@iijt Server]# rpm -ivh system-config-netboot-*
warning: system-config-netboot-0.1.45.1-1.el5.noarch.rpm: Header V3 DSA signature:
NOKEY, key ID 37017186
Preparing… ########################################### [100%]
1:system-config-netboot-c########################################### [ 50%]
2:system-config-netboot ########################################### [100%]
[root@iijt Server]#
Put these lines in /etc/dhcpd.conf file under Client IP Range under range dynamic-bootp
192.168.0.1 192.168.0.10;
default-lease-time 21600;
max-lease-time 43200;
allow booting;
allow bootp;
class “pxeclients” {
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient”;
Next-server 192.168.0.254;
filename “linux-install/pxelinux.0”;
}
ESC:wq!
[root@iijt Server]# service dhcpd restart
Starting dhcpd: [ OK ]
[root@iijt Server]# chkconfig dhcpd on
Dont remember to export /var/ftp/pub/rhel5 in /etc/exports file
[root@iijt Server]# vim /etc/exports
/var/ftp/pub/rhel5 192.168.0.0/255.255.255.0(ro,sync)
ESC:wq!
[root@iijt Server]# service nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@iijt Server]# chkconfig nfs on
[root@iijt Server]#
[root@iijt Server]# cd
[root@iijt ~]# system-config-netboot
[root@iijt ~]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@iijt ~]# service dhcpd restart
Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
[root@iijt ~]# service nfs restart restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@iijt ~]#
now go to client machine and boot the system with PXE enabled Lan and see the
output !!!!!!!!!! One think is noted i.e firewall should be disable before booting Client.