Home > fedora, foss, install, mepco, network > Setting up a Network installation Server

Setting up a Network installation Server

Couple of days back , i have installed nearly 100 machines of my alma mater’s lab with Fedora 11. I used PXE based network installation instead of using DVD’s on each machine.I tried to document it here, as it might help someone who tries to do the same in future.

To install Fedora , we need the iso image (DVD) inside the hard disk. If you have a DVD but not the iso file its easy to create the iso file from DVD, just insert the DVD inside the machine and issue the following command,

dd if=/dev/sr0 of=/media/disk-1/fedora11.iso

Install following packages in your existing Fedora installation by using,

yum install httpd syslinux tftp-server dhcp system-config-kickstart

Configure TFTP server:

The TFTP Server configuration file is stored in /etc/xinetd.d/tftp

Example configuration file,

service tftp
{
disable = no
socket_type =
dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/
per_source = 11
cps = 100 2
flags = IPv4
}

Note the server_args variable , it refers to the TFTP root.

start the TFTP server using,

/etc/init.d/xinetd start

Configuring DHCP:

The DHCP configuration file is stored in /etc/dhcpd.conf
Sample configuration file:

allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
authoritative;
subnet 172.16.16.0 netmask 255.255.240.0 {
option subnet-mask 255.255.240.0;
option broad
cast-address 172.16.31.255;
range dynamic-bootp 172.16.28.2 172.16.28.240;
next-server 172.16.24.199 ;
filename “pxelinux.0”;
}

Note 1:
In above sample configuration file, next-server is the IP address of your TFTP server.
The IP addresses in above configuration file should be adjusted according to your network.


Note 2:

If DHCP fails to start, check /var/log/messages for error messages.

Start the DHCP server using,

/etc/init.d/dhcpd start

Using Kickstart:

Kick start file is used to automate the installation process,

Open kickstart file creator by issuing following command,

system-config-kickstart

When configuring kickstart using GUI, it should be noted that, the “Installation Method” should be “HTTP” , “HTTP server” field should be the IP address of machine which is having Fedora DVD dump. The “HTTP Directory” should be the directory in which you dumped (mounted) the iso file (here it is ‘fedora11’).

The packages to be installed can be preselected from the GUI tool.

After selecting various options from the kickstart GUI tool, save the file as ks.cfg.

Setting up Apache Webserver:

I have assumed my machines IP address is 172.16.24.199

Create a folder named fedora11 in /var/www/html/ (need to be root)

Mount the Fedora’s ISO image (needs to be root) inside /var/www/html/fedora11/ using,

mount -o loop /media/disk-1/fedora11.iso /var/www/html/fedora11/

Copy the ks.cfg (kickstart file) inside /var/www/html/

Start Apache webserver using,

service httpd start

Copying files to TFTP root:

Create a directory named /tftproot

Copy the kernel (vmlinuz) and ramdisk (initrd.img ) from the DVD and paste it in /tftproot/ directory. (you can find kernel and ramdisk in images/pxeboot/ directory of the installation media or the ISO file.)

Copy the /usr/share/syslinux/pxelinux.0 inside /tftpboot/ directory.

Create a directory named /tftpboot/pxelinux.cfg

Create a file named ‘default’ and place it inside /tftpboot/pxelinux.cfg/ directory,

The content of the ‘default’ file should be,

DEFAULT pxeboot
TIMEOUT 10
LABEL pxeboot
KERNEL vmlinuz
APPEND initrd=initrd.img ksdevice=eth0 ks=http://172.16.24.199/ks.cfg lang=en_US keymap=us
ONERROR LOCALBOOT 0

Booting clients:

Switch on the machine in which you wish to install Fedora, enter into Bios setup and Enable PXE booting with LAN. Set the first boot device to network interface card (if required) and start booting from the network. Thats it!

Further Reading:
Cobbler – Installation server https://fedorahosted.org/cobbler/
ks.cfg – Sample kickstart file http://sagarun.fedorapeople.org/misc/ks.cfg

Advertisements
Categories: fedora, foss, install, mepco, network
  1. fepede
    August 20, 2009 at 5:45 pm

    Amazing!thank you for sharing this!

  2. Narendra Sisodiya
    August 20, 2009 at 6:09 pm

    Very Nice !! Great work !! It reminded me my stay at IIT 😉 –But if the network already have abnother DNS server which you cannot stop then this setup will not work IMHO.Also for such situation it is much better to have thin client setup

  3. Arun SAG
    August 21, 2009 at 5:53 am

    @Narendra SisodiyaDNS or DHCP?Yes, There will be race between two DHCP servers, but the DHCP leases with a File ("pxelinux.0" ) will be accepted instead of the plain DHCP PACK . Also the "authoritative" string in dhcpd.conf helps giving advantage when there is a race!

  4. Narendra Sisodiya
    August 21, 2009 at 3:55 pm

    I meant to DHCP !!Actually I wanted to have thin booting environment (not installation ) of http://www.ltsp.org/ in lab but I suspect because of dual DHCP it was not possible !! I have not tested well that time !! Anyway will try when I will get some invitation from any college !!

  5. steven
    September 4, 2009 at 7:01 am

    Hi Friend,Congratulations for this nice looking blog. In this post everything about Web Development. I am also interested in latest news, sometimes i posted on Customized application development

  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: