xref: /freebsd/share/man/man8/diskless.8 (revision c293f08a325fb3621afc67016f9daae088c5554e)
1247ca3deSSteve Price.\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt
2738d91baSRobert Watson.\" Updated by Luigi Rizzo, Robert Watson
3247ca3deSSteve Price.\" All rights reserved.
4247ca3deSSteve Price.\"
5247ca3deSSteve Price.\" Redistribution and use in source and binary forms, with or without
6247ca3deSSteve Price.\" modification, are permitted provided that the following conditions
7247ca3deSSteve Price.\" are met:
8247ca3deSSteve Price.\" 1. Redistributions of source code must retain the above copyright
9247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer.
10247ca3deSSteve Price.\" 2. Redistributions in binary form must reproduce the above copyright
11247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer in the
12247ca3deSSteve Price.\"    documentation and/or other materials provided with the distribution.
13247ca3deSSteve Price.\" 3. The name of the author may not be used to endorse or promote products
14247ca3deSSteve Price.\"    derived from this software without specific prior written permission.
15247ca3deSSteve Price.\"
16247ca3deSSteve Price.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17247ca3deSSteve Price.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18247ca3deSSteve Price.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19247ca3deSSteve Price.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20247ca3deSSteve Price.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21247ca3deSSteve Price.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22247ca3deSSteve Price.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23247ca3deSSteve Price.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24247ca3deSSteve Price.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25247ca3deSSteve Price.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26950c15fcSAlexey Zelkin.\"
277f3dea24SPeter Wemm.\" $FreeBSD$
28247ca3deSSteve Price.\"
29*c293f08aSRodrigo Osorio.Dd March 6, 2018
30247ca3deSSteve Price.Dt DISKLESS 8
31247ca3deSSteve Price.Os
32247ca3deSSteve Price.Sh NAME
33247ca3deSSteve Price.Nm diskless
34247ca3deSSteve Price.Nd booting a system over the network
35247ca3deSSteve Price.Sh DESCRIPTION
36247ca3deSSteve PriceThe ability to boot a machine over the network is useful for
37950c15fcSAlexey Zelkin.Em diskless
38247ca3deSSteve Priceor
39950c15fcSAlexey Zelkin.Em dataless
40247ca3deSSteve Pricemachines, or as a temporary measure while repairing or
41247ca3deSSteve Pricere-installing file systems on a local disk.
42247ca3deSSteve PriceThis file provides a general description of the interactions between
43247ca3deSSteve Pricea client and its server when a client is booting over the network.
44247ca3deSSteve Price.Sh OPERATION
45247ca3deSSteve PriceWhen booting a system over the network, there are three
46247ca3deSSteve Pricephases of interaction between client and server:
47ace5be68SRuslan Ermilov.Bl -enum
483136363fSRuslan Ermilov.It
49ace5be68SRuslan ErmilovThe stage-1 bootstrap, typically PXE built into your Ethernet
50c2095e2bSMatthew Dilloncard, loads a second-stage boot program.
513136363fSRuslan Ermilov.It
52ace5be68SRuslan ErmilovThe second-stage boot program, typically
53ace5be68SRuslan Ermilov.Xr pxeboot 8 ,
54ace5be68SRuslan Ermilovloads modules and
55ace5be68SRuslan Ermilovthe kernel, and boots the kernel.
563136363fSRuslan Ermilov.It
57ace5be68SRuslan ErmilovThe kernel
58ace5be68SRuslan Ermilov.Tn NFS
59ace5be68SRuslan Ermilovmounts the root directory and continues from there.
60247ca3deSSteve Price.El
61247ca3deSSteve Price.Pp
62247ca3deSSteve PriceEach of these phases are described in further detail below.
63247ca3deSSteve Price.Pp
64ace5be68SRuslan ErmilovFirst, the stage-1 bootstrap loads the stage-2 boot program over
65ace5be68SRuslan Ermilovthe network.
66ace5be68SRuslan ErmilovThe stage-1 bootstrap typically uses
67ace5be68SRuslan Ermilov.Tn BOOTP
68ace5be68SRuslan Ermilovor
69ace5be68SRuslan Ermilov.Tn DHCP
70ace5be68SRuslan Ermilovto obtain the filename to load, then uses
71ace5be68SRuslan Ermilov.Tn TFTP
72ace5be68SRuslan Ermilovto load the file.
73ace5be68SRuslan ErmilovThis file is typically called
74ace5be68SRuslan Ermilov.Pa pxeboot ,
75ace5be68SRuslan Ermilovand should be copied from
76c2095e2bSMatthew Dillon.Pa /boot/pxeboot
77ace5be68SRuslan Ermilovinto the
78ace5be68SRuslan Ermilov.Tn TFTP
79ace5be68SRuslan Ermilovdirectory on the server, which is typically
80c2095e2bSMatthew Dillon.Pa /tftpdir .
81247ca3deSSteve Price.Pp
82c2095e2bSMatthew DillonThe stage-2 boot program then loads additional modules and the kernel.
83ace5be68SRuslan ErmilovThese files may not exist on the
84ace5be68SRuslan Ermilov.Tn DHCP
85ace5be68SRuslan Ermilovor
86ace5be68SRuslan Ermilov.Tn BOOTP
87ace5be68SRuslan Ermilovserver.
88ace5be68SRuslan ErmilovYou can use the
89ace5be68SRuslan Ermilov.Ic next-server
90ace5be68SRuslan Ermilovoption available in
91ace5be68SRuslan Ermilov.Tn DHCP
92ace5be68SRuslan Ermilovconfigurations to specify the server holding
93ace5be68SRuslan Ermilovthe second stage boot files and kernel.
94ace5be68SRuslan ErmilovThe stage-2 program uses
95ace5be68SRuslan Ermilov.Tn NFS
96ace5be68SRuslan Ermilovor
97ace5be68SRuslan Ermilov.Tn TFTP
98ace5be68SRuslan Ermilovto obtain these files.
99ace5be68SRuslan ErmilovBy default,
100ace5be68SRuslan Ermilov.Tn NFS
101ace5be68SRuslan Ermilovis used.
102ace5be68SRuslan ErmilovIf you are using
103ace5be68SRuslan Ermilov.Xr pxeboot 8 ,
104ace5be68SRuslan Ermilovyou can install a version that uses
105ace5be68SRuslan Ermilov.Tn TFTP
106ace5be68SRuslan Ermilovby setting
107ace5be68SRuslan Ermilov.Li LOADER_TFTP_SUPPORT=YES
108c2095e2bSMatthew Dillonin your
10908b91343SYaroslav Tykhiy.Xr make.conf 5 ,
110ace5be68SRuslan Ermilovthen recompiling and reinstalling
111ace5be68SRuslan Ermilov.Xr pxeboot 8
112ace5be68SRuslan Ermilovvia the command listed below.
113ace5be68SRuslan ErmilovIt is often necessary to use
114ace5be68SRuslan Ermilov.Tn TFTP
115ace5be68SRuslan Ermilovhere so you can place a custom kernel
116ace5be68SRuslan Ermilovin
117ace5be68SRuslan Ermilov.Pa /tftpdir/ .
118ace5be68SRuslan ErmilovIf you use
119ace5be68SRuslan Ermilov.Tn NFS
120ace5be68SRuslan Ermilovand do not have a custom root file system for the
121ace5be68SRuslan Ermilov.Nm
122c2095e2bSMatthew Dillonclient, the stage-2 boot will load your server's kernel as the kernel for
123ace5be68SRuslan Ermilovthe
124ace5be68SRuslan Ermilov.Nm
125ace5be68SRuslan Ermilovmachine, which may not be what you want to have happen.
126c2095e2bSMatthew Dillon.Bd -literal -offset indent
127ca987d46SWarner Loshcd /usr/src/stand/i386
128c2095e2bSMatthew Dillonmake clean; make; make install
129c2095e2bSMatthew Dilloncp /boot/pxeboot /tftpdir/
130c2095e2bSMatthew Dillon.Ed
131247ca3deSSteve Price.Pp
132738d91baSRobert WatsonIn phase 3, the kernel acquires IP networking configuration in one
133738d91baSRobert Watsonof two ways, and then proceeds to mount the root file system and start
134738d91baSRobert Watsonoperation.
135bf7f20c2SRuslan ErmilovIf the phase 2 loader supports passing network configuration to the
136738d91baSRobert Watsonkernel using the kernel environment, then the kernel will configure
137738d91baSRobert Watsonthe network interface using that information.
138738d91baSRobert WatsonOtherwise, it must use
139ace5be68SRuslan Ermilov.Tn DHCP
140ace5be68SRuslan Ermilovor
141ace5be68SRuslan Ermilov.Tn BOOTP
142ace5be68SRuslan Ermilovto acquire
143738d91baSRobert Watsonconfiguration information.
144ace5be68SRuslan ErmilovThe boot
145ace5be68SRuslan Ermilovscripts recognize a
146ace5be68SRuslan Ermilov.Nm
147ace5be68SRuslan Ermilovstartup and perform
148c2095e2bSMatthew Dillonthe actions found in
1497cfd02d9SBrooks Davis.Pa /etc/rc.d/resolv ,
1507cfd02d9SBrooks Davis.Pa /etc/rc.d/tmp ,
151fde4d508SCeri Davies.Pa /etc/rc.d/var ,
152c2095e2bSMatthew Dillonand
153fde4d508SCeri Davies.Pa /etc/rc.initdiskless .
154247ca3deSSteve Price.Sh CONFIGURATION
155ace5be68SRuslan ErmilovIn order to run a
156ace5be68SRuslan Ermilov.Nm
157ace5be68SRuslan Ermilovclient, you need the following:
1584f329666SBrian S. Dean.Bl -bullet
1593136363fSRuslan Ermilov.It
160ace5be68SRuslan ErmilovAn
161ace5be68SRuslan Ermilov.Tn NFS
162ace5be68SRuslan Ermilovserver which exports a root and
163ace5be68SRuslan Ermilov.Pa /usr
164ace5be68SRuslan Ermilovpartitions with appropriate permissions.
165ace5be68SRuslan ErmilovThe
166ace5be68SRuslan Ermilov.Nm
167ace5be68SRuslan Ermilovscripts work with read-only partitions, as long as root is exported with
1684f329666SBrian S. Dean.Fl maproot Ns =0
1694f329666SBrian S. Deanso that some system files can be accessed.
1704f329666SBrian S. DeanAs an example,
171247ca3deSSteve Price.Pa /etc/exports
1724f329666SBrian S. Deancan contain the following lines:
1734f329666SBrian S. Dean.Bd -literal -offset indent
17499253b64SDima Dorfman<ROOT> -ro -maproot=0 -alldirs <list of diskless clients>
17599253b64SDima Dorfman/usr -ro -alldirs <list of diskless clients>
176247ca3deSSteve Price.Ed
177247ca3deSSteve Price.Pp
1784f329666SBrian S. Deanwhere
1794f329666SBrian S. Dean.Aq ROOT
1804f329666SBrian S. Deanis the mount point on the server of the root partition.
1814f329666SBrian S. DeanThe script
1824f329666SBrian S. Dean.Pa /usr/share/examples/diskless/clone_root
183ace5be68SRuslan Ermilovcan be used to create a shared read-only root partition,
184c2095e2bSMatthew Dillonbut in many cases you may decide to export
185ace5be68SRuslan Ermilov(again as read-only) the root directory used by
1864f329666SBrian S. Deanthe server itself.
1873136363fSRuslan Ermilov.It
188ace5be68SRuslan ErmilovA
1894f329666SBrian S. Dean.Tn BOOTP
1904f329666SBrian S. Deanor
1914f329666SBrian S. Dean.Tn DHCP
1924f329666SBrian S. Deanserver.
1934f329666SBrian S. Dean.Xr bootpd 8
1944f329666SBrian S. Deancan be enabled by
1954f329666SBrian S. Deanuncommenting the
196ace5be68SRuslan Ermilov.Dq Li bootps
1974f329666SBrian S. Deanline in
1984f329666SBrian S. Dean.Pa /etc/inetd.conf .
1994f329666SBrian S. DeanA sample
2004f329666SBrian S. Dean.Pa /etc/bootptab
2014f329666SBrian S. Deancan be the following:
2024f329666SBrian S. Dean.Bd -literal -offset indent
2034f329666SBrian S. Dean .default:\\
2044f329666SBrian S. Dean    hn:ht=1:vm=rfc1048:\\
2054f329666SBrian S. Dean    :sm=255.255.255.0:\\
2064f329666SBrian S. Dean    :sa=<SERVER>:\\
2074f329666SBrian S. Dean    :gw=<GATEWAY>:\\
2084f329666SBrian S. Dean    :rp="<SERVER>:<ROOT>":
2094f329666SBrian S. Dean
2104f329666SBrian S. Dean<CLIENT>:ha=0123456789ab:tc=.default
211247ca3deSSteve Price.Ed
212247ca3deSSteve Price.Pp
2134f329666SBrian S. Deanwhere
2144f329666SBrian S. Dean.Aq SERVER ,
2154f329666SBrian S. Dean.Aq GATEWAY
2164f329666SBrian S. Deanand
2174f329666SBrian S. Dean.Aq ROOT
2184f329666SBrian S. Deanhave the obvious meanings.
2194f329666SBrian S. Dean.It
220c2095e2bSMatthew DillonA properly initialized root partition.
221c2095e2bSMatthew DillonThe script
222c2095e2bSMatthew Dillon.Pa /usr/share/examples/diskless/clone_root
223c2095e2bSMatthew Dilloncan help in creating it, using the server's root partition
224ace5be68SRuslan Ermilovas a reference.
225ace5be68SRuslan ErmilovIf you are just starting out, you should
226c2095e2bSMatthew Dillonsimply use the server's own root directory,
227c2095e2bSMatthew Dillon.Pa / ,
228c2095e2bSMatthew Dillonand not try to clone it.
2294f329666SBrian S. Dean.Pp
230c2095e2bSMatthew DillonYou often do not want to use the same
231c2095e2bSMatthew Dillon.Pa rc.conf
232c2095e2bSMatthew Dillonor
233c2095e2bSMatthew Dillon.Pa rc.local
234ace5be68SRuslan Ermilovfiles for the
235ace5be68SRuslan Ermilov.Nm
236ace5be68SRuslan Ermilovboot as you do on the server.
237ace5be68SRuslan ErmilovThe
238ace5be68SRuslan Ermilov.Nm
239ace5be68SRuslan Ermilovboot
240c2095e2bSMatthew Dillonscripts provide a mechanism through which you can override various files
241c2095e2bSMatthew Dillonin
2424f329666SBrian S. Dean.Pa /etc
243ace5be68SRuslan Ermilov(as well as other subdirectories of root).
24457e561c0SDoug Barton.Pp
24557e561c0SDoug BartonOne difference that you should pay particular attention to is
24657e561c0SDoug Bartonthe value of
24757e561c0SDoug Barton.Va local_startup
24857e561c0SDoug Bartonin
24957e561c0SDoug Barton.Pa /etc/defaults/rc.conf .
25057e561c0SDoug BartonA typical value for a
25157e561c0SDoug Barton.Nm
25257e561c0SDoug Bartonboot is
25357e561c0SDoug Barton.Va mountcritremote ,
25457e561c0SDoug Bartonhowever your needs may be different.
25557e561c0SDoug Barton.Pp
256ace5be68SRuslan ErmilovThe scripts provide four
257c2095e2bSMatthew Dillonoverriding directories situated in
258c2095e2bSMatthew Dillon.Pa /conf/base ,
259c2095e2bSMatthew Dillon.Pa /conf/default ,
260c2095e2bSMatthew Dillon.Pa /conf/<broadcast-ip> ,
261c2095e2bSMatthew Dillonand
262c2095e2bSMatthew Dillon.Pa /conf/<machine-ip> .
263c2095e2bSMatthew DillonYou should always create
264c2095e2bSMatthew Dillon.Pa /conf/base/etc ,
265c2095e2bSMatthew Dillonwhich will entirely replace the server's
266c2095e2bSMatthew Dillon.Pa /etc
267ace5be68SRuslan Ermilovon the
268ace5be68SRuslan Ermilov.Nm
269ace5be68SRuslan Ermilovmachine.
270c2095e2bSMatthew DillonYou can clone the server's
271c2095e2bSMatthew Dillon.Pa /etc
272ace5be68SRuslan Ermilovhere or you can create a special file which tells the
273ace5be68SRuslan Ermilov.Nm
274ace5be68SRuslan Ermilovboot scripts
275c2095e2bSMatthew Dillonto remount the server's
276c2095e2bSMatthew Dillon.Pa /etc
277c2095e2bSMatthew Dillononto
278c2095e2bSMatthew Dillon.Pa /conf/base/etc .
279c2095e2bSMatthew DillonYou do this by creating the file
280c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount
281ace5be68SRuslan Ermilovcontaining the mount point to use as a basis of the
282ace5be68SRuslan Ermilov.Nm
283ace5be68SRuslan Ermilovmachine's
284c2095e2bSMatthew Dillon.Pa /etc .
285c2095e2bSMatthew DillonFor example, the file might contain:
286c2095e2bSMatthew Dillon.Pp
287ace5be68SRuslan Ermilov.Dl 10.0.0.1:/etc
288ace5be68SRuslan Ermilov.Pp
28961fffde1SMike PritchardAlternatively, if the server contains several independent roots, the file
290a8365995SBrooks Davismight contain:
291a8365995SBrooks Davis.Pp
292a8365995SBrooks Davis.Dl 10.0.0.1:/usr/diskless/4.7-RELEASE/etc
293a8365995SBrooks Davis.Pp
294a8365995SBrooks DavisThis would work, but if you copied
295a8365995SBrooks Davis.Pa /usr/diskless/4.7-RELEASE
296a8365995SBrooks Davisto
297a8365995SBrooks Davis.Pa /usr/diskless/4.8-RELEASE
298a8365995SBrooks Davisand upgraded the installation, you would need to modify the
299a8365995SBrooks Davis.Pa diskless_remount
300a8365995SBrooks Davisfiles to reflect that move.
301a8365995SBrooks DavisTo avoid that, paths in
302a8365995SBrooks Davis.Pa diskless_remount
30361fffde1SMike Pritchardfiles beginning with
304a8365995SBrooks Davis.Pa /
305a8365995SBrooks Davishave the actual path of the client's root prepended to them so the file
306a8365995SBrooks Daviscould instead contain:
307a8365995SBrooks Davis.Pp
308a8365995SBrooks Davis.Dl /etc
309a8365995SBrooks Davis.Pp
310ace5be68SRuslan ErmilovThe
311ace5be68SRuslan Ermilov.Nm
31261fffde1SMike Pritchardscripts create memory file systems to hold the overridden
313ace5be68SRuslan Ermilovdirectories.
314*c293f08aSRodrigo OsorioOnly a 5MB partition is created by default, which may not
315ace5be68SRuslan Ermilovbe sufficient for your purposes.
316ace5be68SRuslan ErmilovTo override this, you can create the
317c2095e2bSMatthew Dillonfile
318c2095e2bSMatthew Dillon.Pa /conf/base/etc/md_size
319c2095e2bSMatthew Dilloncontaining the size, in 512 byte sectors, of the memory disk to create
320c2095e2bSMatthew Dillonfor that directory.
321c2095e2bSMatthew Dillon.Pp
322c2095e2bSMatthew DillonYou then typically provide file-by-file overrides in the
323c2095e2bSMatthew Dillon.Pa /conf/default/etc
324ace5be68SRuslan Ermilovdirectory.
325ace5be68SRuslan ErmilovAt a minimum, you must provide overrides for
326ace5be68SRuslan Ermilov.Pa /etc/fstab , /etc/rc.conf ,
327c2095e2bSMatthew Dillonand
328c2095e2bSMatthew Dillon.Pa /etc/rc.local
329c2095e2bSMatthew Dillonvia
330ace5be68SRuslan Ermilov.Pa /conf/default/etc/fstab , /conf/default/etc/rc.conf ,
331c2095e2bSMatthew Dillonand
332c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local .
333c2095e2bSMatthew Dillon.Pp
334ace5be68SRuslan ErmilovOverrides are hierarchical.
335ace5be68SRuslan ErmilovYou can supply network-specific defaults
336c2095e2bSMatthew Dillonin the
337ace5be68SRuslan Ermilov.Pa /conf/ Ns Ao Ar BROADCASTIP Ac Ns Pa /etc
338ace5be68SRuslan Ermilovdirectory, where
339ace5be68SRuslan Ermilov.Aq Ar BROADCASTIP
340ace5be68SRuslan Ermilovrepresents the broadcast IP address of
341ace5be68SRuslan Ermilovthe
342ace5be68SRuslan Ermilov.Nm
343ace5be68SRuslan Ermilovsystem as given to it via
344c2095e2bSMatthew Dillon.Tn BOOTP .
345c2095e2bSMatthew DillonThe
346c2095e2bSMatthew Dillon.Pa diskless_remount
347c2095e2bSMatthew Dillonand
348c2095e2bSMatthew Dillon.Pa md_size
349c2095e2bSMatthew Dillonfeatures work in any of these directories.
350c2095e2bSMatthew DillonThe configuration feature works on directories other then
351c2095e2bSMatthew Dillon.Pa /etc ,
352c2095e2bSMatthew Dillonyou simply create the directory you wish to replace or override in
353c2095e2bSMatthew Dillon.Pa /conf/{base,default,<broadcast>,<ip>}/*
354c2095e2bSMatthew Dillonand work it in the same way that you work
355c2095e2bSMatthew Dillon.Pa /etc .
356c2095e2bSMatthew Dillon.Pp
357c2095e2bSMatthew DillonSince you normally clone the server's
358c2095e2bSMatthew Dillon.Pa /etc
359c2095e2bSMatthew Dillonusing the
360c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount ,
361ace5be68SRuslan Ermilovyou might wish to remove unneeded files from the memory file system.
362ace5be68SRuslan ErmilovFor example,
363ace5be68SRuslan Ermilovif the server has a firewall but you do not, you might wish
364c2095e2bSMatthew Dillonto remove
365c2095e2bSMatthew Dillon.Pa /etc/ipfw.conf .
366c2095e2bSMatthew DillonYou can do this by creating a
367ace5be68SRuslan Ermilov.Pa /conf/base/ Ns Ao Ar DIRECTORY Ac Ns Pa .remove
368ace5be68SRuslan Ermilovfile.
369ace5be68SRuslan ErmilovFor example,
370c2095e2bSMatthew Dillon.Pa /conf/base/etc.remove ,
371c2095e2bSMatthew Dillonwhich contains a list of relative paths that the boot scripts should remove
372c2095e2bSMatthew Dillonfrom the memory file systems.
3734f329666SBrian S. Dean.Pp
3744f329666SBrian S. DeanAs a minimum, you normally need to have the following in
3754f329666SBrian S. Dean.Pa /conf/default/etc/fstab
3764f329666SBrian S. Dean.Bd -literal -offset indent
3774f329666SBrian S. Dean<SERVER>:<ROOT> /     nfs    ro 0 0
3784f329666SBrian S. Dean<SERVER>:/usr   /usr  nfs    ro 0 0
3794f329666SBrian S. Dean.Ed
3804f329666SBrian S. Dean.Pp
381c2095e2bSMatthew DillonYou also need to create a customized version of
3824f329666SBrian S. Dean.Pa /conf/default/etc/rc.conf
3834f329666SBrian S. Deanwhich should contain
384ace5be68SRuslan Ermilovthe startup options for the
385ace5be68SRuslan Ermilov.Nm
386ace5be68SRuslan Ermilovclient, and
387c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local
388c2095e2bSMatthew Dillonwhich could be empty but prevents the server's own
389c2095e2bSMatthew Dillon.Pa /etc/rc.local
390ace5be68SRuslan Ermilovfrom leaking onto the
391ace5be68SRuslan Ermilov.Nm
392ace5be68SRuslan Ermilovsystem.
3934f329666SBrian S. Dean.Pp
394c2095e2bSMatthew DillonIn
395c2095e2bSMatthew Dillon.Pa rc.conf ,
396c2095e2bSMatthew Dillonmost likely
3974f329666SBrian S. Deanyou will not need to set
3984f329666SBrian S. Dean.Va hostname
3994f329666SBrian S. Deanand
4004f329666SBrian S. Dean.Va ifconfig_*
4014f329666SBrian S. Deanbecause these will be already set by the startup code.
4024f329666SBrian S. DeanFinally, it might be convenient to use a
4034f329666SBrian S. Dean.Ic case
4044f329666SBrian S. Deanstatement using
4054f329666SBrian S. Dean.Li `hostname`
4064f329666SBrian S. Deanas the switch variable to do machine-specific configuration
407ace5be68SRuslan Ermilovin case a number of
408ace5be68SRuslan Ermilov.Nm
409ace5be68SRuslan Ermilovclients share the same configuration
4104f329666SBrian S. Deanfiles.
4114f329666SBrian S. Dean.It
412ace5be68SRuslan ErmilovThe kernel for the
413ace5be68SRuslan Ermilov.Nm
414ace5be68SRuslan Ermilovclients, which will be loaded using
415ace5be68SRuslan Ermilov.Tn NFS
416ace5be68SRuslan Ermilovor
417ace5be68SRuslan Ermilov.Tn TFTP ,
418738d91baSRobert Watsonmust include support for the NFS client:
419738d91baSRobert Watson.Pp
4206c8ea37cSRick Macklem.D1 Cd "options NFSCL"
421738d91baSRobert Watson.D1 Cd "options NFS_ROOT"
422738d91baSRobert Watson.Pp
423738d91baSRobert WatsonIf you are using a boot mechanism that does not pass network configuration
424738d91baSRobert Watsonto the kernel using the kernel environment, you will also need to include
425738d91baSRobert Watsonthe following options:
426ace5be68SRuslan Ermilov.Pp
427ace5be68SRuslan Ermilov.D1 Cd "options BOOTP"
428ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_NFSROOT"
429ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_COMPAT"
4304f329666SBrian S. Dean.Pp
431bf7f20c2SRuslan Ermilov.Em Note :
432bf7f20c2SRuslan Ermilovthe PXE environment does not require these options.
433738d91baSRobert Watson.Pp
434bf7f20c2SRuslan ErmilovThe
435bf7f20c2SRuslan Ermilov.Nm
436bf7f20c2SRuslan Ermilovbooting environment relies on memory-backed file systems to
437738d91baSRobert Watsonsupport temporary local storage in the event that the root file system
438738d91baSRobert Watsonis mounted read-only; as such, it is necessary to add the following
439738d91baSRobert Watsonto the device section of the kernel configuration:
440c2095e2bSMatthew Dillon.Pp
441ace5be68SRuslan Ermilov.D1 Cd "device md"
442ace5be68SRuslan Ermilov.Pp
443ace5be68SRuslan ErmilovIf you use the firewall, remember to default to
444ace5be68SRuslan Ermilov.Dq open ,
445ace5be68SRuslan Ermilovor your kernel
446ace5be68SRuslan Ermilovwill not be able to send/receive the
447ace5be68SRuslan Ermilov.Tn BOOTP
448ace5be68SRuslan Ermilovpackets.
449247ca3deSSteve Price.El
4504f329666SBrian S. Dean.Sh SECURITY ISSUES
451ace5be68SRuslan ErmilovBe warned that using unencrypted
452ace5be68SRuslan Ermilov.Tn NFS
453ace5be68SRuslan Ermilovto mount root and user
4544f329666SBrian S. Deanpartitions may expose information such as
4554f329666SBrian S. Deanencryption keys.
4569cbda590SRuslan Ermilov.Sh SEE ALSO
4579cbda590SRuslan Ermilov.Xr ethers 5 ,
4589cbda590SRuslan Ermilov.Xr exports 5 ,
45908b91343SYaroslav Tykhiy.Xr make.conf 5 ,
46078ad5421SRuslan Ermilov.Xr bootpd 8 ,
4619cbda590SRuslan Ermilov.Xr mountd 8 ,
4629cbda590SRuslan Ermilov.Xr nfsd 8 ,
4639cbda590SRuslan Ermilov.Xr pxeboot 8 ,
4649cbda590SRuslan Ermilov.Xr reboot 8 ,
4659cbda590SRuslan Ermilov.Xr tftpd 8
4669cbda590SRuslan Ermilov.Pp
4679cbda590SRuslan Ermilov.Pa ports/net/etherboot
4684f329666SBrian S. Dean.Sh BUGS
4694f329666SBrian S. DeanThis manpage is probably incomplete.
4704f329666SBrian S. Dean.Pp
4714f329666SBrian S. Dean.Fx
4724f329666SBrian S. Deansometimes requires to write onto
473c2095e2bSMatthew Dillonthe root partition, so the startup scripts mount MFS
4744f329666SBrian S. Deanfile systems on some locations (e.g.\&
4754f329666SBrian S. Dean.Pa /etc
4764f329666SBrian S. Deanand
4774f329666SBrian S. Dean.Pa /var ) ,
4784f329666SBrian S. Deanwhile
4794f329666SBrian S. Deantrying to preserve the original content.
4804f329666SBrian S. DeanThe process might not handle all cases.
481