Next Previous Contents

3. Setting up the server

The server works as a repository. The clients will need to access server ressources in order to boot, install packages and so on. To achieve this, various network services must be properly set up.

Most files required for the installation are located under /files/install. The nais directory contains all configuration files as well as scripts and required utilities.

vermeer[~]# tree -d -L 2 /files/install/nais/

|-- config
|   |-- class
|   |-- disk
|   |-- env
|   |-- files
|   |-- package
|   -- scripts
|-- install
|   |-- init.d
|   |-- rc0.d
|   -- rc1.d
-- utilities
    |-- busybox
    |-- cmos
    |-- install_packages
    |-- kiss
    |-- mk_initrd
    |-- mk_mbaimg
    |-- mk_root
    `-- setup_harddisks
The installroot directory contains a root filesystem based on Debian's base2_2.tgz. It will be mounted by the clients during installation, providing a basis for their respective filesystems.
vermeer[~]# tree -d -L 2 /files/install/installroot/

|-- bin
|-- boot
|-- busybox
|-- cdrom
|-- debian
|-- dev
|-- etc
|-- floppy
|-- home
|-- initrd
|-- kiss
|-- lib
|-- mnt
|-- proc
|-- root
|-- sbin
|-- tmp
|-- usr
-- var

Now we can set up the network daemons.

3.1 The TFTP daemon

A client should boot from its network card or floppy. In order to boot via the network card, the TFTP service must be installed on the server.

A first step is to add or uncomment the following lines from /etc/inetd.conf:

tftp dgram udp wait.240 nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
Note: the directory /tftpboot will be used as a repository for the kernel and the ramdisk image the client will boot from After changing this file, inetd must update its configuration. To achieve this, it must be killed and restarted (the HUP option):
vermeer[~]# killall -v -HUP inetd
Killed inetd(15086)
In case your linux distribution doesn't have the command killall, which kills processes by name, you can use kill with the appropriate process id as well.

3.2 The NFS daemon

The clients access all server resources via NFS. To enable NFS service, rcp.nfsd and rpc.mountd daemons must be started. Debian achieves this by executing the nfs-server script, which is located in /etc/init.d. The clients are only able to mount exported directories. Alter the /etc/exports accordingly :

vermeer[~]# cat /etc/exports
/files/install   ,no_root_squash)
/debian          ,root_squash)

3.3 The DHCP daemon

The main function of the DHCP server is to give the client an IP adress and to make it load the file named bpbatch.P from the TFTP server. Note: DHCP is a superprotocol over BOOTP. The installation and configuration of DHCP has been well documented in the Refer to it for details.


First of all, you should check whether your kernel does have MULTICAST support enabled. You can do so by typing:

vermeer[~]# ifconfig -a
eth0    Link encap:Ethernet  HWaddr 00:50:DA:41:E0:1C           
        inet addr:  Bcast:  Mask:
On most systems this option is already set.

DHCPd stores information about current leases in a file named dhcpd.leases. It is in plain text format, so you can view it during DHCPds operations. You will propably have to create it; type:

touch /var/state/dhcp/dhcpd.leases
Older versions of dhcpd (<2.0) store this file as /etc/dhcpd.leases

Configuring DHCPd

All options for the DHCP deamon can be set in the /etc/dhcpd.conf file. If you are using KDE 2.0 you can try kcmdhcpd - a graphical interface for dhcpd configuration, very similar to the Windows NT DHCP configurator.

If you are using a PXE boot-PROM, add the following lines :

option dhcp-class-identifier "PXEClient"
option vendor-encapsulated-options ff;

The dchpd.conf consists of two main parts.

Setting the global options

Here is an excerpt of our dhcpd.conf, containing the global options. All option tags (e.g. option-211) have corresponding environment variables (e.g. ${NAIS_ACTION}). Adjust them to your needs as you see fit. Note: the global parameters can be overwritten by specific options if needed; all comments are preceded by a #.

# NAIS can do more than installing a client :) Possible options:
#   install -- install the system
#   sysinfo -- fetch all hardware information and write it to logs
#   bash -- start a bash
option option-211 "bash";

# NAIS will be mounted during installation via nfs
# from the dhcp server (see statement "server-name" below). 
# This is its directory.
option option-212 "/files/install/nais";

# After successful booting and extracting the ramdisk 
# containing the miniroot system, NAIS mounts this 
# directory from the dhcp server. The needed binaries,
# libraries and such are taken from this directory;
# it is actually a debian base with some additional
# packages.
option option-213 "/files/install/installroot";

# After installation NAIS switches the boot method (e.g.
# to boot from harddisk. To do this easily the bootfile 
# is only a link which will be switched after installation.
option option-214 "hdboot.bpb";

# The boot method. Current values are "bpbatch", "pxelinux", 
# "netboot" and "etherboot".
option option-215 "bpbatch";

# Some flags for the general behaviour of NAIS
# "verbose"     increase output
# "debug"       write every line of code
# "keep_bootmethod"     normally the client changes the boot 
#               method after the installation to boot from its 
#               harddisk. This flag deactivates this feature so
#               that every time the client reboots it will be 
#               reinstalled.
# "no_reboot_daemon"    do not start the reboot daemon "kiss".
# "reboot"      normally NAIS installs without rebooting. With this flag
#               the client reboots after installation.
# "paranoid"    interactive mode, for those who don't have trust 
#               in our **automatic** installation ;)
# NOTE: Obviously combinations like "reboot" and "keep_bootmethod"
# don't make much sense. Nevertheless they are possible.
option option-216 "keep_bootmethod verbose";

# ${NAIS_USER}: account on tftp and log-server
# Used to save all log-files to server and to change image which is 
# booted via network. For this to work you need to configure this user's 
# .rhost, so root can login from all install clients without password.  
# As well, this account must have write permissions for /tftpboot. 
# Note:  To achieve this we granted write permissions for /tftpboot to 
# the group linuxadm, which NAIS_USER is member of. 
# chgrp linuxadm /tftpboot; chmod g+w /tftpboot
option option-217 "nais";

# NAIS saves at the end of every phase all logfiles to this server
# using the account NAIS_USER via rsh/rcp.
option option-218 "";

# Server from which to mount bin-trees like /usr etc. Only useful 
# for lean-clients. To use it, you have to define a class USR_MOUNT 
option option-219 "";

# Server from which to mount /home. Only useful if you define a 
# class named HOME_CLIENT
option option-220 "";

# Packages are installed with APT and debconf. APT can fetch
# the debian packages via nfs, http or ftp. If some of your
# client use nfs you must tell NAIS the path. 
option option-221 "";

# Additional values for search list in resolv.conf.
# E.g. if you want your resolv.conf to look like
# -- snip --
# search
# -- snap --
# you have to define this to be "".
# Otherwise, leave it empty.
option option-222 "";

allow booting;
allow bootp;
deny unknown-clients;
default-lease-time 60;
max-lease-time 70;

# It is important to get hostnames as well (not only ip)
# because we let NAIS use hostnames instead of ip adresses.
use-host-decl-names on;

The bootp flag (allow bootp;) tells dhcpd to respond to bootp queries.

These options are global but specific to our network:

server-name "";
option domain-name "";
option domain-name-servers,,;
option time-servers vermeer;
option ntp-servers,,;
option nis-domain "pinguine";
option nis-servers vermeer;
option subnet-mask;

subnet netmask {
  option routers;
The server will advise the client to use as its subnet mask, as the router/gateway and,, as its DNS servers.

Setting the bootmethod specific options

Decision time. Now you can choose from the following bootmethods:

This is a sample configuration of a client using PXElinux.
  option option-215 "pxelinux";         # NAIS_BOOTMETHOD
  option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62
  filename "/tftpboot/pxelinux.bin";
  option option-211 "install";          # NAIS_ACTION

  host roy00 {
    hardware ethernet 00:10:5A:25:DB:BA;
    option option-214 "865F0AA0";       # NAIS_TFTPLINK

This will result in DHCP server giving a client (roy00) a specific IP adress ( based on its ethernet adress (00:10:5A:25:DB:BA).

You can mix these methods, like assigning 'static' IP adresses to certain clients and dynamic IPs to mobile users (laptops). For further options refer to the dhcpd.conf(5) man page.

When using BpBatch, you will have to create appropriate configuration files. They are usually different for each client and describe which kernel and ramdisk will be loaded. Note: these files do have a .bpb extension, but only their basename has to be written here.

option option-215 "bpbatch";          # NAIS_BOOTMETHOD
option option-214 "hdboot.bpb";       # NAIS_TFTPLINK
filename "/tftpboot/bpbatch";
option option-211 "install";          # NAIS_ACTION
host roy00 {
    hardware ethernet 00:10:5A:25:DB:BA;
    option option-135 "/tftpboot/roy00"; # bpbatch config file (roy00.bpb)

The netboot method doesn't differ much from the preceding one:

option option-215 "netboot";          # NAIS_BOOTMETHOD
always-reply-rfc1048 on;
option option-211 "install";          # NAIS_ACTION
option option-129 "reboot=warm";      # kernel parameters
host roy00 {
    hardware ethernet 00:10:5A:25:DB:BA;
    filename "/tftpboot/roy00"; 
Etherboot. This method has not been tested or even implemented yet, proceed with caution.
option option-215 "etherboot";        # NAIS_BOOTMETHOD
option option-211 "install";          # NAIS_ACTION
host roy00 {
    hardware ethernet 00:10:5A:25:DB:BA;
    filename "/tftpboot/roy00"; 

Starting the daemon

In order to start the DHCP server just type

When running dhcpd for the first time, you might want to use the options -d -f to enable debugging messages and put them on the server console. Boot your client and check the result. If everything works out fine you have made it.

Next Previous Contents