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/
/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/
/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.
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.
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 134.95.10.128/255.255.255.128(ro,no_root_squash)
/debian 134.95.10.128/255.255.255.128(ro,root_squash)
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 http://linuxdoc.org/HOWTO/mini/DHCP/. 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:134.95.10.140 Bcast:134.95.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
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
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.
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_ACTION}
# 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_PATH}
# 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";
# ${NAIS_ROOTPATH}
# 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";
# ${NAIS_TFTPLINK}
# 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";
# ${NAIS_BOOTMETHOD}
# The boot method. Current values are "bpbatch", "pxelinux",
# "netboot" and "etherboot".
option option-215 "bpbatch";
# ${NAIS_FLAGS}
# 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_LOGSERVER}
# NAIS saves at the end of every phase all logfiles to this server
# using the account NAIS_USER via rsh/rcp.
option option-218 "134.95.10.140";
# ${NAIS_BINSERVER
# 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
# or USR_LOCAL_MOUNT.
option option-219 "134.95.10.140";
# ${NAIS_HOMESERVER}
# Server from which to mount /home. Only useful if you define a
# class named HOME_CLIENT
option option-220 "134.95.10.140";
# ${DEBIAN_NFS_LOCATION}
# 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 "134.95.10.140:/debian";
# ${NAIS_SEARCH}
# Additional values for search list in resolv.conf.
# E.g. if you want your resolv.conf to look like
# -- snip --
# search informatik.uni-koeln.de uni-koeln.de
# -- snap --
# you have to define this to be "uni-koeln.de".
# Otherwise, leave it empty.
option option-222 "uni-koeln.de";
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 "134.95.10.140";
option domain-name "informatik.uni-koeln.de";
option domain-name-servers 134.95.100.209, 134.95.100.208, 134.95.140.208;
option time-servers vermeer;
option ntp-servers 134.95.99.254, 134.95.110.33, 134.95.111.13;
option nis-domain "pinguine";
option nis-servers vermeer;
option subnet-mask 255.255.255.0;
subnet 134.95.10.0 netmask 255.255.255.0 {
option routers 134.95.10.254;
}
The server will advise the client to use 255.255.255.0 as its subnet mask,
134.95.10.254 as the router/gateway and 134.95.100.209, 134.95.100.208,
134.95.140.208 as its DNS servers.
Decision time. Now you can choose from the following bootmethods:
option option-215 "pxelinux"; # NAIS_BOOTMETHOD
option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62
:6f:6f:74:0a:07:00:50:72:6f:6d:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00
:47:04:80:00:00:00:ff;
filename "/tftpboot/pxelinux.bin";
option option-211 "install"; # NAIS_ACTION
host roy00 {
hardware ethernet 00:10:5A:25:DB:BA;
fixed-address 134.95.10.160;
option option-214 "865F0AA0"; # NAIS_TFTPLINK
}
This will result in DHCP server giving a client (roy00) a specific IP adress (134.95.10.160) 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;
fixed-address 134.95.10.160;
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;
fixed-address 134.95.10.160;
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;
fixed-address 134.95.10.160;
filename "/tftpboot/roy00";
}
In order to start the DHCP server just type
/usr/sbin/dhcpd
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.