How to setup a network install server

January 29, 2008 at 08:53 PM | categories: Kickstart, Howto, RHEL, Centos, Linux | View Comments

This howto will describe how to setup Linux network install server. We will be using pxeboot and dhcp to allow for bare metal installation without the need for physical media. Network install servers are essential when large numbers of machines need to be setup or in cases where machines are frequently setup as well as for deployment of xen virtual machines.

I have used Centos 5.1 in this howto however i am sure it can be adapted to work with any other Linux distribution as the concepts remain the same. The main components that i have used are the following.

  • http server - apache
  • tftp server
  • dhcp server - isc dhcp
  • dns server - isc bind

Installation of software

I will assume that you already have an installed bare bones Centos 5.1 system with the hostname During this howto we will be using the fictitious domain please substitute with your own domain, and the network

DNS server

For this how to we will be using a DNS server because our media is stored on a virtual host, however it is possible to skip DNS setup and just use ip addresses if the installation servers http server is only going to be used to serve the media.

Install bind

# yum install bind bind-chroot

Configure bind and add the zone, make the changes below to the file /var/named/chroot/etc/named.conf

options {
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };
logging {
        channel default_debug {
                file "data/";
                severity dynamic;
view single_view {
        match-clients      { any; };
        match-destinations { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";

        zone "" {
                type master;
                file "data/";

        zone "" {
                type master;
                file "data/";

Add this to the file /var/named/chroot/var/named/data/

$ttl 38400
@       IN      SOA (
                        38400 )
@       IN      NS
server1 IN A
kickstart IN A

Add this to the file /var/named/chroot/var/named/data/

$ttl 38400
@       IN      SOA (
                        38400 )
@       IN      NS

Setup bind to start at boot

# chkconfig --level 345 named on
# service named start

DHCP server

We need a dhcp server to allow for pxebooting and automatic assignment of network parameters.

Install dhcp server

# yum install dhcp

Configure the dhcp server make changes to /etc/dhcpd.conf to look like below

option domain-name-servers;
allow booting;
allow bootp;

filename "pxelinux.0";

subnet netmask
        allow unknown-clients;
        ignore client-updates;

Enable dhcp server to start at boot

# chkconfig --level 345 dhcpd on
# service dhcpd start

Tftp server

The tftp server is used to serve the boot images that are required to pxe boot the machines to be installed.

Install tftp server

# yum install tftp-server

Configure tftp-server to start at boot

# chkconfig --level 345 tftp-server on

Copy syslinux image to tftp server directory

# cp /usr/lib/syslinux/pxelinux.0 /tftpboot

Create pxeboot directory structure

# mkdir /tftpboot/{pxelinux.cfg,msgs,os}

Start tftp server

# service xinetd restart

Http server

The http server is used to serve our install tree

Install apache

# yum install httpd

Configure virtual hosts, Since i need to allow for the server to be used for other purposes i am going to setup virtualhosts. The first virtual host is the default virtual host and the second one is the one that will be serving our network install. Edit the file /etc/httpd/conf/httpd.conf and add the following.

NameVirtualHost *:80
<VirtualHost *:80>
<VirtualHost *:80>
   DocumentRoot /srv/www
   ErrorLog logs/
   CustomLog logs/ common
   <Directory /srv/www/>
   Options +Indexes

Setup distributions

You can setup as many distributions as you want, i will be setting up Centos to serve as an example on how it is done.

Centos 5.1

Create directories to hold the install tree

# mkdir -p /srv/www/centos/5.1/os/i386

Copy files from the DVD or CD's

# mount /media/cdrom
# cp /media/cdrom/* /srv/www/centos/5.1/os/i386

Create the directory to hold pxe boot images

# mkdir /tftpboot/os/centos_5.1

Copy pxeboot images to server

# cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} /tftpboot/os/centos_5.1

Create a minimal kickstart to point to http installation, create file /srv/www/centos_5.1.ks and add the following

url --url

Add Centos 5.1 to tftpboot menu, edit the file /tftpboot/pxelinux/default and add the following

default centos5.1
prompt 1
timeout 600
display boot.msg

label centos5.1
        kernel os/centos_5.1/vmlinuz
        append ks= initrd=os/centos_5.1/initrd.img

blog comments powered by Disqus