Skip site navigation (1)Skip section navigation (2)
Date:      20 Nov 1998 09:28:30 +0100
From:      Benedikt Stockebrand <bs@adimus.de>
To:        FreeBSD-chat <freebsd-chat@FreeBSD.ORG>
Subject:   Re: Diskless Workstations
Message-ID:  <sa77lwqojip.fsf@adimus.de>
In-Reply-To: gummibear@we.mediaone.net's message of "Thu, 19 Nov 1998 22:28:44 -0800"
References:  <3.0.1.32.19981119222844.006ba104@we.mediaone.net>

next in thread | previous in thread | raw e-mail | index | archive | help
gummibear@we.mediaone.net writes:

> I'd love a Tutorial on it all.  I would assume that the NC thing would be
> done with a bunch of X Terminals, but I don't know enough of X
> administration to figure out how to do it all.  Especially, with the new
> networked hardware.  Can you point me to any sites that has info on this
> subject?  Thanks.

As far as netbootable FreeBSD PeeCees are concerned I've written a
note about it some time ago.  It's supposed to cover a variety of
platforms but so far I've only managed to check things out with
FreeBSD.  That's why I haven't made it publicly available yet.

If you have any comments, suggestions or whatever to the text please
send me a note.


So long,

    Ben

-- 
Benedikt Stockebrand, Dipl. inf.  Adimus Beratungsgesellschaft für System-
                                  und Netzwerkadministration mbH & Co KG
System Administration & Design,	  Universitätsstr. 142, 44799 Bochum
IT Security, Remote System Mgmt	  Tel. (02 34) 971 971 -2, Fax -9


--- 8< ---
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>How to boot Un*x from a Network Server</title>
  </head>

  <body>
    
    <h1>How to boot Un*x from a Network Server</h1>
    

    <h2>Introduction</h2>

    This text deals with the issue of setting up an assortment of Un*ces to boot from a server
    located on the same LAN.  Many people consider diskless machines an anachronism, some
    marketing droids call them the ultimate solution to all administration problems and finally
    some people like me just prefer to stuff their disk server in a silenced room all the way
    down the hall.<p>
      
      This text starts with an introduction about the protocols used for network booting issues
      on a variety of platforms.  Following it is another section organized by Un*x variants.
      For each variant we first describe its net boot mechanism and its particularities, then
      continue with the client side and finish with particularities if you want to run a server
      on that platform.  This ordering should provide the most useful if you're setting up some
      clients together with an existing server.  If you're starting from scratch I'd recommend
      to start with the server.<p>
      
      For purely educational purposes this text may be somewhat inadequate, but if you're
      looking for that sort of information you might prefer <cite>W. Richard Stevens, TCP/IP
      Illustrated, Vol. 1</cite> and the assorted man pages of the systems in question.<p>
      
    <h2>Protocols</h2>

    First we list the protocols used in conjunction with network-booted machines.  We don't
    describe the protocols but just supply two lists for each, one of the platforms serving
    that protocol and another listing the platforms using them on the client side.<p>

      The fields holding a "S" indicate that the platform provides a server for the given
      protocol.  A "C" marks the services needed by a client to boot across the network.
      Finally, a "(C)" entry indicates that the client can optionally use the protocol.<p>

      <table border>
	<tr><th>Platform</th>
	  <th>RARP</th>
	      <th>BOOTP</th>
                  <th>BOOTPGW</th>
                      <th>BOOTPARAMD</th>
                          <th>TFTP</th>
                              <th>NFS</th></tr>
	<tr><th>FreeBSD</th>
          <td align=center>S</td>
              <td align=center>S, C</td>
                  <td align=center>S, (C)</td>
                      <td align=center>S</td>
                          <td align=center>S, C</td>
                              <td align=center>S, C</td></tr>
      </table>

      




    <h2>FreeBSD 2.2.6</h2>


    <h3>Running a FreeBSD Client</h3>

    <h4>How Things Work</h4>
    The boot process with FreeBSD looks like this:
    <ul>
      <li>Start the boot ROM code for your network card.
      <li>Use BOOTP to find out the IP address and netmask.
      <li>Use TFTP to learn the root and swap file system location.
      <li>Read the kernel from the root file system via NFS.
      <li>Mount root and swap(?) file system via NFS.
      <li>Continue the boot process as usual.
    </ul>
    As a consequence you need a BOOTP, TFTP and NFS server for a network boot.<p>

    <h4>Hardware Preparations: Making Your Network Card Boot</h4>
    
    The first thing you have to do is to make your machine capable to boot from the net.
    There are two possibilities: You may equip your network card with a boot EPROM or you may
    stuff that EPROM data on a boot floppy.  At the time of this writing supported network
    cards are 3c509 and (with some minor makefile tweaking) 3c503 cards and the NE2000 clones
    family.  See the <tt>netboot(8)</tt> man page and
    <tt>/usr/src/sys/i386/boot/netboot/Makefile</tt> for details.<p>
      
      You find prebuilt rom images in <tt>/usr/mdec/nb{8390,3c509}.rom</tt> in case you don't
      want to roll your own in <tt>/usr/src/sys/i386/boot/netboot</tt>.  Just put them in an
      EPROM, stuff it in your network card and be happy (hopefully, I haven't tried this
      myself).<p>
      
      If you rather want to use a boot floppy you can use DOS-style <tt>.COM</tt> files.
      You'll find them in the same place as the EPROM images but their filename suffix is
      <tt>.com</tt> instead of <tt>.rom</tt>.  You can either place them on a DOS floppy and
      start them from DOS or use a specialized <tt>.COM</tt> file loader available from the
      Linux folks.  Make your favorite search engine look for the <tt>comboot</tt> package.<p>
      

    <h4>Server Configurations</h4>

    You'll find some additional information about the boot setup in the <cite>FreeBSD
    Handbook</cite>.  Here's a all you need for a more minimal setup, though --- no need to try 
    to be fancy until things basically work.<p>


    <h5>BOOTP</h5>

    You need an entry in the BOOTPD config that looks at least something like this:
<listing>
snafu.adimus.de:\
      :ha=00.00.1c.1e.0c.9b:\
      :ip=192.168.47.11:
</listing>
    They just match the hardware address with the IP address. Note that the hardware address
    must <i>not</i> be written with colons separating the bytes --- that's one of the problems
    using a cap-style data base file.<p>

      Additionally it may be necessary to add some of these tags:
<listing>
      :hn:\
      :sm=255.255.255.0:\
      :ds=192.168.47.:\
      :ht=ether:\
      :vm=rfc1048:\
</listing>
    The <tt>hn</tt> field makes the BOOTP server transmit the host name in its reply.  This is
    pretty handy because the <tt>/etc/rc.network</tt> script uses this as the host name no
    matter what you put into <tt>/etc/rc.conf</tt>.  As a consequence this allows you to use
    the same set of config files for a whole bunch of netboot clients.<p>

    The <tt>sm</tt> field sets the netmask for the IP address given.  You may need this if you
    use subnets.
    The <tt>ds</tt> field defines the IP address of a name server.  I haven't tried to use
    FQDNs instead of IP addresses in the assorted config files.  Even if that worked out I'd
    feel pretty uncomfortable about it.
    The <tt>ht</tt> field defines the type of network hardware in use.  Apparently 10 Mbit
    Ethernet is the default value, if you use anything else please see the <tt>bootptab(5)</tt> 
    man page or equivalent or the latest <cite>Assigned Numbers RFC</cite>.<p>

    Finally, there are several BOOTP reply message formats.  FreeBSD used the RFC1048-style
    one, so if your BOOTP server uses a different one by default you may have to set this
    explicitly.<p>


    <h5>TFTP</h5>

    Next you need a file that holds additional configuration data.  It is read via
    <tt>TFTP</tt>, so this file is usually placed in the <tt>/tftpboot</tt> directory by
    convention.  Different to the notes in the <cite>FreeBSD Handbook</cite> a variety of names
    are checked in sequence, partly prefixed with a <tt>/tftpboot</tt> path, so you better
    stick with this convenciton.  Just to be sure we go for the most specific one, which is
    <tt>freebsd.IP_ADDRESS_IN_DOTTED_QUAD</tt> in the <tt>/tftpboot</tt> directory,
    e.g. <tt>/tftpboot/freebsd.192.168.47.11</tt> for the example above.<p>

    This file contains any of the assorted <tt>netboot</tt> commands necessary to make the
    machine boot.  This is about all you need:
<listing>
rootfs 192.168.47.1:/netboot/rootfs/snafu
swapfs 192.168.47.1:/netboot/swapfs
</listing>
    The meaning should be obvious, except maybe for the swap file entry, which is explained
    below.<p>

    Additionally it may be helpful to specify the host name of the client here:
<listing>
hostname snafu.adimus.de
</listing>
    This may help to recycle the same root file system for multiple machines.  Then again, it
    may not.<p>

    <b>WARNING: The documentation in <tt>netboot(8)</tt> suggests that these parameters can be
    passed with the BOOTP reply.  This doesn't work, you do need the TFTP file.</b><p>


    <h5>NFS</h5>

    Next you need to make the root file system for the client accessible via NFS.  How to to
    so depends on the platform your server is running on, so take a look at the related section 
    for this issue.  Just one note, though: It is probably necessary to disable root UID
    mapping (aka. root squashing).<p>


    <h4>Building the Kernel</h4>

    Now you'll need to build a kernel for a diskless configuration.  Make sure it supports NFS
    file systems.  And what's worse, don't forget to configure its hardware (IRQs, DMA and I/O
    addresses) properly.<p>

    There are a couple BOOTP-related kernel configuraiton options available.  I haven't figured 
      out what exactly they're good for, but here's the relevant excerpt from
      <tt>/usr/src/sys/i386/conf/LING</tt>:
<listing>
# Kernel BOOTP support 

options		BOOTP		# Use BOOTP to obtain IP address/hostname
options		BOOTP_NFSROOT	# NFS mount root filesystem using BOOTP info
options		"BOOTP_NFSV3"	# Use NFS v3 to NFS mount root
options		BOOTP_COMPAT	# Workaround for broken bootp daemons.
</listing>
    Maybe they're some sort of help.  Then again, maybe they're not.<p>


    <h4>Populating the Boot File System</h4>

    Now you need to build a root file system for the machine.  Take it from a "disky"
    installation, fix the config files in <tt>/etc</tt> and that should do.  If you want to use 
    the same root file system for both the server and client(s) you're best off making the
    hostname made available via the BOOTP or TFTP entries shown above.  Then the hostname will
    be known to the machine before the <tt>/etc/rc*</tt> scripts are run.  The
    <tt>/etc/rc.network</tt> script is smart enough to use that name instead of the one you've
    specified in <tt>/etc/rc.conf</tt>.  Now if you're smart enough to use some <tt>`hostname
      -s`</tt> instead of an actual host name in the remainder of <tt>/etc/rc.conf</tt> you
    might well get away with a single set of config files.<p>

    Finally, you need to set up a swap file.  This swap file is put in the directory specified
    in the TFTP-loaded file (<tt>/netboot/swapfs</tt> in our example above) and named
    <tt>swap.IP_ADDRESS_IN_DOTTED_QUAD</tt>, so in our example it would be
    <tt>/netboot/swapfs/swap.192.168.47.11</tt>.  You need to create it manually using dd.
    Make sure it has the size you want to allocate for swap.<p>

    <h4>Open Questions</h4>

    The <tt>netboot(8)</tt> documentation suggests that it is possible to boot a FreeBSD client
    machine solely via BOOTP and NFS, without actually using any TFTP.  I assume that this
    would require some modifications (or just compile-time options I've missed?) to the
    <tt>netboot(8)</tt> code so the BOOTP values for the root and swap file system locations
    are used instead of the TFTP file contents.




    <h3>Running a FreeBSD Server</h3>

    <h4>rarpd</h4>

    <b>WARNING: I haven't tested the FreeBSD rarpd yet.  I don't need it at this time, so I've
    just read the man page.  Watch your butt here.</b><p>

    The FreeBSD RARP daemon is a standalone server and not run from <tt>inetd(8)</tt>.  It
    isn't configurable in <tt>/etc/rc.conf</tt>, you'll have to start it yourself somehwere.<p>

    It only answers requests for IP addresses that have a related file in <tt>/tftpboot</tt>
    unless you give it a <tt>-s</tt> flag.  Unfortunately the file names searched don't match
    the naming convention used with the FreeBSD <tt>netboot(8)</tt> boot EPROM code.<p>

    Furthermore it only answers on a single interface as specified as argument unless you give
    it a <tt>-a</tt> flag.<p>

    It needs a BPF device, so make sure your kernel is configured for this.<p>

    According to the man page the FreeBSD rarpd reads all its information from the
    <tt>/etc/hosts</tt> and <tt>/etc/ethers</tt> files.  While the ethernet configs support NIS
    the IP configs don't.  I haven't checked this out (yet), but this seems a good deal of
    potential trouble.

    The <tt>/etc/ethers</tt> file just contains lines starting with the MAC address in hex with
    colons separating the octets, some whitespace and an FQDN (why on earth not an IP
    address?).


    <h4>bootpd</h4>

    The FreeBSD <tt>bootpd</tt> can be run either via <tt>inetd(8)</tt> and standalone.  It
    detects this automatically, no options are needed (but available if you want to be sure).

    The configs are put in <tt>/etc/bootptab</tt> which is in a <tt>termcap(5)</tt>-style
    format.  For a complete list of all available tags see the <tt>bootptab(5)</tt> man page.
    The most important are (from the man page):
<listing>
ha   Host hardware address
ip   Host IP address
sm   Host subnet mask
sa   TFTP server address client should use
hn   Send client's hostname to client
tc   Table continuation (points to similar "template" host entry)
</listing>
    Only the first two fields are mandatory, the hardware address (don't use colons between
    octets!) and the IP address.  You may also need to set the subnet mask, too.  Sending the
    hostname to the client may be extremely helpful if you want to use the same configs for a
    set of machines.  And of course the <tt>tc</tt> tag may make things somewhat easier,
    too.<p>

    <h4>bootpgw</h4>

    FreeBSD supports a gateway server for the BOOTP protocol.  You run it with a single
    argument specifying the actual BOOTP server.  For details, see the man page.<p>

    <h4>bootparamd</h4>

    Yes, FreeBSD apparently has a SUN Solaris&reg; style <tt>bootparamd</tt>.  I haven't had a
    closer look at it, yet.  The man page however is deceptively short.<p>

    <h4>tftpd</h4>

    The FreeBSD <tt>tftpd</tt> is started by <tt>inetd</tt>.  You'll find a (by default
    disabled) entry in <tt>/etc/inetd.conf</tt>.  It specifies the <tt>/tftpboot</tt> directory
    as the base directory for all TFTP access.  If you're using the FreeBSD <tt>netboot</tt>
    code you better stick with this convention---that's where the boot config files are
    searched for.  Files are only served from this directory and its subdirectories.  There are
    no config files except for that entry in <tt>/etc/inetd.conf</tt>.<p>

    <h4>NFS</h4>

    See the notes on <A href="nfs.html">NFS in a Heterogeneous Un*x Environment</A> for details 
    on FreeBSD's implementation of NFS.<p>


    <h2>Acknowledgments</h2>

    Special thanks to my fellow sysadmin Christoph Haas 
    (<tt><a href="mailto:ch@adimus.de">ch@adimus.de</a></tt>) for
    helping me test things out and proofreading the FreeBSD side of this note.


    <hr>
    <address>Copyright 1998 <a href="mailto:bs_adminotes@adimus.de">Benedikt Stockebrand</a></address><p>
Version info: $Id: netboot.html,v 1.1.1.1 1998/11/10 11:08:11 bs Exp $<br>
<!-- hhmts start -->
Last modified: Tue Nov 10 12:01:58 CET 1998
<!-- hhmts end -->
  </body>
</html>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?sa77lwqojip.fsf>