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