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, or BOOTP
server.
BOOTP is an IP protocol that
informs a computer of its IP address and where on the network to obtain
a boot image.
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.
|
|
For an Ubuntu or Debian GNU/Linux server we recommend
tftpd-hpa .
It's written by the same author as the syslinux
bootloader and is therefore least likely to cause issues.
A good alternative is atftpd .
|
One free software DHCP server is ISC dhcpd.
For Ubuntu, the dhcp3-server package is
recommended. Here is a sample configuration file for it (see
/etc/dhcp3/dhcpd.conf ):
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 .
Enabling PXE Booting in the DHCP configuration
Here is another example for a dhcp.conf using the
Pre-boot Execution Environment (PXE) method of TFTP.
Note that for PXE booting, the client filename pxelinux.0
is a boot loader, not a kernel image (see the section called "Move TFTP Images Into Place”
below).
Setting up a BOOTP server
There are two BOOTP servers available for GNU/Linux. The first is CMU
bootpd. The other is actually a DHCP server: ISC
dhcpd. In Ubuntu these are contained in the
bootp and dhcp3-server
packages respectively.
To use CMU bootpd, you must first uncomment (or
add) the relevant line in /etc/inetd.conf . On
Debian GNU/Linux or Ubuntu, you can run update-inetd --enable
bootps , then /etc/init.d/inetd
reload to do so. Just in case your BOOTP server does not
run Debian or Ubuntu, the line in question should look like:
Now, you must create an /etc/bootptab file. This
has the same sort of familiar and cryptic format as the good old BSD
printcap , termcap , and
disktab files. See the
bootptab manual page for more information. For
CMU bootpd, you will need to know the hardware
(MAC) address of the client. Here is an example
/etc/bootptab :
You will need to change at least the "ha” option, which
specifies the hardware address of the client. The "bf”
option specifies the file a client should retrieve via TFTP; see
the section called "Move TFTP Images Into Place” for more details.
By contrast, setting up BOOTP with ISC dhcpd is
really easy, because it treats BOOTP clients as a moderately special
case of DHCP clients. Some architectures require a complex
configuration for booting clients via BOOTP. If yours is one of
those, read the section the section called "Setting up a DHCP server”. Otherwise you
will probably be able to get away with simply adding the
allow bootp directive to the configuration
block for the subnet containing the client in
/etc/dhcp3/dhcpd.conf , and restart
dhcpd with /etc/init.d/dhcp3-server
restart .
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.
|
|
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 /var/lib/tftpboot . You may have to adjust the
configuration examples in this section accordingly.
|
All in.tftpd alternatives available in Ubuntu 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.
Move TFTP Images Into Place
Next, place the TFTP boot image you need, as found in
the section called "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.
For PXE booting, everything you should need is set up in the
netboot/netboot.tar.gz tarball. Simply extract this
tarball into the tftpd boot image directory. Make sure
your dhcp server is configured to pass pxelinux.0
to tftpd as the filename to boot.
|