Booting over the network

Red Hat Enterprise Linux and PXE

It's possible to install Red Hat Enterprise Linux (RHEL) or any of its clones like CentOS over the network, which is useful when you want to install a workstation or server without a floppy or CD/DVD drive. This is done through PXE, which your to-be-installed server has to support.

First, issue on your existing server the following commands:

 # pxeos -a -i centos -p HTTP -D 0 -s <IP_address_of_existing_server> -L /centos_5_cd1 /path/to/centos_5_cd1/images/pxeboot
 # pxeboot -a -O /path/to/centos_5_cd1/images/pxeboot <IP_address_of_new_server>
 # yum -y install tftp tftp-server dhcp httpd

Configure the DHCP server configuration file /etc/dhcpd.conf as follows:

 ddns-update-style interim;
 subnet 192.168.0.0 netmask 255.255.255.0 { # Your network
    filename "linux-install/pxelinux.0";
    next-server 192.168.0.4;                # Your existing server's address
    range dynamic-bootp 192.168.0.6;        # Your new server's address
 }

The DHCP server logs enough, but tftp doesn't. So add to /etc/xinetd.d/tftp the flags -v -v -v to line server_args

This last IP address is VERY important -- only a client who receives this IP address of the DHCP server will get access to the tftp files.

Now test whether tftp works with the tftp client:

 $ tftp
 tftp> get linux-install/pxelinux.0
 tftp>

In file /var/log/messages, something like the following should appear:

 xinetd[4691]: START: tftp pid=4698 from=127.0.0.1
 in.tftpd[4699]: RRQ from 127.0.0.1 filename linux-install/pxelinux.0

Now connect your new server to the network and power it on. You should probably configure the machine that it tries to boot using PXE. Again, after powering on in /var/log/messages something as follows should appear.

 dhcpd: DHCPDISCOVER from 00:18:8b:f8:24:90 via eth0
 dhcpd: DHCPOFFER on 192.168.0.6 to 00:18:8b:f8:24:90 via eth0
 dhcpd: DHCPREQUEST for 192.168.0.6 (192.168.0.3) from 00:18:8b:f8:24:90 via eth0
 dhcpd: DHCPACK on 192.168.0.6 to 00:18:8b:f8:24:90 via eth0
 in.tftpd[5089]: RRQ from 192.168.0.6 filename linux-install/pxelinux.0 
 in.tftpd[5089]: tftp: client does not accept options 
 in.tftpd[5090]: RRQ from 192.168.0.6 filename linux-install/pxelinux.0 
 in.tftpd[5091]: RRQ from 192.168.0.6 filename linux-install/pxelinux.cfg/01-00-18-8b-f8-24-90 
 in.tftpd[5091]: sending NAK (1, File not found) to 192.168.0.6
 in.tftpd[5092]: RRQ from 192.168.0.6 filename linux-install/pxelinux.cfg/C0A80006 
 in.tftpd[5093]: RRQ from 192.168.0.6 filename linux-install//path/to/centos_5_cd1/images/pxeboot/vmlinuz 
 in.tftpd[5094]: RRQ from 192.168.0.6 filename linux-install//path/to/centos_5_cd1/images/pxeboot/initrd.img

The installation should now start. However, PXE is only used to boot the new server. The installation files themselves will be retrieved through NFS, HTTP or FTP. So configure one of those servers and follow the installation on the new server its screen as well as through the logs on the existing server. Should any problems arise, it's then easier to determine where the problem lies.