xref: /netbsd-src/share/man/man8/diskless.8 (revision bd01c08b37a06ee5e2ca6a8d7b61a80411ec7b9b)
1*bd01c08bSwiz.\"	$NetBSD: diskless.8,v 1.34 2018/10/29 21:04:18 wiz Exp $
2a99b93e3Sderaadt.\"
3a99b93e3Sderaadt.\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt
4a99b93e3Sderaadt.\" All rights reserved.
5a99b93e3Sderaadt.\"
6a99b93e3Sderaadt.\" Redistribution and use in source and binary forms, with or without
7a99b93e3Sderaadt.\" modification, are permitted provided that the following conditions
8a99b93e3Sderaadt.\" are met:
9a99b93e3Sderaadt.\" 1. Redistributions of source code must retain the above copyright
10a99b93e3Sderaadt.\"    notice, this list of conditions and the following disclaimer.
11a99b93e3Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
12a99b93e3Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
13a99b93e3Sderaadt.\"    documentation and/or other materials provided with the distribution.
14a99b93e3Sderaadt.\" 3. The name of the author may not be used to endorse or promote products
15a99b93e3Sderaadt.\"    derived from this software without specific prior written permission.
16a99b93e3Sderaadt.\"
17a99b93e3Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18a99b93e3Sderaadt.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19a99b93e3Sderaadt.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20a99b93e3Sderaadt.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21a99b93e3Sderaadt.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22a99b93e3Sderaadt.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23a99b93e3Sderaadt.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24a99b93e3Sderaadt.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25a99b93e3Sderaadt.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26a99b93e3Sderaadt.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27a99b93e3Sderaadt.\"
285ee2540bSmrg.Dd October 23, 2018
29a99b93e3Sderaadt.Dt DISKLESS 8
3039b11db8Sgarbled.Os
31a99b93e3Sderaadt.Sh NAME
32a99b93e3Sderaadt.Nm diskless
33a99b93e3Sderaadt.Nd booting a system over the network
34a99b93e3Sderaadt.Sh DESCRIPTION
353e3e5cecSfairThe ability to boot a system over the network is useful for
363e3e5cecSfairtwo kinds of systems:
373e3e5cecSfair.Bl -tag -width diskless
383e3e5cecSfair.It Em diskless
393e3e5cecSfaira system with no attached mass storage media to boot or run from
403e3e5cecSfair.Pq e.g. a network computer .
413e3e5cecSfair.It Em dataless
423e3e5cecSfaira system with a hard drive that only contains system and application
433e3e5cecSfairsoftware, and user data is mounted over the network from a central server.
443e3e5cecSfair.El
453e3e5cecSfair.Pp
463e3e5cecSfairIt can also be done as a temporary measure while repairing or
47a99b93e3Sderaadtre-installing file systems on a local disk.
483e3e5cecSfairThis capability is necessarily platform dependent because of its
493e3e5cecSfairdependence on system firmware support; not all platforms supported by
503e3e5cecSfair.Nx
513e3e5cecSfairare capable of being network booted.
523e3e5cecSfair.Pp
533e3e5cecSfairThe protocols used to obtain a network address
543e3e5cecSfair.Pq e.g. an Tn \&IP host address ,
553e3e5cecSfairinclude, but are not limited to:
563e3e5cecSfair.Pp
573e3e5cecSfair.Bl -tag -width BOOTP -offset indent -compact
583e3e5cecSfair.It Tn RARP
593e3e5cecSfairReverse Address Resolution Protocol
603e3e5cecSfair.Pq Tn ARP
613e3e5cecSfair.It Tn DHCP
623e3e5cecSfairDynamic Host Configuration Protocol
633e3e5cecSfair.It Tn BOOTP
643e3e5cecSfairBootstrap Protocol
653e3e5cecSfair.El
663e3e5cecSfair.Pp
673e3e5cecSfairThis information can also be derived from non-volatile
683e3e5cecSfair.Tn RAM
693e3e5cecSfairor by a transform of a network interface
703e3e5cecSfair.Pq e.g. Tn Ethernet
713e3e5cecSfair.Tn MAC
723e3e5cecSfairaddress.
733e3e5cecSfair.Pp
743e3e5cecSfairThe protocols used to load a
753e3e5cecSfair.Nx
763e3e5cecSfairkernel over a network include, but are not limited to:
773e3e5cecSfair.Pp
783e3e5cecSfair.Bl -tag -width TFTP -offset indent -compact
793e3e5cecSfair.It Tn TFTP
803e3e5cecSfairTrivial File Transfer Protocol
813e3e5cecSfair.It Tn NFS
823e3e5cecSfair.Tn Sun
833e3e5cecSfairNetwork File System
843e3e5cecSfair.It Tn RMP
853e3e5cecSfair.Tn \&HP
863e3e5cecSfairRemote Maintenance Protocol
873e3e5cecSfair.It Tn MOP
883e3e5cecSfair.Tn DEC
893e3e5cecSfairMaintenance Operations Protocol
903e3e5cecSfair.El
913e3e5cecSfair.Pp
923e3e5cecSfairDerivation of the filename of the secondary bootstrap program can
933e3e5cecSfairbe done by a transform of a network interface
943e3e5cecSfair.Tn MAC
953e3e5cecSfairaddress
963e3e5cecSfair.Pq or other protocol address ,
973e3e5cecSfairor provided by a server as with
983e3e5cecSfair.Tn BOOTP ,
993e3e5cecSfairand
1003e3e5cecSfair.Tn DHCP .
1013e3e5cecSfairHow this is done is platform dependent; see
1023e3e5cecSfair.Xr boot 8 .
1033e3e5cecSfair.Pp
1043e3e5cecSfairThe
1053e3e5cecSfair.Nx
1063e3e5cecSfairkernel doesn't care how it gets loaded and started.
1073e3e5cecSfairThe protocols used to boot
1083e3e5cecSfair.Nx
1093e3e5cecSfaircan be completely different than the ones that
1103e3e5cecSfair.Nx
11133b345ecSwizuses operationally, i.e. you can netboot the system using
1123e3e5cecSfair.Tn \&HP
1133e3e5cecSfair.Tn RMP
1143e3e5cecSfairand the
1153e3e5cecSfair.Nx
1163e3e5cecSfairkernel can use
1173e3e5cecSfair.Tn \&IP
1183e3e5cecSfairto communicate after bootstrap.
1193e3e5cecSfair.Pp
1203e3e5cecSfairThere is no standard way to pass all the required information
1213e3e5cecSfairfrom a boot loader to an operating system kernel, so the
1223e3e5cecSfair.Nx
1233e3e5cecSfairkernel usually has to recapitulate the same
1243e3e5cecSfair.Pq or similar
1253e3e5cecSfairprotocol exchanges over the network to obtain a network address,
1263e3e5cecSfairdetermine which servers to use, and so on.
1273e3e5cecSfair.Nx
1283e3e5cecSfairsupports obtaining this information from
1293e3e5cecSfair.Tn RARP ,
1303e3e5cecSfair.Tn BOOTP ,
1313e3e5cecSfair.Tn DHCP ,
1323e3e5cecSfairand
1333e3e5cecSfair.Tn Sun RPC
1343e3e5cecSfair.Qq bootparams .
1353e3e5cecSfairSee
1363e3e5cecSfair.Xr options 4
1373e3e5cecSfairfor a list of methods that can be compiled into a
1383e3e5cecSfair.Nx
1393e3e5cecSfairkernel.
1403e3e5cecSfair.Pp
1413e3e5cecSfair.Nx
1423e3e5cecSfaironly supports the
1433e3e5cecSfair.Tn Sun
1443e3e5cecSfairNetwork File System
1453e3e5cecSfair.Pq Tn NFS
1463e3e5cecSfairfor mounting its root file system over a network.
1473e3e5cecSfair.Nx
1483e3e5cecSfaircan use any local mass storage device for which it has a driver,
1493e3e5cecSfairafter bootstrap, even if that device is not supported by the system's
1503e3e5cecSfairfirmware for booting.
1513e3e5cecSfair.Pp
1523e3e5cecSfair.Sy N.B.
1533e3e5cecSfair.Tn DHCP
1543e3e5cecSfairis essentially a series of extensions to
1553e3e5cecSfair.Tn BOOTP ;
1563e3e5cecSfairthe
1573e3e5cecSfair.Nx
1583e3e5cecSfair.Xr dhcpd 8
1593e3e5cecSfairis capable of responding to both kinds of protocol requests.
1603e3e5cecSfair.Pp
1613e3e5cecSfairIn the majority of configurations, network boot servers and clients
1623e3e5cecSfairare attached to the same
1633e3e5cecSfair.Tn LAN
1643e3e5cecSfairso that broadcast queries from the clients can be heard by the servers.
1653e3e5cecSfairUnless specially configured, routers block broadcasts from propagating from
1663e3e5cecSfair.Tn LAN
1673e3e5cecSfairto
1683e3e5cecSfair.Tn LAN ;
1693e3e5cecSfairsome routers can be configured to
1703e3e5cecSfair.Qq forward
1713e3e5cecSfairbroadcast
1723e3e5cecSfair.Tn BOOTP
1733e3e5cecSfairpackets to another
1743e3e5cecSfair.Tn LAN
1753e3e5cecSfairattached to that router, which permits a server on that remote
1763e3e5cecSfair.Tn LAN
1773e3e5cecSfairto respond to the client's broadcast query.
178a99b93e3Sderaadt.Sh OPERATION
179a99b93e3SderaadtWhen booting a system over the network, there are three
180a99b93e3Sderaadtphases of interaction between client and server:
181a99b93e3Sderaadt.Pp
1823e3e5cecSfair.Bl -enum -compact
1833e3e5cecSfair.It
1843e3e5cecSfairThe system firmware
18528dbdce5Sfair.Pq or stage-1 bootstrap
18628dbdce5Sfairloads a boot program.
1873e3e5cecSfair.It
1883e3e5cecSfairThe boot program loads a
1893e3e5cecSfair.Nx
1903e3e5cecSfairkernel.
1913e3e5cecSfair.It
1923e3e5cecSfairThe
1933e3e5cecSfair.Nx
1943e3e5cecSfairkernel performs an
195d22f9e6cSwiz.Tn NFS
1963e3e5cecSfairmount of the root file system.
197a99b93e3Sderaadt.El
198a99b93e3Sderaadt.Pp
199a99b93e3SderaadtEach of these phases are described in further detail below.
2003e3e5cecSfair.Ss 1. loading a boot program
2013e3e5cecSfairIn phase 1, the system firmware loads a boot program.
2023e3e5cecSfairFirmware designs vary widely,
2033e3e5cecSfairso this phase is inherently machine-specific.
2043e3e5cecSfairSome examples:
205a99b93e3Sderaadt.Pp
2063e3e5cecSfair.Tn DEC
2073e3e5cecSfairAlpha systems use
2083e3e5cecSfair.Tn BOOTP
209a99b93e3Sderaadtto determine the client's
2103e3e5cecSfair.Tn \&IP
211a99b93e3Sderaadtaddress and then use
212a99b93e3Sderaadt.Tn TFTP
2133e3e5cecSfairload a secondary bootstrap program from the server and filename
2143e3e5cecSfairspecified in the
2153e3e5cecSfair.Tn BOOTP
2163e3e5cecSfairreply.
2173e3e5cecSfair.Tn DEC
2183e3e5cecSfairAlpha systems can also use
2193e3e5cecSfair.Tn MOP
2203e3e5cecSfairto load a program to run the system.
2213e3e5cecSfair.Pp
2223e3e5cecSfair.Tn Sun
2233e3e5cecSfairsystems use
2243e3e5cecSfair.Tn RARP
2253e3e5cecSfairto determine the client's
2263e3e5cecSfair.Tn \&IP
2273e3e5cecSfairaddress, transform that address to a hexadecimal string to form
2283e3e5cecSfairthe filename of the secondary boot program, and then use
2293e3e5cecSfair.Tn TFTP
2303e3e5cecSfairto download the boot program from the server that sent the
231a99b93e3Sderaadt.Tn RARP
23228dbdce5Sfairreply.
233a99b93e3Sderaadt.Pp
2343e3e5cecSfair.Tn \&HP
2353e3e5cecSfair300-series systems use the
2363e3e5cecSfair.Tn \&HP
2373e3e5cecSfair.Tn RMP
2383e3e5cecSfairto download a boot program.
2393e3e5cecSfair.Pp
2403e3e5cecSfairTypical personal computers may load a network boot program either
2413e3e5cecSfairfrom diskette or from a
2423e3e5cecSfair.Tn PROM
2433e3e5cecSfairon a Network Interface Card
2443e3e5cecSfair.Pq Tn NIC .
2453e3e5cecSfairSome
2463e3e5cecSfair.Tn BIOS Ns No \&es
2473e3e5cecSfairsupport booting from a network interface.
2483e3e5cecSfair.Ss 2. loading a kernel
2493e3e5cecSfairIn phase 2, the secondary boot program loads a kernel.
2503e3e5cecSfairOperation in this phase depends on the design of the boot program
25128dbdce5Sfair.Po
2523e3e5cecSfairthe design described here is the one used by
2533e3e5cecSfair.Tn Sun
2543e3e5cecSfairand
25528dbdce5Sfair.Nx Ns Tn /hp300
25628dbdce5Sfair.Pc .
257a99b93e3SderaadtThe boot program:
258a99b93e3Sderaadt.Pp
2593e3e5cecSfair.Bl -enum -compact
2603e3e5cecSfair.It
2613e3e5cecSfairgets the client
2623e3e5cecSfair.Tn \&IP
2633e3e5cecSfairaddress using
264a99b93e3Sderaadt.Tn RARP .
2653e3e5cecSfair.It
266a99b93e3Sderaadtgets the client name and server
2673e3e5cecSfair.Tn \&IP
268a99b93e3Sderaadtaddress by broadcasting an
269a99b93e3Sderaadt.Tn RPC / BOOTPARAMS / WHOAMI
2703e3e5cecSfairrequest with the client
2713e3e5cecSfair.Tn \&IP
2723e3e5cecSfairaddress.
2733e3e5cecSfair.It
274a99b93e3Sderaadtgets the server path for this client's
275a99b93e3Sderaadtroot using an
276a99b93e3Sderaadt.Tn RPC / BOOTPARAMS / GETFILE
277a99b93e3Sderaadtrequest with the client name.
2783e3e5cecSfair.It
279a99b93e3Sderaadtgets the root file handle by calling
280a99b93e3Sderaadt.Xr mountd 8
2813e3e5cecSfairwith the server path for the client root file system.
2823e3e5cecSfair.It
283a99b93e3Sderaadtgets the kernel file handle by calling
284a99b93e3Sderaadt.Tn NFS
2853e3e5cecSfair.Fn lookup
2863e3e5cecSfairon the root file handle.
2873e3e5cecSfair.It
288a99b93e3Sderaadtloads the kernel using
289a99b93e3Sderaadt.Tn NFS
290a99b93e3Sderaadtread calls on the kernel file handle.
2913e3e5cecSfair.It
292a99b93e3Sderaadttransfers control to the kernel entry point.
293a99b93e3Sderaadt.El
294a99b93e3Sderaadt.Pp
2953e3e5cecSfairA
2963e3e5cecSfair.Tn BOOTP
2973e3e5cecSfairand/or
2983e3e5cecSfair.Tn DHCP
2993e3e5cecSfairsecondary bootstrap program will do the following:
3003e3e5cecSfair.Pp
3013e3e5cecSfair.Bl -enum -compact
3023e3e5cecSfair.It
3033e3e5cecSfairquery for the client's bootstrap parameters.
3043e3e5cecSfairThe response must include the client's
3053e3e5cecSfair.Tn \&IP
3063e3e5cecSfairaddress, and a
3073e3e5cecSfair.Tn TFTP
3083e3e5cecSfairserver to load the
3093e3e5cecSfair.Nx
3103e3e5cecSfairkernel from.
3113e3e5cecSfair.It
3123e3e5cecSfairloads the
3133e3e5cecSfair.Nx
3143e3e5cecSfairkernel from the
3153e3e5cecSfair.Tn TFTP
3163e3e5cecSfairserver.
3173e3e5cecSfair.It
3183e3e5cecSfairtransfers control to the kernel entry point.
3193e3e5cecSfair.El
3203e3e5cecSfair.Ss 3. NFS mounting the root file system
3213e3e5cecSfairIn phase 3, the kernel performs an
322d22f9e6cSwiz.Tn NFS
3233e3e5cecSfairmount of the root file system.
324a99b93e3SderaadtThe kernel repeats much of the work done by the boot program
325a99b93e3Sderaadtbecause there is no standard way for the boot program to pass
326a99b93e3Sderaadtthe information it gathered on to the kernel.
327a99b93e3Sderaadt.Pp
3283e3e5cecSfairIn general, the GENERIC kernel
329a9b411c1Speter.Xr config 1
3303e3e5cecSfairfile for any particular architecture will specify compile-time
3313e3e5cecSfairoptions to use the same protocol used by the secondary boot program
3323e3e5cecSfairfor that architecture.
3333e3e5cecSfairA
3343e3e5cecSfair.Nx
3353e3e5cecSfairkernel can be compiled to use any of
33628dbdce5Sfair.Tn BOOTP ,
33728dbdce5Sfair.Tn DHCP ,
33828dbdce5Sfairor
3393e3e5cecSfair.Tn Sun RPC BOOTPARAMS ;
3403e3e5cecSfairsee
341fcc3b319Sross.Xr options 4 .
3423e3e5cecSfair.Pp
3433e3e5cecSfairThe procedure typically used by the kernel is as follows:
3443e3e5cecSfair.Pp
3453e3e5cecSfair.Bl -enum -compact
3463e3e5cecSfair.It
3473e3e5cecSfairThe kernel finds a boot server using the same procedures
3483e3e5cecSfairas described above to determine the client's
3493e3e5cecSfair.Tn \&IP
3503e3e5cecSfairaddress, an
3513e3e5cecSfair.Tn NFS
3523e3e5cecSfairserver, etc.
3533e3e5cecSfair.It
354a99b93e3SderaadtThe kernel gets the
355a99b93e3Sderaadt.Tn NFS
3563e3e5cecSfairfile handle for root using the same procedure as described above.
3573e3e5cecSfair.It
358a99b93e3SderaadtThe kernel calls the
359a99b93e3Sderaadt.Tn NFS
3603e3e5cecSfair.Fn getattr
3613e3e5cecSfairfunction to get the last-modified time of the root
362a99b93e3Sderaadtdirectory, and uses it to check the system clock.
363a99b93e3Sderaadt.El
3643e3e5cecSfair.Sh SERVER CONFIGURATION
3653e3e5cecSfairBefore a client can bootstrap over the network,
3663e3e5cecSfairits server must be configured.
3673e3e5cecSfairEach daemon that implements these protocols must be set up so
3683e3e5cecSfairthat it can answer queries from the clients.
3693e3e5cecSfairSome of these daemons are invoked as packets come in, by
3703e3e5cecSfair.Xr inetd 8 ,
3713e3e5cecSfairand some must run independently, started from
3723e3e5cecSfair.Pa /etc/rc ;
3733e3e5cecSfairsee
3743e3e5cecSfair.Xr rc.conf 5 .
3753e3e5cecSfair.Bl -column "Protocol" "rpc.bootparamd" "inetd.conf(5)" -offset indent
3763e3e5cecSfair.It Sy Protocol Ta Sy Program Ta Sy Startup
3773e3e5cecSfair.It RARP Ta rarpd Ta Xr rc.conf 5
3783e3e5cecSfair.It DHCP Ta dhcpd Ta Xr rc.conf 5
3793e3e5cecSfair.It BOOTP Ta bootpd Ta Xr inetd.conf 5
3804c12bd76Sriastradh.It TFTP Ta tftpd Ta Xr inetd.conf 5
3813e3e5cecSfair.It Sun RPC Ta rpcbind Ta Xr rc.conf 5
3823e3e5cecSfair.It Sun RPC Ta rpc.bootparamd Ta Xr rc.conf 5
3833e3e5cecSfair.It Sun NFS Ta mountd Ta Xr rc.conf 5
3843e3e5cecSfair.It Sun NFS Ta nfsiod Ta Xr rc.conf 5
3853e3e5cecSfair.It \&HP RMP Ta rbootd Ta Xr rc.conf 5
3863e3e5cecSfair.El
387a99b93e3Sderaadt.Pp
3883e3e5cecSfair.Sy N.B.
3893e3e5cecSfair.Tn DHCP
3903e3e5cecSfairis essentially a series of extensions to
3913e3e5cecSfair.Tn BOOTP ;
3923e3e5cecSfairthe
3933e3e5cecSfair.Nx
3943e3e5cecSfair.Xr dhcpd 8
3953e3e5cecSfairis capable of responding to both kinds of protocol requests.
3963e3e5cecSfairSince they both bind to the same
3973e3e5cecSfair.Tn UDP
3983e3e5cecSfairport, only one may be run on a given server.
3993e3e5cecSfair.Pp
4003e3e5cecSfairIn the following examples, the client's hostname is
4013e3e5cecSfair.Sy myclient ;
4023e3e5cecSfairthe server is
4033e3e5cecSfair.Sy myserver ,
4043e3e5cecSfairand the addresses are all fictional.
4053e3e5cecSfairIn these examples
4063e3e5cecSfairthe hostnames may be Fully Qualified Domain Names
4073e3e5cecSfair.Pq FQDN, e.g. Qq myclient.mydomain.com
4083e3e5cecSfairprovided that they are used consistently.
4093e3e5cecSfair.Ss RARP
4103e3e5cecSfairFor clients that use
4113e3e5cecSfair.Tn RARP
4123e3e5cecSfairto obtain their
4133e3e5cecSfair.Tn \&IP
4143e3e5cecSfairaddress,
4153e3e5cecSfairan entry must be added for each client to
416a99b93e3Sderaadt.Pa /etc/ethers
4173e3e5cecSfairwith the client's
4183e3e5cecSfair.Tn Ethernet
4193e3e5cecSfair.Tn MAC
4203e3e5cecSfairaddress and Internet hostname:
4213e3e5cecSfair.Pp
422a99b93e3Sderaadt.Bd -literal -offset indent -compact
423a99b93e3Sderaadt8:0:20:7:c5:c7          myclient
424a99b93e3Sderaadt.Ed
425a99b93e3Sderaadt.Pp
4263e3e5cecSfairThis will be used by
4273e3e5cecSfair.Xr rarpd 8
4283e3e5cecSfairto reply to queries from the clients.
4293e3e5cecSfairThere must be one entry per client system.
4303e3e5cecSfair.Pp
4313e3e5cecSfairA client system's
43233b345ecSwiz.Tn Ethernet
4333e3e5cecSfair.Tn MAC
4343e3e5cecSfairaddress is often printed on the system case, or on a chip on its
4353e3e5cecSfairmotherboard, or on the
4363e3e5cecSfair.Tn NIC .
4373e3e5cecSfairIf not,
4383e3e5cecSfair.Qq sniffing
4393e3e5cecSfairthe network with
4403e3e5cecSfair.Xr tcpdump 8
4413e3e5cecSfairwhen the client is powered-on should reveal its
44233b345ecSwiz.Tn Ethernet
4433e3e5cecSfair.Tn MAC
4443e3e5cecSfairaddress.
4453e3e5cecSfair.Pp
4463e3e5cecSfairEach client system that uses
4473e3e5cecSfair.Tn RARP
4483e3e5cecSfairmust have its own, unique
4493e3e5cecSfair.Tn \&IP
4503e3e5cecSfairaddress assigned to it.
4513e3e5cecSfairAssign an
4523e3e5cecSfair.Tn \&IP
4533e3e5cecSfairaddress for myclient in your
454a99b93e3Sderaadt.Pa /etc/hosts
4553e3e5cecSfairfile, or in the master file for your
45628dbdce5Sfair.Tn DNS
4573e3e5cecSfairzone.
4583e3e5cecSfairFor
4593e3e5cecSfair.Pa /etc/hosts
46033b345ecSwizthe entry should look like:
4613e3e5cecSfair.Pp
462a99b93e3Sderaadt.Bd -literal -offset indent -compact
463a99b93e3Sderaadt192.197.96.12           myclient
464a99b93e3Sderaadt.Ed
4653e3e5cecSfair.Ss DHCP/BOOTP
4663e3e5cecSfairThe
4673e3e5cecSfair.Nx
4683e3e5cecSfair.Tn DHCP
4693e3e5cecSfairserver
4703e3e5cecSfair.Xr dhcpd 8
4713e3e5cecSfairwas developed by the Internet Software Consortium
472bed7cf5aSnjoly.Pq Lk http://www.isc.org/ "ISC" .
473a99b93e3Sderaadt.Pp
4743e3e5cecSfair.Tn DHCP
4753e3e5cecSfaircan provide a wide range of information to a requesting client;
4763e3e5cecSfairthe key data for bootstrapping a diskless client are:
477a99b93e3Sderaadt.Pp
4783e3e5cecSfair.Bl -enum -compact
4793e3e5cecSfair.It
4803e3e5cecSfairan
4813e3e5cecSfair.Tn \&IP
4823e3e5cecSfairaddress
4833e3e5cecSfair.It
4843e3e5cecSfaira subnet mask
4853e3e5cecSfair.It
4863e3e5cecSfaira
4873e3e5cecSfair.Tn TFTP
4883e3e5cecSfairserver address for loading the secondary bootstrap and the
4893e3e5cecSfair.Nx
4903e3e5cecSfairkernel
4913e3e5cecSfair.It
4923e3e5cecSfaira filename of the secondary bootstrap
4933e3e5cecSfair.It
4943e3e5cecSfairan
4953e3e5cecSfair.Tn NFS
4963e3e5cecSfairserver address for the client's file system
4973e3e5cecSfair.It
4983e3e5cecSfairthe client's root file system path, to be
4993e3e5cecSfair.Tn NFS
5003e3e5cecSfairmounted.
5013e3e5cecSfair.El
5023e3e5cecSfair.Pp
5033e3e5cecSfairAn example for
5043e3e5cecSfair.Pa /etc/dhcpd.conf
5053e3e5cecSfair.Bd -literal -offset indent
5063e3e5cecSfairhost myclient {
5073e3e5cecSfair	hardware ethernet 8:0:20:7:c5:c7;
5083e3e5cecSfair	fixed-address myclient;		# client's assigned IP address
5093e3e5cecSfair	filename "myclient.netboot";	# secondary bootstrap
5103b60cb06Selad	next-server myserver;		# TFTP server for secondary bootstrap
5113b60cb06Selad	option swap-server myserver;	# NFS server for root filesystem
512d9770d2cSfair	option root-path "/export/myclient/root";
5133e3e5cecSfair}
514a52181f3Sthorpej.Ed
515a52181f3Sthorpej.Pp
5163e3e5cecSfairThat
5173e3e5cecSfair.Sy host
5183e3e5cecSfairdeclaration goes inside a
5193e3e5cecSfair.Sy subnet
5203e3e5cecSfairdeclaration, which gives parameters for all hosts on the subnet
5213e3e5cecSfairthat will be using
5223e3e5cecSfair.Tn DHCP ,
5233e3e5cecSfairsuch as the
5243e3e5cecSfair.Qq routers
5253e3e5cecSfair.Pq the default route ,
5263e3e5cecSfair.Qq subnet-mask ,
5273e3e5cecSfair.Qq broadcast-address ,
5283e3e5cecSfair.Qq domain-name-servers ,
5293e3e5cecSfairetc.
5303e3e5cecSfairSee
5313e3e5cecSfair.Xr dhcpd.conf 5
5323e3e5cecSfairfor details.
5333e3e5cecSfairIn that example,
5343e3e5cecSfair.Sy myclient
5353e3e5cecSfairhas an assigned IP address.
536a52181f3Sthorpej.Pp
5373e3e5cecSfairThe
5383e3e5cecSfair.Tn DHCP
5393e3e5cecSfairparameters required for network bootstrapping a system will vary
5403e3e5cecSfairfrom platform to platform, as dictated by each system's firmware.
541d9770d2cSfairIn particular, because the
542d9770d2cSfair.Tn DHCP
543d9770d2cSfairis extensible, some hardware vendors have specified
544d9770d2cSfair.Tn DHCP
545d9770d2cSfairoptions to return information to requesting clients that are specific
546d9770d2cSfairto that platform.
5473e3e5cecSfairPlease see your platform's
5483e3e5cecSfair.Xr boot 8
5493e3e5cecSfairfor details.
5503e3e5cecSfair.Ss TFTP
5513e3e5cecSfairIf booting a
5523e3e5cecSfair.Tn Sun
5533e3e5cecSfairsystem, or other system that expects to use
5543e3e5cecSfair.Tn TFTP ,
5553e3e5cecSfairensure that
5563e3e5cecSfair.Xr inetd 8
5573e3e5cecSfairis configured to run
5583e3e5cecSfair.Xr tftpd 8 .
5593e3e5cecSfairThe
5603e3e5cecSfair.Xr tftpd 8
5613e3e5cecSfairserver should be set up to serve the directory
5623e3e5cecSfair.Pa /tftpboot .
5633e3e5cecSfair.Pp
56428dbdce5SfairIf booting a
56528dbdce5Sfair.Tn SPARC
5663e3e5cecSfairsystem, install a copy of the appropriate diskless secondary boot
56728dbdce5Sfairloader
56828dbdce5Sfair.Po
56928dbdce5Sfairsuch as
570d22f9e6cSwiz.Pa /usr/mdec/boot
571d22f9e6cSwizor
57228dbdce5Sfair.Pa ofwboot.net
57328dbdce5Sfair.Pc
5745327fe2bSmrgin the
575a99b93e3Sderaadt.Pa /tftpboot
576a99b93e3Sderaadtdirectory.
577a99b93e3SderaadtMake a link such that the boot program is
5783e3e5cecSfairaccessible by a filename composed of the client's
5793e3e5cecSfair.Tn \&IP
5803e3e5cecSfairaddress in hexadecimal, a dot, and the architecture name
58128dbdce5Sfair.Pq all upper case .
582a99b93e3SderaadtFor example:
5833e3e5cecSfair.Pp
584a99b93e3Sderaadt.Bd -literal -offset indent -compact
585a99b93e3Sderaadt# cd /tftpboot
5865327fe2bSmrg# ln -s boot C0C5600C.SUN4
587a99b93e3Sderaadt.Ed
588a99b93e3Sderaadt.Pp
58928dbdce5SfairFor a
5903e3e5cecSfair.Tn Sun-3
5913e3e5cecSfairor
59228dbdce5Sfair.Tn UltraSPARC
5933e3e5cecSfairsystem, the filename would be just C0C5600C
59428dbdce5Sfair.Po
5953e3e5cecSfairthese systems' firmware does not append the architecture name
59628dbdce5Sfair.Pc .
5973e3e5cecSfairThe name used is architecture dependent, it simply has to match
5983e3e5cecSfairwhat the booting client's system firmware wishes to it to be.
599a99b93e3Sderaadt.Pp
60033b345ecSwizIf the client's system firmware fails to fetch the expected file,
6013e3e5cecSfair.Xr tcpdump 8
6023e3e5cecSfaircan be used to discover which filename the client is being requested.
6033e3e5cecSfairAlso, examination of
6043e3e5cecSfair.Xr tftpd 8
6053e3e5cecSfairlog entries
6063e3e5cecSfair.Po
6073e3e5cecSfairtypically in
6083e3e5cecSfair.Pa /var/log/messages
6093e3e5cecSfair.Pc
6103e3e5cecSfairshould show whether the server is hearing the client system, and
6113e3e5cecSfairwhat filename the client is asking for.
6123e3e5cecSfair.Ss HP RMP
6133e3e5cecSfairIf booting an
6143e3e5cecSfair.Tn HP
6153e3e5cecSfair300-series system, ensure that
6163e3e5cecSfair.Pa /etc/rbootd.conf
6173e3e5cecSfairis configured properly to transfer the boot program to the client.
6183e3e5cecSfairAn entry might look like this:
6193e3e5cecSfair.Pp
6203e3e5cecSfair.Bd -literal -offset indent -compact
6213e3e5cecSfair08:00:09:01:23:E6	SYS_UBOOT	# myclient
6223e3e5cecSfair.Ed
6233e3e5cecSfair.Pp
6243e3e5cecSfairThe secondary bootstrap program for an
6253e3e5cecSfair.Tn \&HP
6263e3e5cecSfair300-series system
6279e879405Sthorpej.Pa SYS_UBOOT
62828dbdce5Sfair.Po
62928dbdce5Sfairwhich may be called
6309e879405Sthorpej.Pa uboot.lif
63128dbdce5Sfairbefore installation
63228dbdce5Sfair.Pc
6333e3e5cecSfairmust be installed in the directory
634a52181f3Sthorpej.Pa /usr/mdec/rbootd .
635d22f9e6cSwiz.Pp
6363e3e5cecSfairSee the
6373e3e5cecSfair.Xr rbootd 8
6383e3e5cecSfairmanual page for more information.
6393e3e5cecSfair.Ss Sun RPC BOOTPARAMS
6403e3e5cecSfairAdd
6413e3e5cecSfair.Sy myclient
6423e3e5cecSfairto the bootparams database in
643a99b93e3Sderaadt.Pa /etc/bootparams :
6443e3e5cecSfair.Pp
645a99b93e3Sderaadt.Bd -literal -offset indent -compact
6463e3e5cecSfairmyclient  root=myserver:/export/myclient/root \\
6473e3e5cecSfair          swap=myserver:/export/myclient/root/swap \\
6483e3e5cecSfair          dump=myserver:/export/myclient/root/swap
649a99b93e3Sderaadt.Ed
6503e3e5cecSfair.Pp
651d22f9e6cSwizand ensure that
652d22f9e6cSwiz.Xr rpc.bootparamd 8
6533e3e5cecSfairand
6543e3e5cecSfair.Xr rpcbind 8
6553e3e5cecSfairare running.
6563e3e5cecSfairBoth
6573e3e5cecSfair.Sy myclient
6583e3e5cecSfairand
6593e3e5cecSfair.Sy myserver
6603e3e5cecSfairmust have
6613e3e5cecSfair.Tn \&IP
6623e3e5cecSfairaddresses in the
6633e3e5cecSfair.Tn DNS
6643e3e5cecSfairor
6653e3e5cecSfair.Pa /etc/hosts .
6663e3e5cecSfair.Ss Diskless Client File Systems
6673e3e5cecSfairBuild the swap file for
6683e3e5cecSfair.Sy myclient
6693e3e5cecSfairon the
6703e3e5cecSfair.Tn NFS
6713e3e5cecSfairserver:
6723e3e5cecSfair.Pp
673a99b93e3Sderaadt.Bd -literal -offset indent -compact
67401735ee7Smrg# cd /export/myclient/root
675a99b93e3Sderaadt# dd if=/dev/zero of=swap bs=16k count=1024
676a99b93e3Sderaadt.Ed
6773e3e5cecSfair.Pp
67828dbdce5SfairThis creates a 16 megabyte swap file.
679a99b93e3Sderaadt.Pp
6803e3e5cecSfairPopulate
6813e3e5cecSfair.Sy myclient Ns No 's
6823e3e5cecSfairroot file system on the
6833e3e5cecSfair.Tn NFS
6843e3e5cecSfairserver.
6853e3e5cecSfairHow this is done depends on the client architecture and the version
6863e3e5cecSfairof the
68734a98169Sperry.Nx
68834a98169Sperrydistribution.
689a99b93e3SderaadtIt can be as simple as copying and modifying the server's root
6903e3e5cecSfairfile system, or unpack a complete
6913e3e5cecSfair.Nx
6923e3e5cecSfairbinary distribution for the appropriate platform.
693a99b93e3Sderaadt.Pp
6943e3e5cecSfairIf the
6953e3e5cecSfair.Tn NFS
6963e3e5cecSfairserver is going to support multiple different architectures
6973e3e5cecSfair.Po
6983e3e5cecSfaire.g.
6993e3e5cecSfair.Tn Alpha ,
7003e3e5cecSfair.Tn PowerPC ,
7013e3e5cecSfair.Tn SPARC ,
7023e3e5cecSfair.Tn MIPS
7033e3e5cecSfair.Pc ,
7043e3e5cecSfairthen it is important to think carefully about how to lay out the
7053e3e5cecSfair.Tn NFS
7063e3e5cecSfairserver's exported file systems, to share what can be shared
7073e3e5cecSfair.Pq e.g. text files, configuration files, user home directories ,
7083e3e5cecSfairand separate that which is distinct to each architecture
7093e3e5cecSfair.Pq e.g. binary executables, libraries .
7103e3e5cecSfair.Ss NFS
7113e3e5cecSfairExport the client-populated file systems on the
7123e3e5cecSfair.Tn NFS
7133e3e5cecSfairserver in
714a99b93e3Sderaadt.Pa /etc/exports :
7153e3e5cecSfair.Pp
716a99b93e3Sderaadt.Bd -literal -offset indent -compact
717a99b93e3Sderaadt/usr -ro myclient
718690bed40Sgwr# for SunOS:
719690bed40Sgwr# /export/myclient -rw=myclient,root=myclient
720690bed40Sgwr# for NetBSD:
721c9477a3dShpeyerl/export/myclient -maproot=root -alldirs myclient
722a99b93e3Sderaadt.Ed
723a99b93e3Sderaadt.Pp
724a99b93e3SderaadtIf the server and client are of the same architecture, then the client
725a99b93e3Sderaadtcan share the server's
726a99b93e3Sderaadt.Pa /usr
7273e3e5cecSfairfile system
7283e3e5cecSfair.Pq as is done above .
729a99b93e3SderaadtIf not, you must build a properly fleshed out
730a99b93e3Sderaadt.Pa /usr
7313e3e5cecSfairpartition for the client in some other part of the server's
7323e3e5cecSfairfile system, to serve to the client.
733a99b93e3Sderaadt.Pp
7343e3e5cecSfairIf your server is a
7353e3e5cecSfair.Tn SPARC ,
7363e3e5cecSfairand your client a
7373e3e5cecSfair.Tn Sun-3 ,
738a99b93e3Sderaadtyou might create and fill
739a99b93e3Sderaadt.Pa /export/usr.sun3
740a99b93e3Sderaadtand then use the following
741a99b93e3Sderaadt.Pa /etc/exports
742a99b93e3Sderaadtlines:
7433e3e5cecSfair.Pp
744a99b93e3Sderaadt.Bd -literal -offset indent -compact
745a99b93e3Sderaadt/export/usr.sun3 -ro myclient
746a99b93e3Sderaadt/export/myclient -rw=myclient,root=myclient
747a99b93e3Sderaadt.Ed
748a99b93e3Sderaadt.Pp
749d22f9e6cSwizOf course, in either case you will have to have an
750d22f9e6cSwiz.Tn NFS
751d22f9e6cSwizserver running on the server side.
7523e3e5cecSfair.Sh CLIENT CONFIGURATION
753a99b93e3SderaadtCopy and customize at least the following files in
754a99b93e3Sderaadt.Pa /export/myclient/root :
7553e3e5cecSfair.Pp
756a99b93e3Sderaadt.Bd -literal -offset indent -compact
757a99b93e3Sderaadt# cd /export/myclient/root/etc
758d22f9e6cSwiz# vi fstab
759a99b93e3Sderaadt# cp /etc/hosts hosts
76001869ca4Swiz# echo 'hostname="myclient"' >> rc.conf
76101869ca4Swiz# echo "inet 192.197.96.12" > ifconfig.le0
762a99b93e3Sderaadt.Ed
763a99b93e3Sderaadt.Pp
764a99b93e3SderaadtNote that "le0" above should be replaced with the name of
7653e3e5cecSfairthe network interface that the client will use for booting;
7663e3e5cecSfairthe network interface name is device dependent in
7673e3e5cecSfair.Nx .
768a99b93e3Sderaadt.Pp
7695327fe2bSmrgCorrect the critical mount points and the swap file in the client's
770a99b93e3Sderaadt.Pa /etc/fstab
7713e3e5cecSfair.Po
7723e3e5cecSfairwhich will be
7733e3e5cecSfair.Pa /export/myclient/root/etc/fstab
7743e3e5cecSfair.Pc
775d22f9e6cSwizi.e.
7763e3e5cecSfair.Pp
777a99b93e3Sderaadt.Bd -literal -offset indent -compact
778a99b93e3Sderaadtmyserver:/export/myclient/root  /    nfs  rw 0 0
779a99b93e3Sderaadtmyserver:/usr                   /usr nfs  rw 0 0
7803e3e5cecSfair/swap                           none swap sw 0 0
781a99b93e3Sderaadt.Ed
7822ff53183Sthorpej.Pp
7833e3e5cecSfairNote, you
7843e3e5cecSfair.Em must
7853e3e5cecSfairspecify the swap file in
7862ff53183Sthorpej.Pa /etc/fstab
7872ff53183Sthorpejor it will not be used!
7883e3e5cecSfairSee
7893e3e5cecSfair.Xr swapctl 8 .
7905ee2540bSmrg.Pp
7915ee2540bSmrgIt may be useful to set
7925ee2540bSmrg.Dq flushroutes=NO
7935ee2540bSmrgin
7945ee2540bSmrg.Pa /etc/rc.conf
7955ee2540bSmrgto avoid the default route supplied by the boot setup
7965ee2540bSmrgdisappearing mid-boot.
797a99b93e3Sderaadt.Sh FILES
798a52181f3Sthorpej.Bl -tag -width /usr/mdec/rbootd -compact
7993e3e5cecSfair.It Pa /etc/hosts
8003e3e5cecSfairtable of associated
8013e3e5cecSfair.Tn \&IP
8023e3e5cecSfairaddresses and
8033e3e5cecSfair.Tn \&IP
8043e3e5cecSfairhost names; see
8053e3e5cecSfair.Xr hosts 5
806a99b93e3Sderaadt.It Pa /etc/ethers
8073e3e5cecSfairtable of associated
80828dbdce5Sfair.Tn Ethernet
8093e3e5cecSfair.Tn MAC
8103e3e5cecSfairaddresses and
8113e3e5cecSfair.Tn \&IP
8123e3e5cecSfairhost names used by
8133e3e5cecSfair.Xr rarpd 8 ;
8143e3e5cecSfairsee
8153e3e5cecSfair.Xr ethers 5
816a99b93e3Sderaadt.It Pa /etc/bootparams
8173e3e5cecSfairclient root pathname and swap pathname; see
8183e3e5cecSfair.Xr bootparams 5
819a99b93e3Sderaadt.It Pa /etc/exports
820d22f9e6cSwizexported
821d22f9e6cSwiz.Tn NFS
8223e3e5cecSfairmount points; see
8233e3e5cecSfair.Xr exports 5
824a52181f3Sthorpej.It Pa /etc/rbootd.conf
8253e3e5cecSfairconfiguration file for
8263e3e5cecSfair.Tn \&HP RMP ;
8273e3e5cecSfairsee
8283e3e5cecSfair.Xr rbootd 8
829a52181f3Sthorpej.It Pa /usr/mdec/rbootd
8303e3e5cecSfairlocation of boot programs offered by
8313e3e5cecSfair.Xr rbootd 8
8323e3e5cecSfair.It Pa /tftpboot
8333e3e5cecSfairlocation of boot programs offered by
8343e3e5cecSfair.Xr tftpd 8
835a99b93e3Sderaadt.El
836b2275072Scgd.Sh SEE ALSO
837a99b93e3Sderaadt.Xr bootparams 5 ,
8383e3e5cecSfair.Xr dhcpd.conf 5 ,
839d22f9e6cSwiz.Xr ethers 5 ,
840a99b93e3Sderaadt.Xr exports 5 ,
8413e3e5cecSfair.Xr fstab 5 ,
8423e3e5cecSfair.Xr hosts 5 ,
84333b345ecSwiz.Xr networks 5 ,
84433b345ecSwiz.Xr boot 8 ,
84533b345ecSwiz.Xr dhcpd 8 ,
8463e3e5cecSfair.Xr mopd 8 ,
847d22f9e6cSwiz.Xr mountd 8 ,
84833b345ecSwiz.Xr nfsd 8 ,
849d22f9e6cSwiz.Xr rarpd 8 ,
850a52181f3Sthorpej.Xr rbootd 8 ,
851d22f9e6cSwiz.Xr reboot 8 ,
852d22f9e6cSwiz.Xr rpc.bootparamd 8 ,
853d22f9e6cSwiz.Xr tftpd 8
8543e3e5cecSfair.Rs
8553e3e5cecSfair.%R RFC
8563e3e5cecSfair.%N 903
8573e3e5cecSfair.%D June 1984
8583e3e5cecSfair.%T "Reverse Address Resolution Protocol"
8593e3e5cecSfair.Re
8603e3e5cecSfair.Rs
8613e3e5cecSfair.%R RFC
8623e3e5cecSfair.%N 906
8633e3e5cecSfair.%D June 1984
8643e3e5cecSfair.%T "Bootstrap Loading using TFTP"
8653e3e5cecSfair.Re
8663e3e5cecSfair.Rs
8673e3e5cecSfair.%R RFC
8683e3e5cecSfair.%N 951
8693e3e5cecSfair.%D September 1985
8703e3e5cecSfair.%T "Bootstrap Protocol"
8713e3e5cecSfair.Re
8723e3e5cecSfair.Rs
8733e3e5cecSfair.%R RFC
8743e3e5cecSfair.%N 1350
8753e3e5cecSfair.%D July 1992
8763e3e5cecSfair.%T "The TFTP Protocol (Revision 2)"
8773e3e5cecSfair.Re
8783e3e5cecSfair.Rs
8793e3e5cecSfair.%R RFC
8803e3e5cecSfair.%N 2131
8813e3e5cecSfair.%D March 1997
8823e3e5cecSfair.%T "Dynamic Host Configuration Protocol"
8833e3e5cecSfair.Re
8843e3e5cecSfair.Rs
8853e3e5cecSfair.%R RFC
8863e3e5cecSfair.%N 2132
8873e3e5cecSfair.%D March 1997
8883e3e5cecSfair.%T "DHCP Options and BOOTP Vendor Extensions"
8893e3e5cecSfair.Re
8903e3e5cecSfair.Pp
891bed7cf5aSnjoly.Lk http://www.rfc-editor.org/ "RFC Editor"
892