4.3. Preparing Files for TFTP Net Booting

If your machine is connected to a local area network, you may be able to boot it over the network from another machine, using TFTP. If you intend to boot the installation system from another machine, the boot files will need to be placed in specific locations on that machine, and the machine configured to support booting of your specific machine.

You need to set up a TFTP server, and for many machines a DHCP server.

The DHCP (Dynamic Host Configuration Protocol) is a more flexible, backwards-compatible extension of BOOTP. Some systems can only be configured via DHCP.

The Trivial File Transfer Protocol (TFTP) is used to serve the boot image to the client. Theoretically, any server, on any platform, which implements these protocols, may be used. In the examples in this section, we shall provide commands for SunOS 4.x, SunOS 5.x (a.k.a. Solaris), and GNU/Linux.

4.3.1. Setting up a DHCP server

One free software DHCP server is ISC dhcpd. For Debian GNU/Linux, the dhcp3-server package is recommended. Here is a sample configuration file for it (see /etc/dhcp3/dhcpd.conf):

option domain-name "example.com";
option domain-name-servers ns1.example.com;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
server-name "servername";

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.200 192.168.1.253;
  option routers 192.168.1.1;
}

host clientname {
  filename "/tftpboot.img";
  server-name "servername";
  next-server servername;
  hardware ethernet 01:23:45:67:89:AB;
  fixed-address 192.168.1.90;
}

In this example, there is one server servername which performs all of the work of DHCP server, TFTP server, and network gateway. You will almost certainly need to change the domain-name options, as well as the server name and client hardware address. The filename option should be the name of the file which will be retrieved via TFTP.

After you have edited the dhcpd configuration file, restart it with /etc/init.d/dhcp3-server restart.

4.3.2. Enabling the TFTP Server

To get the TFTP server ready to go, you should first make sure that tftpd is enabled.

In the case of tftpd-hpa there are two ways the service can be run. It can be started on demand by the system's inetd daemon, or it can be set up to run as an independent daemon. Which of these methods is used is selected when the package is installed and can be changed by reconfiguring the package.

Note

Historically, TFTP servers used /tftpboot as directory to serve images from. However, Debian GNU/Linux packages may use other directories to comply with the Filesystem Hierarchy Standard. For example, tftpd-hpa by default uses /srv/tftp. You may have to adjust the configuration examples in this section accordingly.

All in.tftpd alternatives available in Debian should log TFTP requests to the system logs by default. Some of them support a -v argument to increase verbosity. It is recommended to check these log messages in case of boot problems as they are a good starting point for diagnosing the cause of errors.

If you intend to install Debian on an SGI machine and your TFTP server is a GNU/Linux box running Linux 2.4, you'll need to set the following on your server:

# echo 1 > /proc/sys/net/ipv4/ip_no_pmtu_disc

to turn off Path MTU discovery, otherwise the SGI's PROM can't download the kernel. Furthermore, make sure TFTP packets are sent from a source port no greater than 32767, or the download will stall after the first packet. Again, it's Linux 2.4.X tripping this bug in the PROM, and you can avoid it by setting

# echo "2048 32767" > /proc/sys/net/ipv4/ip_local_port_range

to adjust the range of source ports the Linux TFTP server uses.

4.3.3. Move TFTP Images Into Place

Next, place the TFTP boot image you need, as found in Section 4.2.1, “Where to Find Installation Images”, in the tftpd boot image directory. You may have to make a link from that file to the file which tftpd will use for booting a particular client. Unfortunately, the file name is determined by the TFTP client, and there are no strong standards.

4.3.3.1. SGI TFTP Booting

On SGI machines you can rely on the bootpd to supply the name of the TFTP file. It is given either as the bf= in /etc/bootptab or as the filename= option in /etc/dhcpd.conf.