Netboot



Netboot HOW-TO document for Linux

Bill Dooley

v.00 November 11, 2003



This HOW-TO will attempt to explain what is needed to successfully network boot a minimal linux distribution into RAMDisk using initrd (initial ramdisk).  In doing so this HOW-TO will encompass a broad spectrum of topics.  There are several ways to get a thin-client to boot off the network, (boot floppy or bootrom EPROM).  This HOW-TO will explore only the boot floppy method.  Although this project should work on many Unix/Linux systems it is based on RedHat.

Topics covered
  1. Netboot Introduction
    1. Compiling Netboot makerom and netbootable image utilities
    2. Creating a Netboot disk for your network card with makerom
    3. Creating a bootrom floppy
  2. Create a network bootable (tagged) image from your kernel and file system
  3. Create the necessary server daemons on your server to Netboot your machine (TFTP and DHCP)
    1. TFTP Server 
    2. DHCP Server
  4. Troubleshoot problems


Netboot  Introduction

What is Netboot?
Netboot is a set of tools that allows you to boot a Intel compatible CPU off of a network, provided the necessary infrastructure of  network cards , DHCP, TFTP servers and network connectivity etc. are installed and properly configured.  To accomplish this the computer has to be able to boot via an EPROM socket on a network card or a boot floppy disk, which contains the Netboot bootrom code.  The Netboot bootrom will initalize the network card, perform a  BOOTP request, configure the IP address, gateway, TFTP server, bootimage location etc.  Netboots bootrom then proceeds to download a netbootable image from a TFTP server, places the netbootable image it into memory and then boots the operating system.  The netbootable image is a specially packaged operating system (Linux, DOS, etc) that is created with the mknbi-dos or mknbi-linux utilities which Netboot also provides.

What can you use it for?
The following list shows just a few examples of what Netboot can be used for:


Compiling Netboot bootrom and netbootable image utilities Download latest version from http://netboot.sourceforge.net/english/download.html.
Place tarball in /usr/src directory.  Change directory to /usr/src unzip it by running the command

# tar -zxvf netboot-x.x.x.tar.gz (where the x's represent the latest version number,  0.9.8 is the latest as of this writing).  This will create a directory called netboot-x.x.x in /usr/src/ change directory into netboot-x.x.x.  Configure and compile the netboot utilities by running the command.  There are several configure options in the netboot installation instructions however the default configure will create all utilities.
 

#./configure
#make clean
#make
#make install

If you didn't modify the  ./configure prefix, the default installation step will create a directory and install most of the files in /usr/local/lib/netboot  Executables get installed into /usr/local/bin and the man pages to /usr/local/man.  The neboot configuration file (netboot.config) is installed in /usr/local/etc.

This will not compile on a RedHat 8.0 machine, in-order to get it to compile rename bcc file to something else and try again.

Creating a Netboot disk for your network card with makerom

In order for Netboot to create a bootrom image it needs either a Packet driver or an NDIS driver.  Netboot has configuration support for a wide range of network cards.  However, Netboot cannot distribute commercial drivers, therefore it only contains non-commercial drivers.   If you have a network card that requires a commercial driver you will have to download the manufacturers driver and install it in:
After you install the driver you will need to run the makerom utility.  makerom will create a bootrom image for either a floppy bootdisk or an EPROM.  The makerom utility will scan the pktdrv and ndis2 directories and will create a list of known network cards from it.  If the your card type does not exist in the listing of known cards you will have to see the section below that details how to configure unknown cards.

Below are samples of different makerom scenarios.

Packet and NDIS driver method for those network cards that are known to Netboot.
Make sure you have installed the driver in the appropriate directory describe above, if it is not included in the Netboot package.
To create a bootrom run the command:
# makerom

Below is an abbreviate sample listing of what to expect.

Bootrom configuration program, Version 0.9.8 (netboot)
Copyright (C) 1995-2003 G. Kuhlmann

Build bootrom for a processor older than 386 (y/n) [no] ?
Include support for old-style menus (not recommended) (y/n) [no] ?
Do you want the BIOS to look for boot disks (y/n) [no] ?
Do you want the bootrom to ask before booting from network (y/n) [no] ?


List of known network cards:
(0)     unknown card with user supplied driver
(1)     3Com 3C501 Etherlink ISA
(...)
(131)   Znyx ZX312/314 EtherAction PCI

Select a network card (-1 to review the list) [-1]: 91

You selected: Linksys EtherFast PCI


Do you want to use the packet driver debugger (y/n) [no] ?
Do you want to specify an additional program (y/n) [no] ?


Available output file types for rom image:
(1)     Raw binary
(2)     Intel hex
(3)     Motorola hex
(4)     Tektronix hex
(5)     Image for programming a FlashCard across the network
Select the format you wish to use [1]:
When selecting which output file type for the rom image to be created, an image.flo (floppy image) is always created regardless of which output file type you select.  Another file is also created, image.rom (EPROM image).  The image.rom file is specific to the type of EPROM burner you are using, so select to appropriate one for you burner.

Packet Driver Method for network cards unknown to Netboot
Make sure you download the appropriate driver for your network card.

For this method you need to obtain the following:
After you get the the appropriate packet driver downloaded, install it into the following directory /usr/local/lib/netboot/netdrvr/pktdrvr/.  This is the default location for Netboots packet drivers.  Then you need to identify the network card's vendor ID and PCI ID.  This information can be found at: http://pciids.sourceforge.net/ .  You can also determine the vendor ID and PCI ID if the network card installed in a working linux system, by typing lspci -n and looking at the line that contains Class 0200. A sample printout is displayed below .
# lspci -n
00:00.0 Class 0600: 8086:7190 (rev 02)
00:01.0 Class 0604: 8086:7191 (rev 02)
00:0f.0 Class 0200: 1317:0985 (rev 11)
00:14.0 Class 0601: 8086:7110 (rev 02)
00:14.1 Class 0101: 8086:7111 (rev 01)
00:14.2 Class 0c03: 8086:7112 (rev 01)
00:14.3 Class 0680: 8086:7113 (rev 02)
01:00.0 Class 0300: 1002:4742 (rev 5c)

So in the above example the 1317 is the Vendor ID and 0985 is the PCI ID.
Command line options are describe in a "README" file that is included with you packet driver.  This is to provide specific initialization options for your network card.  If you don't have a "README" file you can determine what the command line options are by running the packet driver on a DOS machine.   This will give you a brief listing of options for that packet driver.  Make sure you don't select any options that specify "Windows".  Sometimes the documentation for the packet driver is not very specific so a lot of trial and error is needed to get the correct configuration.
To create a bootrom run the command:
# makerom

Below is an abbreviate sample listing of what to expect.

Bootrom configuration program, Version 0.9.8 (netboot)
Copyright (C) 1995-2003 G. Kuhlmann

Build bootrom for a processor older than 386 (y/n) [no] ?
Include support for old-style menus (not recommended) (y/n) [no] ?
Do you want the BIOS to look for boot disks (y/n) [no] ?
Do you want the bootrom to ask before booting from network (y/n) [no] ?


List of known network cards:
(0)     unknown card with user supplied driver
(1)     3Com 3C501 Etherlink ISA
(...)
(131)   Znyx ZX312/314 EtherAction PCI

Select a network card (-1 to review the list) [-1]: 0


Known network card bus types:
(1)     ISA bus (including PnP)
(2)     EISA bus
(3)     MCA bus
(4)     PCI bus
Select the bus type of your network card [1]: 4
Enter PCI vendor ID (hex): 1317
Enter PCI device ID (hex): 0985


The following network driver interfaces are available:
(1)     Packet Driver Interface (PD)
(2)     Network Driver Interface Specification (NDIS)
(3)     Universal Network Driver Interface (UNDI)
Select the interface you wish to use [1]: 1
Enter path of packet driver ('*' for directory listing): *
Contents of /usr/local/lib/netboot/netdrvr/pktdrvr:
  3c501.com               3c503.com               3c505.com
  3c507.com               3c509.com               3c523.com
  dc21x4.com              de600.com               depca.com
  e100bpkt.com            e10ppkt.com             ee10pkt.com
  epropkt.com             exos205.com             exp16.com
  hppclan.com             hppclanp.com            lan595.com
  lne100tx.com            ne1000.com              ne2.com
  ne2000.com              ne2100.com              smc_wd.com


Enter path of packet driver ('*' for directory listing): /usr/local/lib/netboot/netdrvr/pktdrvr/lne100tx.com
Enter command line for packet driver [0x%S]: -a 0x60
Enter minimum execution size in bytes (-1 = default) (decimal): -1
Enter maximum execution size in bytes (-1 = default) (decimal): -1
Do you want to use the packet driver debugger (y/n) [no] ?
Do you want to specify an additional program (y/n) [no] ?


Available output file types for rom image:
(1)     Raw binary
(2)     Intel hex
(3)     Motorola hex
(4)     Tektronix hex
(5)     Image for programming a FlashCard across the network
Select the format you wish to use [1]: 1
When selecting which output file type for the rom image to be created, an image.flo (floppy image) is always created regardless of which output file type you select.  Another file is also created, image.rom (EPROM image).  The image.rom file is specific to the type of EPROM burner you are using, so select to appropriate one for you burner.

NDIS  Method for network cards unknown to Netboot
Make sure you download the appropriate driver for your network card.

For this method you need to obtain the following:
After you get the the appropriate NDIS driver downloaded, install it into the following directory /usr/local/lib/netboot/netdrvr/ndis2. This is the default location for Netboots NDIS drivers.  

NDIS driver requires a PROTOCOL.INI file to be available during the makerom process.  It will get parsed and included into the bootrom image.  The file should at least have a section (the part in the square brackets [...]) and a drivername parameter line.  Consult the NDIS "README" files for other protocol options.
sample PROTOCOL.INI file

[lne100tx]
    drivername = LNE100$

After you get the the PROTOCOL.INI configured, install it into the following directory /usr/local/lib/netboot/netdrvr/ndis2.
To create a bootrom run the command:
# makerom

Below is an abbreviate sample listing of what to expect.

Bootrom configuration program, Version 0.9.8 (netboot)
Copyright (C) 1995-2003 G. Kuhlmann

Build bootrom for a processor older than 386 (y/n) [no] ?
Include support for old-style menus (not recommended) (y/n) [no] ?
Do you want the BIOS to look for boot disks (y/n) [no] ?
Do you want the bootrom to ask before booting from network (y/n) [no] ?


List of known network cards:
(0)     unknown card with user supplied driver
(1)     3Com 3C501 Etherlink ISA
(...)
(131)   Znyx ZX312/314 EtherAction PCI

Select a network card (-1 to review the list) [-1]: 0


Known network card bus types:
(1)     ISA bus (including PnP)
(2)     EISA bus
(3)     MCA bus
(4)     PCI bus
Select the bus type of your network card [1]: 4
Enter PCI vendor ID (hex): 1317
Enter PCI device ID (hex): 0985


The following network driver interfaces are available:
(1)     Packet Driver Interface (PD)
(2)     Network Driver Interface Specification (NDIS)
(3)     Universal Network Driver Interface (UNDI)

Select the interface you wish to use [1]: 2
Enter path of NDIS driver ('*' for directory listing): /usr/local/lib/netboot/netdrvr/ndis2/LNE100.DOS
Enter minimum execution size in bytes (-1 = default) (decimal): -1
Enter maximum execution size in bytes (-1 = default) (decimal): -1
Enter path name of PROTOCOL.INI file ('*' for directory listing):  /usr/local/lib/netboot/netdrvr/ndis2/PROTOCOL.INI
Do you want to specify an additional program (y/n) [no] ? n


Available output file types for rom image:
(1)     Raw binary
(2)     Intel hex
(3)     Motorola hex
(4)     Tektronix hex
(5)     Image for programming a FlashCard across the network
Select the format you wish to use [1]: 1
When selecting which output file type for the rom image to be created, an image.flo (floppy image) is always created regardless of which output file type you select.  Another file is also created, image.rom (EPROM image).  The image.rom file is specific to the type of EPROM burner you are using, so select to appropriate one for you burner.

Creating a bootrom floppy

Write the image to a blank floppy disk by running the command.
#dd if=image.flo of=/dev/fd0
This will transfer the image to the floppy drive.  To test this configuration insert the floppy into a PC and boot/reboot it.  Make sure that the PC BIOS is set to boot from floppy first.  If all is successful your computer should display something similar to this.

Netboot v0.9.8, Copyright (C) 1995-2003 G. Kuhlmann
BIOS options: none

Linksys LNE100TX Fast Ethernet Adapter Packet Driver v 1.06 (991217)
Copyright (C) 2000 Linksys Group All Rights Reserved
Performing Automatic Media Detection...
Switching to 100TX Full Duplex...
My Options
Packet Driver Interrupt Number 0x60
I/O Port 0xFC00
Hardware Interrrupt Number 10
Medium Type is 100baseTx Full Duplex
My Ethernet Address is 00:04:5A:4A:4D:1C
Packet Driver is loaded at segment 9721
Found packet driver at int 60, irq 0A

BOOTP: Sending request  (press ESC to abort):


Local IP: 192.168.0.14
Server IP: 192.168.0.10
Gateway IP: 192.168.0.1


Loading /bootImage.nbi


Starting Image...

Create a network bootable (tagged) image from your kernel and file system

Creating a network bootable image for the target operating system requires you first have the necessary kernel, files and directories that are configured and operational.  
Make sure the bzImage and the compressed ramdisk (compressed route file system) image file are in the same directory.
Issue the command below.

# mknbi-linux -x -d ram -i rom -r initrd.gz -k bzImage -o bootImage.nbi

-a String to append to the end of the  kernel  command line. ex. -a ram_disk=24576 if you want to set the ramdisk size .
-d Tells were to load the bootable image, root directory directive either use rom, kernel ram[0-9]. initrd, directory name
-i For NFS root mounting, define client and server IP addresses either use rom, kernel or define it yourself.
-k Is the pathname and kernel file that you want tagged.
-o This is the name of the outfile for the newly tagged image.
-r This is the ramdisk image file that is the root file system.
-x This make the tagging verbose the more x's the more verbose, one x is enough.

After this file is created copy the bootImage.nbi file into your TFTP directory.  In this example copy it to /tftpboot directory which is the root for the TFTP server.  


Create the necessary server daemons on your server to  remote-boot your machine (TFTP and DHCP)
In order to remote boot a diskless client off of a network you need to provide the underlying infrastructure  on a network .  TFTP (Trivial File Transfer Protocol) and DHCP (Dynamic Host Configuration Protocol) need to be available on the network.  A properly configured DHCP server will provide the the remote boot client with the usual IP address, subnet-mask etc.  It also provides the location of a TFTP server and the location and name of the network bootable image.  These services do not have to reside on the same machine, but in this example it will.  Without these services the diskless client will not function.

TFTP Server
Download either the TFTP server from RedHat ftp://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/tftp-server-0.32-4.i386.rpm

You can also download the tarball from http://www.kernel.org/pub/software/network/tftp/.  Download the latest version and follow instructions on how to compile and install the server.

Install the rpm by typing the command
# rpm -ivh tftp-server-0.32-4.i386.rpm
Now create a directory for the TFTP server by issuing the command
# mkdir /tftpboot
RedHat is configure to start TFTP under the xinitd and the configuration file is /etc/xinitd.d/tftp sample below:
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = yes
        per_source              = 11
        cps                     = 100 2
}
The default RedHat configuration has an -s /tftpboot in the server_args line this provides a chrooted feature for TFTP.  This means that TFTP server will treat /tftpboot directory as its root directory.  So any put or get command to the TFTP server will not require you to reference /tftpboot as you will see later in the dhcpd.conf configuration file.  However you must copy the netbootable image into the TFTP server root which is the /tftpboot directory in this example.  To get TFTP to start listening (port 69) issue the command:
# chkconfig tftp on
Verify that it is turned on by issuing the command
# chkconfig --list tftp
 The RedHat RPM for TFTP is started under the xinetd daemon, so to get TFTP started restart the xinetd service by issuing the command
# service xinetd restart
or
# /etc/init.d/xinetd restart
This should now restart xinetd which should also start TFTP.  Verify that TFTP is running by issuing the command:
# netstat -ln
Sample listing of netstat below, look for port 69.
# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:515             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:32768           0.0.0.0:*
udp        0      0 0.0.0.0:13              0.0.0.0:*
udp     8680      0 0.0.0.0:68              0.0.0.0:*
udp        0      0 0.0.0.0:69              0.0.0.0:*
udp        0      0 0.0.0.0:111             0.0.0.0:*


DHCP Server 

Download either the DHCP server from RedHat ftp://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/dhcp-3.0pl1-23.i386.rpm

You can also download the tarball from ftp://ftp.isc.org/isc/dhcp/.  Download the latest version and follow instructions on how to compile and install the server.

Install the rpm by typing the command
# rpm -ivh dhcp-3.0pl1-23.i386.rpm

Configuration
There is a sample dhcpd.conf sample installed in the directory /usr/share/doc/dhcp- version number/

However that file is not quite what you need for remote booting, below is a sample file.  Your dhcpd.conf file needs to be copied into the /etc directory.

# Sample configuration file for ISCD dhcpd
#
# Make changes to this file and copy it to /etc/dhcpd.conf
#

default-lease-time            21600;
max-lease-time                21600;

ddns-update-style interim;
ignore client-updates;

not authoritative;

option subnet-mask            255.255.255.0;
option broadcast-address      192.168.0.255;
option routers                192.168.0.1;
option domain-name-servers    192.168.0.15;
option domain-name            "domainname.com";                  # The domain name of the network used for hostname resolution
#option root-path              "192.168.0.10:/opt/ltsp/i386";    # NFS Root Path  for the client
#option tftp-server-name      192.168.0.10;                      # This is if the TFTP server is located on a different server than DHCP

shared-network WORKSTATIONS {
    subnet 192.168.0.0 netmask 255.255.255.0 {
    }
}

group   {
    use-host-decl-names       on;
    #option log-servers        192.168.0.254;

    host ws001 {
        hardware ethernet     00:00:A0:0A:02:5E;                # The Actual MAC address of the NIC
        fixed-address         192.168.0.14;                     # The reserved address for the above MAC address
        filename              "/bootImage.nbi";                 # The location
##      option option-128     e4:45:74:68:00:00;                # This is NOT a MAC address
##      option option-129     "NIC=ne IO=0x300";
Start the DHCP daemon by issuing the command
# service dhcpd start
or
# /etc/init.d/dhcpd start
This should now start  DHCPd.  Verify that DHCPd is running by issuing the command:
# netstat -ln
Sample listing of netstat below, look for port 67
# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:515             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:32768           0.0.0.0:*
udp        0      0 0.0.0.0:13              0.0.0.0:*
udp        0      0 0.0.0.0:67              0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp        0      0 0.0.0.0:69              0.0.0.0:*
udp        0      0 0.0.0.0:111             0.0.0.0:*
raw        0      0 0.0.0.0:1               0.0.0.0:*

Windows 2000 DHCP server can also be utilized to provide the necessary options to a Netboot client.  Below is a table of options. 

Option  Name                       Vendor      Value                 Class
003     Router                     Standard    192.168.0.1           None
006     DNS Servers                Standard    192.168.0.15          None
015     DNS Domain Name            Standard    domainname.com        None
028     Broadcast Address          Standard    192.168.0.255         None
066     Boot Server Host Name      Standard    tftp.domainname.com   None
067     Bootfile Name              Standard    /bootImage.nbi        None

Troubleshooting Problems
Session setup problem, abort
Login incorrect

If you get these problems this could mean that the name service switch
is not configured or configured properly.


Back Back to the last page

Created automatically from source file HOWTO.html by getdoc on Wed Oct 18 01:48:36 UTC 2017