Monday, February 16, 2009

Setting up a Linux Practice Lab (Part 4)

6. Setup PXE boot server
Link the source location to the web server:
# cd /var/www/html
# ln –s /install install

Install & enable tFTP server & DHCP server:
# yum install tftp-server dhcp
# chkconfig tftp on
# chkconfig dhcp on
# service tftp start

Install Kickstart Configurator:
# yum install system-config-kickstart

Download & install system-config-netboot to configure the PXE (This tool is not shipped with RHEL5)
system-config-netboot-0.1.45.1-1.el5.noarch.rpm
system-config-netboot-cmd-0.1.45.1-1.el5.noarch.rpm

Install the packages:
# rpm -Uvh system-config-netboot*.rpm
(If there are any listed dependencies like alchemist or gnome-python2, install them with yum)

Configure Kickstart
# system-config-kickstart
Configure these options:
Basic configuration – Perform Installation in interactive mode
Installation Method – HTTP Server: 192.168.1.100, Directory: install
Display Configuration – 24bit, 1024x768, Start X on boot.
Save as ks.cfg in /var/www/html

Configure the PXE Boot:
# system-config-netboot
(If starting the Network Booting Tool for the first time, select Network Install from the First Time Druid. Otherwise, select Configure => Network Installation from the pull down menu, and then click Add.)

Configure these options:
Operating system identifier: RHEL5.1
Description: Redhat Enterprise Linux 5 U1
Selects protocol for installation: NFS
Kickstart: http://192.168.1.100/ks.cfg
Server: 192.168.1.100
Location: /install

Configure DHCP Server:
# vi /etc/dhcpd.conf

Insert the following contents:
ddns-update-style none;
allow booting;
allow bootp;
default-lease-time 21600;
max-lease-time 43200;

option routers 192.168.1.100;
option subnet-mask 255.255.255.0;
option domain-name "training.com";
option time-offset -18000;
subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.7 192.168.1.20;

}


class "pxeclients" {

match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";

next-server 192.168.1.100;

filename "linux-install/pxelinux.0";

}

# Repeat the following section as necessary for every student machine used in the class

host machine1 {

hardware ethernet 00:0b:db:e9:77:54;
fixed-address 192.168.1.1;

option host-name "machine1.training.com";

}

Save the file.

Start the service:
# service dhcpd start

That's it for the PXE installation server. I went on to configure more NFS and Samba shares for the students to practice on. It is all very simple, so I'll end this topic here. Cheers.

2 comments:

Mac said...

I went through the entire pages ..
to set up yum repository for my office..
but facing problem at the time of installation of tftp-server.
it get installed on the system but service tftp start command is not working.
get message unrecongnise service.
then tried to install.
system-config-netboot-0.1.45.1-1.el5.noarch.rpm
& system-config-netboot-cmd-0.1.45.1-1.el5.noarch.rpm but displayed message.
file /usr/share/system-config-netboot/system-config-netboot.pyo from install of system-config-netboot-0.1.45.1-1.el5 conflicts with file from package system-config-netboot-0.1.45.1-1.el5

Please suggest.

Ter said...

I was using RHEL5.1 at the time & due to some bugs system-config-netboot was not included in RHEL5.1
If you are using something newer, it might already be installed. (Which sounds like it based on the error you mentioned)
Try running:
# system-config-netboot

If it appears, you are good to go.

As for tftp, try running:
# chkconfig --list | grep tftp

See if it's there. (Maybe they changed the name slightly)
It's sometimes called tftpd or even tftp-server