Building a netboot server

From FGWiki
Jump to: navigation, search
Important: The content of this page is outdated. If you have checked or updated this page and found the content to be suitable, please remove this notice.


This document describes how to build a server to support installing Ubuntu over the network.

Introduction

Operating System Install

Install Debian 'lenny'

If you have an existing 'etch' installation, you can upgrade by editing /etc/apt/sources.list and changing all instances of 'etch' to 'lenny'. Then type

# apt-get update
# apt-get dist-upgrade

and go for lunch.

Additional Software

dhcpd

# apt-get install dhcp3-server

tftpd

# apt-get install tftpd-hpa

bind

# apt-get install bind9

apt-cacher-ng

# apt-get install apt-cacher-ng

apache2

# apt-get install apache2

subversion

# apt-get install subversion

Configuration

Network

You need two network interface cards (NICs) in the machine. One is the internet facing card, which is probably configured to acquire an ip address via another dhcp server. The second card will be on a seperate network, facing the clients that you want to install.

We will assume that the internet facing NIC is eth0, and the other NIC is eth1. Type

ifconfig -a

to list the interfaces.

The second NIC needs to be assigned a static ip address. Edit /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

# The secondary network interface
auto eth1
iface eth1 inet static
  address 192.168.13.1
  netmask 255.255.255.0

The eth1 secondary interface is the one we added. Most likely eth0 will have already been setup by the debian-installer. For eth1, any 192.168.x.1 address will work, but make sure it is not on the same network block as eth0.

After editing this file type

ifup eth1

to bring up the new interface.

You need to edit /etc/sysctl.conf to enable ipv4 forwarding. Make sure the line

net.ipv4.ip_forward=1

is uncommented.

edit /etc/rc.local and add the lines

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

before the exit 0 line.

dhcpd

Add the following to /etc/dhcp3/dhcpd

subnet 192.168.13.0 netmask 255.255.255.0 {
   range 192.168.13.100 192.168.13.200;
   option routers 192.168.13.1;
   option domain-name "cluster";
   next-server 192.168.13.1;
   filename "/pxelinux.0";
}

type

/etc/init.d/dhcp3-server start

to start the dhcp server. If it fails to start, type

cat /var/log/syslog

to see what was wrong. Fix the configuration file, and try again.

Testing