3
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
<title>4.5. Preparing Files for TFTP Net Booting</title>
5
<link rel="stylesheet" type="text/css" href="install.css">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7
<link rel="home" href="index.html" title="Ubuntu Installation Guide">
8
<link rel="up" href="ch04.html" title="Chapter 4. Obtaining System Installation Media">
9
<link rel="prev" href="ch04s04.html" title="4.4. Preparing Files for Hard Disk Booting">
10
<link rel="next" href="ch04s06.html" title="4.6. Automatic Installation">
12
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13
<div class="navheader">
14
<table width="100%" summary="Navigation header">
15
<tr><th colspan="3" align="center">4.5. Preparing Files for TFTP Net Booting</th></tr>
17
<td width="20%" align="left">
18
<a accesskey="p" href="ch04s04.html"><img src="images/prev.png" alt="Prev"></a> </td>
19
<th width="60%" align="center">Chapter 4. Obtaining System Installation Media</th>
20
<td width="20%" align="right"> <a accesskey="n" href="ch04s06.html"><img src="images/next.png" alt="Next"></a>
27
<div class="titlepage"><div><div><h2 class="title">
28
<a name="install-tftp"></a>4.5. Preparing Files for TFTP Net Booting</h2></div></div></div>
31
If your machine is connected to a local area network, you may be able
32
to boot it over the network from another machine, using TFTP. If you
33
intend to boot the installation system from another machine, the
34
boot files will need to be placed in specific locations on that machine,
35
and the machine configured to support booting of your specific machine.
40
You need to set up a TFTP server, and for many machines a DHCP
41
server<span class="phrase">, or BOOTP
49
<span class="phrase">BOOTP is an IP protocol that
50
informs a computer of its IP address and where on the network to obtain
53
The DHCP (Dynamic Host Configuration Protocol) is a more flexible,
54
backwards-compatible extension of BOOTP.
55
Some systems can only be configured via DHCP.
60
The Trivial File Transfer Protocol (TFTP) is used to serve the boot
61
image to the client. Theoretically, any server, on any platform,
62
which implements these protocols, may be used. In the examples in
63
this section, we shall provide commands for SunOS 4.x, SunOS 5.x
64
(a.k.a. Solaris), and GNU/Linux.
67
<div class="note"><table border="0" summary="Note">
69
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
70
<th align="left">Note</th>
72
<tr><td align="left" valign="top"><p>
74
For an Ubuntu or Debian server we recommend
75
<code class="classname">tftpd-hpa</code>.
76
It's written by the same author as the <code class="classname">syslinux</code>
77
bootloader and is therefore least likely to cause issues.
78
A good alternative is <code class="classname">atftpd</code>.
86
<div class="titlepage"><div><div><h3 class="title">
87
<a name="dhcpd"></a>4.5.1. Setting up a DHCP server</h3></div></div></div>
90
One free software DHCP server is ISC <span class="command"><strong>dhcpd</strong></span>.
91
For Ubuntu, the <code class="classname">isc-dhcp-server</code> package is
92
recommended. Here is a sample configuration file for it (see
93
<code class="filename">/etc/dhcp/dhcpd.conf</code>):
96
<div class="informalexample"><pre class="screen">
97
option domain-name "example.com";
98
option domain-name-servers ns1.example.com;
99
option subnet-mask 255.255.255.0;
100
default-lease-time 600;
102
server-name "servername";
104
subnet 192.168.1.0 netmask 255.255.255.0 {
105
range 192.168.1.200 192.168.1.253;
106
option routers 192.168.1.1;
110
filename "/tftpboot.img";
111
server-name "servername";
112
next-server servername;
113
hardware ethernet 01:23:45:67:89:AB;
114
fixed-address 192.168.1.90;
122
In this example, there is one server
123
<em class="replaceable"><code>servername</code></em> which performs all of the work
124
of DHCP server, TFTP server, and network gateway. You will almost
125
certainly need to change the domain-name options, as well as the
126
server name and client hardware address. The
127
<em class="replaceable"><code>filename</code></em> option should be the name of the
128
file which will be retrieved via TFTP.
133
After you have edited the <span class="command"><strong>dhcpd</strong></span> configuration file,
134
restart it with <strong class="userinput"><code>/etc/init.d/isc-dhcp-server restart</code></strong>.
138
<div class="titlepage"><div><div><h4 class="title">
139
<a name="idm961"></a>4.5.1.1. Enabling PXE Booting in the DHCP configuration</h4></div></div></div>
141
Here is another example for a <code class="filename">dhcp.conf</code> using the
142
Pre-boot Execution Environment (PXE) method of TFTP.
145
<div class="informalexample"><pre class="screen">
146
option domain-name "example.com";
148
default-lease-time 600;
154
# The next paragraph needs to be modified to fit your case
155
subnet 192.168.1.0 netmask 255.255.255.0 {
156
range 192.168.1.200 192.168.1.253;
157
option broadcast-address 192.168.1.255;
158
# the gateway address which can be different
159
# (access to the internet for instance)
160
option routers 192.168.1.1;
161
# indicate the dns you want to use
162
option domain-name-servers 192.168.1.3;
166
next-server 192.168.1.3;
168
# tftp client hardware address
169
hardware ethernet 00:10:DC:27:6C:15;
170
filename "pxelinux.0";
176
Note that for PXE booting, the client filename <code class="filename">pxelinux.0</code>
177
is a boot loader, not a kernel image (see <a class="xref" href="ch04s05.html#tftp-images" title="4.5.4. Move TFTP Images Into Place">Section 4.5.4, “Move TFTP Images Into Place”</a>
184
<div class="titlepage"><div><div><h3 class="title">
185
<a name="tftp-bootp"></a>4.5.2. Setting up a BOOTP server</h3></div></div></div>
188
There are two BOOTP servers available for GNU/Linux. The first is CMU
189
<span class="command"><strong>bootpd</strong></span>. The other is actually a DHCP server: ISC
190
<span class="command"><strong>dhcpd</strong></span>. In Ubuntu these are contained in the
191
<code class="classname">bootp</code> and <code class="classname">isc-dhcp-server</code>
192
packages respectively.
197
To use CMU <span class="command"><strong>bootpd</strong></span>, you must first uncomment (or
198
add) the relevant line in <code class="filename">/etc/inetd.conf</code>. On
199
Debian or Ubuntu, you can run <strong class="userinput"><code>update-inetd --enable
200
bootps</code></strong>, then <strong class="userinput"><code>/etc/init.d/inetd
201
reload</code></strong> to do so. Just in case your BOOTP server does not
202
run Debian or Ubuntu, the line in question should look like:
205
<div class="informalexample"><pre class="screen">
206
bootps dgram udp wait root /usr/sbin/bootpd bootpd -i -t 120
210
Now, you must create an <code class="filename">/etc/bootptab</code> file. This
211
has the same sort of familiar and cryptic format as the good old BSD
212
<code class="filename">printcap</code>, <code class="filename">termcap</code>, and
213
<code class="filename">disktab</code> files. See the
214
<code class="filename">bootptab</code> manual page for more information. For
215
CMU <span class="command"><strong>bootpd</strong></span>, you will need to know the hardware
216
(MAC) address of the client. Here is an example
217
<code class="filename">/etc/bootptab</code>:
220
<div class="informalexample"><pre class="screen">
231
You will need to change at least the <span class="quote">“<span class="quote">ha</span>”</span> option, which
232
specifies the hardware address of the client. The <span class="quote">“<span class="quote">bf</span>”</span>
233
option specifies the file a client should retrieve via TFTP; see
234
<a class="xref" href="ch04s05.html#tftp-images" title="4.5.4. Move TFTP Images Into Place">Section 4.5.4, “Move TFTP Images Into Place”</a> for more details.
241
By contrast, setting up BOOTP with ISC <span class="command"><strong>dhcpd</strong></span> is
242
really easy, because it treats BOOTP clients as a moderately special
243
case of DHCP clients. Some architectures require a complex
244
configuration for booting clients via BOOTP. If yours is one of
245
those, read the section <a class="xref" href="ch04s05.html#dhcpd" title="4.5.1. Setting up a DHCP server">Section 4.5.1, “Setting up a DHCP server”</a>. Otherwise you
246
will probably be able to get away with simply adding the
247
<strong class="userinput"><code>allow bootp</code></strong> directive to the configuration
248
block for the subnet containing the client in
249
<code class="filename">/etc/dhcp/dhcpd.conf</code>, and restart
250
<span class="command"><strong>dhcpd</strong></span> with <strong class="userinput"><code>/etc/init.d/isc-dhcp-server
251
restart</code></strong>.
256
<div class="titlepage"><div><div><h3 class="title">
257
<a name="tftpd"></a>4.5.3. Enabling the TFTP Server</h3></div></div></div>
260
To get the TFTP server ready to go, you should first make sure that
261
<span class="command"><strong>tftpd</strong></span> is enabled.
266
In the case of <code class="classname">tftpd-hpa</code> there are two ways the
267
service can be run. It can be started on demand by the system's
268
<code class="classname">inetd</code> daemon, or it can be set up to run as an
269
independent daemon. Which of these methods is used is selected when the
270
package is installed and can be changed by reconfiguring the package.
273
<div class="note"><table border="0" summary="Note">
275
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
276
<th align="left">Note</th>
278
<tr><td align="left" valign="top"><p>
280
Historically, TFTP servers used <code class="filename">/tftpboot</code> as directory
281
to serve images from. However, Ubuntu packages may use other directories
282
to comply with the <a class="ulink" href="http://www.pathname.com/fhs/" target="_top">Filesystem Hierarchy
283
Standard</a>. For example, <code class="classname">tftpd-hpa</code> by default
284
uses <code class="filename">/srv/tftp</code>. You may have to adjust the
285
configuration examples in this section accordingly.
291
All <span class="command"><strong>in.tftpd</strong></span> alternatives available in Ubuntu should
292
log TFTP requests to the system logs by default. Some of them support a
293
<strong class="userinput"><code>-v</code></strong> argument to increase verbosity.
294
It is recommended to check these log messages in case of boot problems
295
as they are a good starting point for diagnosing the cause of errors.
300
<div class="titlepage"><div><div><h3 class="title">
301
<a name="tftp-images"></a>4.5.4. Move TFTP Images Into Place</h3></div></div></div>
304
Next, place the TFTP boot image you need, as found in
305
<a class="xref" href="ch04s02.html#where-files" title="4.2.1. Where to Find Installation Images">Section 4.2.1, “Where to Find Installation Images”</a>, in the <span class="command"><strong>tftpd</strong></span>
306
boot image directory. You may have to make a link from that
307
file to the file which <span class="command"><strong>tftpd</strong></span> will use for booting a
308
particular client. Unfortunately, the file name is determined by the
309
TFTP client, and there are no strong standards.
314
For PXE booting, everything you should need is set up in the
315
<code class="filename">netboot/netboot.tar.gz</code> tarball. Simply extract this
316
tarball into the <span class="command"><strong>tftpd</strong></span> boot image directory. Make sure
317
your dhcp server is configured to pass <code class="filename">pxelinux.0</code>
318
to <span class="command"><strong>tftpd</strong></span> as the filename to boot.
323
<div class="navfooter">
325
<table width="100%" summary="Navigation footer">
327
<td width="40%" align="left">
328
<a accesskey="p" href="ch04s04.html"><img src="images/prev.png" alt="Prev"></a> </td>
329
<td width="20%" align="center"><a accesskey="u" href="ch04.html"><img src="images/up.png" alt="Up"></a></td>
330
<td width="40%" align="right"> <a accesskey="n" href="ch04s06.html"><img src="images/next.png" alt="Next"></a>
334
<td width="40%" align="left" valign="top">4.4. Preparing Files for Hard Disk Booting </td>
335
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td>
336
<td width="40%" align="right" valign="top"> 4.6. Automatic Installation</td>