Software Installation And Configuration
The Reverse ARP Daemon
A reverse ARP daemon is already installed on your system; it's part of the
net-misc/iputils package
Setting up common rarpd elements: /etc/ethers
You will need to setup the /etc/ethers file. This file indicates
which hosts rarpd should respond to when a request is seen, and what
address to reply with.
The format of /etc/ethers is the MAC address of the NIC the
machine will be netbooting and its hostname. Whitespace delimits the MAC
address from the hostname, and each entry should have its own line. The
following example is for a host named sparc-netboot.gentoo.org:
08:00:20:77:1f:3e sparc-netboot.gentoo.org
If a given hexadecimal number in the MAC address starts or is 0, you can chose
to omit the first 0 (i.e. 08:00:20:77:1f:3e becomes 8:0:20:77:1f:3e).
If you desire to add additional hosts to /etc/ethers, you do not
need to restart the rarpd services as the file is checked each time a
request is received.
Resolving hostnames: /etc/hosts
Since each entry in /etc/ethers has a hostname, the netboot server
needs to be able to resolve the hostname into its IP address. This can be done
two ways, /etc/hosts or the nameserver the netboot server uses.
An /etc/hosts entry for resolving a hostname will look very
similar to the one that probably exists from when you installed Gentoo on the
netboot server. For our example host, sparc-netboot.gentoo.org, we'll assume
that it has an IP address of 10.0.1.15. So the /etc/hosts entry
would look like;
10.0.1.15 sparc-netboot.gentoo.org
Depending on the environment, you may need to consult your network
administrator to get an appropriate IP address or addresses to netboot the host
with.
If you use a nameserver, then the DNS server administrator will need to add a
record for the hostname, in our example sparc-netboot.gentoo.org, to point to
the appropriate IP address. Please consult your DNS server administrator and/or
the documentation for the DNS server's DNS software for how to add the entry.
If both /etc/hosts and the nameserver have an entry for the host
to be netbooted, /etc/hosts will be used first (granted the order
of /etc/nsswitch.conf has not been changed from the default).
Setting up rarpd
First, we will need to determine the options to use for rarpd. While
there are more options than we'll cover here, these options should get you
started As there is currently no init.d script for rarpd, an
entry will need to be added to /etc/conf.d/local.start if you want
to enable rarpd services at boot time. A sample entry is as follows:
/usr/sbin/rarpd -v -e eth0
An explanation of the above rarpd options (as taken from the man page):
- -v Be verbose
-
-e Do not check for the presence of a boot image, reply if MAC
address resolves to a valid IP address using /etc/ethers
database and DNS
- eth0 represents the interface rarpd should bind to
For more options, consult man 8 rarpd.
The tftpd Daemon
Here there are three options for a TFTP daemon, net-ftp/atftp,
net-ftp/netkit-tftp and net-ftp/tftp-hpa. You only need to
install one of the TFTP daemons for proper operation.
Setting up common tftpd elements
Each TFTP daemon will need a directory from which to serve files to tftp
clients. The directory we will use for this howto will be
/tftpboot. This will appear as the root (/) directory
to the clients when requests are received. Additionally, we'll setup the system
to run the TFTP daemon with the user and group nobody.
If the directory you have chosen does not currently exist, it will need to be
created with the mkdir command. The command for the example
/tftpboot is:
# /bin/mkdir /tftpboot
Then we will need to change the owner of /tftpboot so that it is
owned by user nobody and group nobody:
# chown nobody:nobody /tftpboot
The atftp Daemon
First, install the atftp package as follows;
# emerge atftp
After the atftp package has been installed, it will need to be
configured. If tftpd services are desired at boot time, an entry to
/etc/conf.d/local.start will need to be added as atftp has
no init.d, inetd or xinetd scripts of its own. If you
want to use inetd or xinetd for controlling the tftpd service,
please see their respective man pages.
Below is an example entry for atftpd in
/etc/conf.d/local.start.
/usr/sbin/in.tftpd -v --daemon /tftpboot
An explanation of the above options (as taken from the man page);
-
-v Increase or set the logging level. No args will increase by one
the current value. Default is LOG_NOTICE, see syslog(3) for log level.
Current value range from 0 (LOG_EMERG) to 7 (LOG_DEBUG)
-
--daemon Run as a daemon. Do not use this option if atftpd is
started by inetd.
For more options, consult man 8 atftpd.
The netkit-tftp Daemon
First, install the netkit-tftp package:
# emerge netkit-tftp
Second, install sys-apps/xinetd if it is not currently present. After
the netkit-tftp and sys-apps/xinetd packages have been
installed, netkit-tftp will need to be configured. netkit-tftp
needs to be run from xinetd, however it does not provide example scripts
of its own. A sample xinetd file is provided below:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
group = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
only_from = 10.0.1.0
disable = no
}
This sample xinetd configuration file for tftp uses the line disable =
no, which enables the service by default. This is opposite of the default
way packages in Gentoo provide their respective xinetd configuration
files, which have disable set to yes.
An explanation of the above options which can be changed:
- user: the user in.tftpd requests are handled as
- group: the group in.tftpd requests are handled as
-
server_args: the root directory for the TFTP daemon to serve files
from
-
only_from: tells xinetd which hosts to allow TFTP connections from
Additional information on xinetd configuration files can be found in
man 5 xinetd.conf.
If xinetd is running, you can send it the HUP signal to have it re-read
its configuration files:
# /bin/killall -HUP xinetd
If xinetd is not running, start it with the init.d command:
# /etc/init.d/xinetd start
For more information, consult man 8 in.tftpd.
The tftp-hpa Daemon
First, install the tftp-hpa package:
# emerge tftp-hpa
tftp-hpa comes with an init.d and the accompanying
conf.d configuration file. Check to make sure that INTFTPD_PATH
and INTFTP_OPTS in /etc/conf.d/in.tftpd match those below:
INTFTPD_PATH="/tftpboot"
INTFTPD_OPTS="-s -v -l ${INTFTPD_PATH}"
The TFTP daemon can then be started via the init.d script:
# /etc/init.d/in.tftpd start
For more options, consult man 8 tftpd.
Preparing a tftpboot image for use by a client
Make sure you have an image you want to use for netbooting. Please check your
local Gentoo distfiles
mirror for the appropriate image. We'll assume you are planning to boot
using the gentoo-sparc64-20100128.tftpboot image.
Once you have an image, copy the image into /tftpboot:
# cp gentoo-sparc64-20100128.tftpboot /tftpboot
# chmod 644 /tftpboot/gentoo-sparc64-20100128.tftpboot
Now, when the netboot client makes a TFTP request, it looks for a file that is
the hexadecimal number of its current IP address, and on some platforms an
.ARCH suffix. The hexadecimal number should use capital
characters.
So for our example IP address, 10.0.1.15, let's look at its hexadecimal
equivalent:
# printf "%.2X%.2X%.2X%.2X\n" 10 0 1 15
decimal 10 0 1 15
hexadecimal 0A 00 01 0F
So for the example netboot client, it would look for a file named
0A00010F when it tftpboots.
Iif you are really, really lazy (like me), you can netboot the host to get the
filename the client is looking for from the netboot server logs.
Make sure that both the rarpd and TFTP daemon you've chosen are currently
running, then boot the host as described below in Netbooting the client.
The client will appear to hang after the boot net command is issued. Then on
the netboot server, check the system logs for an entry for in.tftpd.
An example entry from a netboot server running sysklogd and
tftp-hpa looks like:
Jan 3 22:48:59 stargazer in.tftpd[8368]: RRQ from 10.0.1.15 filename 0A00010F
The filename is shown above after "filename" in the log entry, which in this
case is 0A00010F.
As a way to keep track of what netboot image you are using, and to allow
multiple machines to use the same netboot image, you can use a soft link to
create the file with the hexadecimal value. To create this using our sample
sparc64 host and the gentoo-sparc64-20100128.tftpboot, use
the following command:
# /bin/ln -s /tftpboot/gentoo-sparc64-20100128.tftpboot \
/tftpboot/0A00010F
Now everything should be set for netbooting!
Troubleshooting
Building the prerequisite software
If the netboot server is a Gentoo Linux system and experiences problems after
installing the rarpd and tftpd packages, please search the Gentoo Forums and Gentoo Bugzilla to see if this problem has
been encountered by anyone else. If it has not, or the solutions found do not
work, then please open a new bug.
I've issued the boot net command but it appears to hang.
This is presumably because the file your system is trying to load from the
tftpboot server is not available. On a SPARC system, you would probably see the
following:
Rebooting with command: boot
Boot device: net File and args:
Double check that the file the client needs does exist in
/tftpboot. You can confirm the filename it is requesting by
looking in the system logs. Also, once this file exists, the client will try to
load it. Sometimes, when the file is missing originally, it will freeze
downloading the file once it appears. To resolve this, just get back to an OBP
prompt, and issue the "boot net" command again. The host should then start
downloading the tftpboot image and boot the OS.
I'm trying to netboot, but all I see are "Timeout waiting for ARP/RARP
packet" messages.
This could be due to a few different problems;
-
Make sure the entry in /etc/ethers exists for the client in
question. If the MAC address is incorrect and/or the netboot server cannot
resolve the hostname for the client, it cannot respond with the needed
information.
-
Verify that the network hub or switch the netboot server and client are
connected to allow RARP traffic to flow freely. If the client's request
cannot reach the server, or vice versa, the host will be unable to
continue.
-
No one is responding to the RARPD request because no services are
listening. Verify that the rarpd service is up and running.
-
The client does not think its NIC has a link to the network hub/switch it
is plugged into. Check to see if the NIC and the port on the network hub or
switch has a link light. If the link light is on, check to see what the
setting of tpe-link-test? is in OBP with the command; printenv
tpe-link-test?. You should receive something like tpe-link-test?
false true. The first column represents the parameter name, the
second column shows the current value for the the parameter, and the third
column shows the default value for the parameter. In the example above, we
can see that the current value is false, which means that the client is not
checking to see if the client and network hub or switch can establish a
link before issuing its RARP request. Often times this can cause the
problem.
To change the value of tpe-link-test? from an OBP prompt, issue the following
command:
ok setenv tpe-link-test? true
tpe-link-test? = true
This shows the value of tpe-link-test? is now true. Try netbooting the client
again.