PXE BOOT

Configure Pxe Boot in Redhat Linux.

1)Install following packages if your system dont have them.

1. tftp-server

2. dhcp

3. httpd

4. syslinux

If you use yum to install them, then it will be generally alot easier:

#yum install tftp-server dhcp httpd syslinux

answer Y to all dependency/installation questions.

2) Now you need to setup the DHCP server. All you need to do is create /etc/dhcpd.conf with the following contents:

ddns-update-style interim;

subnet 192.168.0.0 netmask 255.255.255.0 {

range 192.168.0.10 192.168.0.254;

default-lease-time 3600;

max-lease-time 4800;

filename "pxelinux.0";

} 

In a nutshell, this sets up a DNS server that will assign IP address 192.168.0.254 to your client box that has MAC address 04:4B:80:80:80:03 assigned to its PXE-boot capable NIC. Another thing to note is that we’re reserving the private 192.168 subnet for this setup. The only thing you need to change in the above, is the MAC address to match that of the NIC on your client box. We can comment the mac id line.

3) Next you need to activate tftp within xinetd. All that is neccesary is to change disable=yes to disable=no in /etc/xinetd.d/tftp. Then restart xinetd service. For future reference, the tftp RPM for FC4 stores its servable content under /tftpboot.

4) Now we need to setup PXE server to use a static IP on the new private subnet.

Create the file /etc/sysconfig/network-scripts/ifcfg-eth0 static with the following contents:

</strong>

DEVICE=eth0

BOOTPROTO=STATIC

ONBOOT=no

TYPE=Ethernet

IPADDR=192.168.0.2

NETMASK=255.255.255.0

GATEWAY=192.168.0.1 /code] 

5) Now we need to setup the PXE boot environment on the server. To do this, you need to have either the Linux distribution that you wish to install over PXE either in CD format, or all the content of the CDs available on the network.

On the first CD of every RH/FC distribution there is a subdirectory called 'isolinux'. In that directory you will find two files, vmlinuz and initrd.img. These are the kernel &amp; initrd.img that the RH/FC bootable CDs use to get the installer (anaconda) booted for performing the installation. Copy both of those files into /tftpboot and make sure that they are world readable.

<strong>6) Next, you need the actual pxe boot linux kernel (what is actually run immediately after your PXE boot client box gets a DHCP lease). In this case, that file is pxelinux.0 and is part of the syslinux RPM. For FC4, you can find it at /usr/lib/syslinux/pxelinux.0. Copy that file into /tftpboot and make sure that it is world readable.</strong>

<strong>7) Now create the default pxelinux configuration inside the new file</strong>


#mkdir /tftpboot/pxelinux.cfg/default

#vim /tftpboot/pxelinux.cfg/default

prompt 1

default linux

timeout 100

label linux

kernel vmlinuz

append initrd=initrd.img ramdisk_size=9216 noapic acpi=off 

8) Now you need to put the full contents of your Linux distro (all CDs) somewhere on disk. E.g. put it under /tftpboot/RHEL4U1.

In order to allow for installation over HTTP (apache), edit /etc/httpd/conf/httpd.conf and add the following:

#vim /etc/httpd/conf/httpd.conf

&lt;Directory /tftpboot/RHEL4U1&gt;

Options Indexes

AllowOverride None

&lt;/Directory&gt;

Alias /linux /tftpboot/RHEL4U1  

9) At this stage, you're ready to hook up the switch. You should have CAT5 running between the switch & the PXE boot server, and the client box.

11) Now start dhcpd & apache and activate tftp by running the following:

#service dhcpd start

#service xinetd restart

#service httpd start  

and verify that they are all in your process list.

13) Plug the PXE client box's CAT5 into the switch, and verify that the NIC appears first in the BIOS boot order. (re)boot and you should get a DHCP lease, and start booting successfully off the network.

14) When you get into the RH/FC installer which asks you for the install method, choose HTTP/url. Fill in url address :-> http://192.168.0.2/linux as path, and you should be all set.

15) If you run into any problems, check /var/log/messages for errors (that's where all dhcp & tftp stuff will get logged). /var/log/httpd is where apache logs.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s