From owner-freebsd-chat Fri Nov 20 01:02:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA08311 for freebsd-chat-outgoing; Fri, 20 Nov 1998 01:02:36 -0800 (PST) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from mail.ruhrgebiet.individual.net (in-ruhr.ruhr.de [141.39.224.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA08300 for ; Fri, 20 Nov 1998 01:02:30 -0800 (PST) (envelope-from bs@adimus.de) Received: (from admin@localhost) by mail.ruhrgebiet.individual.net (8.8.5-r-beta/8.8.5) with UUCP id KAA19330 for freebsd-chat@freebsd.org; Fri, 20 Nov 1998 10:00:38 +0100 (MET) Received: from mail by mx.adimus.de with local (Exim 1.92 #1) for freebsd-chat@freebsd.org id 0zglvl-000079-00; Fri, 20 Nov 1998 09:28:42 +0100 Received: from det.adimus.de(192.168.0.1) via SMTP by adimus.de, id smtpdeyG391; Fri Nov 20 09:28:32 1998 Received: from bs by det.adimus.de with local (Exim 1.92 #1) for freebsd-chat@FreeBSD.ORG id 0zglvb-0000rk-00; Fri, 20 Nov 1998 09:28:31 +0100 To: FreeBSD-chat Subject: Re: Diskless Workstations References: <3.0.1.32.19981119222844.006ba104@we.mediaone.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit From: Benedikt Stockebrand Date: 20 Nov 1998 09:28:30 +0100 In-Reply-To: gummibear@we.mediaone.net's message of "Thu, 19 Nov 1998 22:28:44 -0800" Message-ID: Lines: 354 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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< --- How to boot Un*x from a Network Server

How to boot Un*x from a Network Server

Introduction

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.

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.

For purely educational purposes this text may be somewhat inadequate, but if you're looking for that sort of information you might prefer W. Richard Stevens, TCP/IP Illustrated, Vol. 1 and the assorted man pages of the systems in question.

Protocols

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.

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.

Platform RARP BOOTP BOOTPGW BOOTPARAMD TFTP NFS
FreeBSD S S, C S, (C) S S, C S, C

FreeBSD 2.2.6

Running a FreeBSD Client

How Things Work

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

Hardware Preparations: Making Your Network Card Boot

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 netboot(8) man page and /usr/src/sys/i386/boot/netboot/Makefile for details.

You find prebuilt rom images in /usr/mdec/nb{8390,3c509}.rom in case you don't want to roll your own in /usr/src/sys/i386/boot/netboot. Just put them in an EPROM, stuff it in your network card and be happy (hopefully, I haven't tried this myself).

If you rather want to use a boot floppy you can use DOS-style .COM files. You'll find them in the same place as the EPROM images but their filename suffix is .com instead of .rom. You can either place them on a DOS floppy and start them from DOS or use a specialized .COM file loader available from the Linux folks. Make your favorite search engine look for the comboot package.

Server Configurations

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

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

Additionally it may be necessary to add some of these tags:

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

The sm field sets the netmask for the IP address given. You may need this if you use subnets. The ds 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 ht 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 bootptab(5) man page or equivalent or the latest Assigned Numbers RFC.

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.

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

This file contains any of the assorted netboot commands necessary to make the machine boot. This is about all you need:

rootfs 192.168.47.1:/netboot/rootfs/snafu swapfs 192.168.47.1:/netboot/swapfs The meaning should be obvious, except maybe for the swap file entry, which is explained below.

Additionally it may be helpful to specify the host name of the client here:

hostname snafu.adimus.de This may help to recycle the same root file system for multiple machines. Then again, it may not.

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

NFS
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).

Building the Kernel

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.

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 /usr/src/sys/i386/conf/LING:

# 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. Maybe they're some sort of help. Then again, maybe they're not.

Populating the Boot File System

Now you need to build a root file system for the machine. Take it from a "disky" installation, fix the config files in /etc 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 /etc/rc* scripts are run. The /etc/rc.network script is smart enough to use that name instead of the one you've specified in /etc/rc.conf. Now if you're smart enough to use some `hostname -s` instead of an actual host name in the remainder of /etc/rc.conf you might well get away with a single set of config files.

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

Open Questions

The netboot(8) 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 netboot(8) code so the BOOTP values for the root and swap file system locations are used instead of the TFTP file contents.

Running a FreeBSD Server

rarpd

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.

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

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

Furthermore it only answers on a single interface as specified as argument unless you give it a -a flag.

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

According to the man page the FreeBSD rarpd reads all its information from the /etc/hosts and /etc/ethers 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 /etc/ethers 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?).

bootpd

The FreeBSD bootpd can be run either via inetd(8) and standalone. It detects this automatically, no options are needed (but available if you want to be sure). The configs are put in /etc/bootptab which is in a termcap(5)-style format. For a complete list of all available tags see the bootptab(5) man page. The most important are (from the man page): 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) 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 tc tag may make things somewhat easier, too.

bootpgw

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.

bootparamd

Yes, FreeBSD apparently has a SUN Solaris® style bootparamd. I haven't had a closer look at it, yet. The man page however is deceptively short.

tftpd

The FreeBSD tftpd is started by inetd. You'll find a (by default disabled) entry in /etc/inetd.conf. It specifies the /tftpboot directory as the base directory for all TFTP access. If you're using the FreeBSD netboot 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 /etc/inetd.conf.

NFS

See the notes on NFS in a Heterogeneous Un*x Environment for details on FreeBSD's implementation of NFS.

Acknowledgments

Special thanks to my fellow sysadmin Christoph Haas (ch@adimus.de) for helping me test things out and proofreading the FreeBSD side of this note.
Copyright 1998 Benedikt Stockebrand

Version info: $Id: netboot.html,v 1.1.1.1 1998/11/10 11:08:11 bs Exp $
Last modified: Tue Nov 10 12:01:58 CET 1998 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message