1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
.TH DHCPD 8
.SH NAME
dhcpd, dhcp6d, dhcpleases, rarpd, tftpd \- Internet booting
.SH SYNOPSIS
.PP
.B ip/dhcpd
.RB [ -dmnprsSZ ]
.RB [ -h
.IR homedir ]
.RB [ -f
.IR ndbfile ]
.RB [ -M
.IR secs ]
.RB [ -x
.IR netmtpt ]
.RB [ -Z
.IR secs ]
[
.I address
.I n
] ...
.PP
.B ip/dhcpleases
.PP
.B ip/dhcp6d
.RB [ -d ]
.RB [ -f
.IR ndbfile ]
.RB [ -x
.IR netmtpt ]
.PP
.B ip/rarpd
.RB [ -d ]
.RB [ -e
.IR etherdev ]
.RB [ -x
.IR netmtpt ]
.PP
.B ip/tftpd
.RB [ -dr ]
.RB [ -h
.IR homedir ]
.RB [ -x
.IR netmtpt ]
.SH DESCRIPTION
These programs support booting over the Internet.
They should all be run on the same server to
allow other systems to be booted.
.IR Dhcpd ,
.I dhcp6d
and
.I tftpd
are used to boot everything;
.I rarpd
is an extra piece just for Suns.
.PP
.I Dhcpd
runs the
.SM BOOTP
and
.SM DHCP
protocols.
Clients use these protocols to obtain configuration information.
This information comes from attribute/value pairs in the network database
(see
.IR ndb (6)
and
.IR ndb (8)).
DHCP requests are honored both for static addresses found in
the NDB and for dynamic addresses listed in the command line.
DHCP requests are honored if either:
.br
\- there exists an NDB entry
containing both the ethernet address of the requester and
an IP address on the originating network or subnetwork.
.br
\- a free dynamic address exists on the originating network or subnetwork.
.PP
A BOOTP request is honored if all of the following are true:
.br
\- there exists an NDB entry
containing both the ethernet address of the requester and
an IP address on the originating network or subnetwork.
.br
\- the entry contains a
.B bootf=
attribute
.br
\- the file in the
.B bootf=
attribute is readable.
.PP
Dynamic addresses are specified on the command line as a list
of addresses and number pairs.
For example,
.EX
ip/dhcpd 10.1.1.12 10 10.2.1.70 12
.EE
directs
.I dhcpd
to return dynamic addresses 10.1.1.12 through 10.1.1.21 inclusive
and 10.2.1.70 through 10.2.1.81 inclusive.
.PP
.I Dhcpd
maintains a record of all dynamic addresses in the directory
.BR /lib/ndb/dhcp ,
one file per address.
If multiple servers have access to this common directory,
they will correctly coordinate their actions.
.PP
Attributes come from either the NDB entry for the system, the entry for its
subnet, or the entry for its network. The system entry has precedence,
then the subnet, then the network.
The NDB attributes used are:
.TF rootserver
.TP
.B ip
the IP address
.TP
.B ipmask
the IP mask
.TP
.B ipgw
the default IP gateway
.TP
.B dom
the domain name of the system
.TP
.B fs
the default Plan 9 file server
.TP
.B auth
the default Plan 9 authentication server
.TP
.B dns
a domain name server
.TP
.B ntp
a network time protocol server
.TP
.B time
a time server
.TP
.B wins
a
.SM NETBIOS
name server
.TP
.B www
a World Wide Web proxy
.TP
.B pop3
a POP3 mail server
.TP
.B smtp
an SMTP mail server
.TP
.B bootf
the default boot file;
see
.IR ndb (6)
.TP
.B tftp
the TFTP server to fetch
.I bootf
from
.TP
.B rootpath
the NFS root for unix machines
.TP
.B rootserver
the NFS server used with
.I rootpath
.TP
.B vendor
Specific vendor attribute for dhcp and bootp
.PD
.PP
.I Dhcpd
will answer
.SM BOOTP
requests only if it has been specifically targeted or if it
has read access to the boot file for the requester. That means that the requester
must specify a boot file in the request or one has to exist in NDB for
.I dhcpd
to answer.
.I Dhcpd
will answer all
.SM DHCP
requests for which it can associate an IP address with the
requester.
The options are:
.TP
.B d
Print debugging to standard output.
.TP
.B h
Change directory to
.IR homedir .
The default is
.BR / .
This should match the
.I homedir
setting of
.I tftpd
so that the existence check of non-rooted file names
is consistent.
.TP
.B f
Specify a file other than
.B /lib/ndb/local
as the network database.
.TP
.B m
Mute: don't reply to requests, just log them and what
.I dhcpd
would have done.
.TP
.B M
Use
.I secs
as the minimum lease time for dynamic addresses.
.TP
.B n
Don't answer
.SM BOOTP
requests.
.TP
.B p
Answer
.SM DHCP
requests from
.SM PPTP
clients only.
.TP
.B r
Mute static addresses: don't reply to requests for static addresses,
just log them and what
.I dhcpd
would have done.
.TP
.B s
Sleep 2 seconds before answering requests for static addresses.
This is used to make a server be a backup only.
.TP
.B S
Sleep 2 seconds before answering requests for dynamic addresses.
.TP
.B x
The IP stack to use is mounted at
.IR netmtpt .
The default is
.BR /net .
.TP
.B Z
Use
.I secs
as the minimum lease time for static addresses.
.PD
.PP
.I Dhcp6d
provides DHCPv6 service for IPv6 clients. Only network boot and
DNS parameters are supported.
.PP
.I Dhcpleases
prints out the currently valid DHCP leases found in the
.B /lib/ndb/dhcp
directory.
.PP
.I Rarpd
performs the Reverse Address Resolution Protocol, translating
Ethernet addresses into IP addresses.
The options are:
.TP
.B d
Print debugging to standard output.
.TP
.B e
Use the Ethernet mounted at
.BI /net/ etherdev\f1.
.TP
.B x
The IP stack to use is mounted at
.IR netmtpt .
The default is
.BR /net .
.PD
.PP
.I Tftpd
transfers files to systems that are booting.
It runs as user
.B none
and can only access files with global read permission.
The options are:
.TP
.B d
Print debugging to standard output.
.TP
.B x
The IP stack to use is mounted at
.IR netmtpt .
The default is
.BR /net .
.TP
.B h
Change directory to
.IR homedir .
The default is
.BR / .
All requests for files with non-rooted file names are served starting at this
directory. This needs to be consistent with the
.I homedir
setting of
.IR dhcpd .
.I Tftpd
supports only octet mode.
.TP
.B r
Restricts access to only those files rooted in the
.IR homedir .
.PD
.SH FILES
.BR /lib/ndb/dhcp " directory of dynamic address files
.SH SOURCE
.B /sys/src/cmd/ip
.SH "SEE ALSO"
.IR ndb (6),
.IR booting (8)
|