%
% $XORP: xorp/docs/user_manual/livecd.tex,v 1.3 2008/07/22 10:51:46 bms Exp $
%

\chapter{XORP Live CD}
\label{livecd}

The XORP Live CD is a bootable CD for x86 PCs.
The Live CD serves a number of purposes:

\begin{itemize}

  \item It's an easy way to try out XORP without needing to
  compile anything or reformat the disk on your PC.
  \item It's a quick way to get a relatively secure router on demand.
  \item It's a great tool for a student lab session, requiring no
  installation.

\end{itemize}

As of release 1.5, the XORP Live CD no longer supports floppy disks. Instead,
USB disks are used for configuration storage. The Live CD is now based on
FreeBSD 7.0.

See the XORP Web site ({\stt http://www.xorp.org/}) for information
how to download the lastest version of the XORP LiveCD ISO image.
Once you've downloaded the CD image, you will need to burn it using a
CD-R or CD-RW drive. For example, in case of FreeBSD you can simply run:

{\tt burncd -f /dev/acd0c -e data XORP-1.5-LiveCD.iso fixate}

See the XORP Web site for some URLs with instructions on how to burn CD images
on other systems.

\section{Running the Live CD}

To boot from the Live CD, your PC needs to have the CD-ROM device
set as the primary boot device.  If this is not already the case, you will
need to modify the settings in the BIOS.  The boot order should along the
lines of:

\begin{enumerate}
  \item CD drive.
  \item Floppy Disk.
  \item Hard Disk.
\end{enumerate}

The order of the floppy and hard disk are unimportant, just so
long as they're after the CD drive in the boot order.  This is usually
pretty easy to change in the BIOS - you might want to make a note of
the original boot order in case you want to switch it back afterwards.
Typically to change BIOS settings, you hold down Delete or F2
(depending on your PC) just after you restart your PC.

If you want the router to store any configuration changes you have made
when it is rebooted, you'll also need a USB disk, but you can try
the Live CD without this.

Then reboot the PC.  The PC should boot from the CD.  Normally it will
display the FreeBSD boot-time console for 30 seconds to a minute while
booting completes.  Sorry - there's no progress bar to let you know
anything is happening.

If you've got a USB disk connected to the machine, and you've done this
before, then the XORP configuration will be copied into the memory
filesystem, along with passwords, sshd keys, etc.  Then the XORP
routing protocols will be started.

If there's no USB disk connected, or it doesn't have the files on it
that XORP expects, then a simple interactive script will run to allow
you to configure passwords and decide which network interfaces you
want XORP to use.


\section{Starting XORP the First Time}

The startup script that runs the first time you run XORP is quite
simple. If there's no USB disk connected, or it's not DOS-formatted,
you'll be presented with a warning similar to the one in
Figure~\ref{fig:livecd:cd1}.

\begin{figure}[h]
  \begin{center}
    \includegraphics[width=6.0in]{figs/cd1}
    \caption{LiveCD missing configuration device warning}
    \label{fig:livecd:cd1}
  \end{center}
\end{figure}

Hit enter, and you'll be given the choices shown in
Figure~\ref{fig:livecd:cd2}.

\begin{figure}[h]
  \begin{center}
    \includegraphics[width=6.0in]{figs/cd2}
    \caption{LiveCD configuration device menu}
    \label{fig:livecd:cd2}
  \end{center}
\end{figure}


Use the cursor keys to move up and down to choose an option, and hit enter.

If no USB disk is connected, you can add one now, and select 1.

If your USB disk is not DOS formatted, you can reformat it (erasing all the data
on it) by selecting 3.

If you don't have a USB disk to hand, you can continue by selecting 2,
but you won't be able to preserve any configuration changes you make
later.

If you now have a writable, DOS formatted USB device connected,
hit Enter, and you will be prompted to enter the root password for the
FreeBSD system.  This will allow you to login to the machine as the
superuser to diagnose any problems, or to see how XORP works behind
the scenes.

Next you will be prompted to enter the password for the "xorp" user
account.  On a normal XORP router, you might have many user accounts
for the different router administrators, but on the Live CD we just
create one user called "xorp".  Please do enter a reasonable password,
as this user will be able to login over the network using the ssh
secure shell and this password.

Finally you will be prompted as to which network interfaces you wish
XORP to manage.  These interfaces will show up in the default XORP
configuration file, ready to have IP addresses assigned.  The menu
looks like the one shown in Figure~\ref{fig:livecd:cd4}.

\begin{figure}[h]
  \begin{center}
    \includegraphics[width=6.0in]{figs/cd4}
    \caption{LiveCD network interfaces menu}
    \label{fig:livecd:cd4}
  \end{center}
\end{figure}

Typically you will only want XORP to manage Ethernet interfaces and
the loopback interface from the Live CD at this stage, because currently
XORP has no built-in support for dial-up links.  Move up and down using the
cursor keys, and hit space to select or unselect an option (an "X"
implies the option is selected).  When you are finished, hit Tab, to
select the "OK" button, and hit Enter.

That's it.  XORP will now finish booting.

Once XORP has finished booting, you will be presented with a login
prompt, and you can login to XORP as the "xorp" user with the password
you have chosen, and interact with the XORP command line interface to
complete the configuration, assign IP addresses, etc.

\section{Saving Config}

The location of the router configuration file used by XORP can be set
using command line parameters, so different XORP systems might choose
to use a different location for this file.  On the Live CD, the
configuration file is stored in {\stt /etc/local/xorp.conf}.

If you change the router configuration using the XORP shell, and want
to save it, you need to enter the following in configuration mode:

\vspace{0.1in}
\noindent\framebox[\textwidth][l]{\scriptsize
\begin{minipage}{6in}
\begin{alltt}
\begin{tabbing}
xxxxxxxxxxxxxxxxxx\=\kill
user@hostname\# \textbf{save /etc/local/xorp.conf}
\end{tabbing}
\end{alltt}
\end{minipage}
}
\vspace{0.1in}

If you save to any other location, the file will not be loaded automatically the next time XORP reboots.

If you want to preserve the configuration on a USB disk, use the following
command in the XORP shell's operational mode:

\vspace{0.1in}
\noindent\framebox[\textwidth][l]{\scriptsize
\begin{minipage}{6in}
\begin{alltt}
\begin{tabbing}
xxxxxxxxxxxxxxxxxx\=\kill
user@hostname> \textbf{usb save}
\end{tabbing}
\end{alltt}
\end{minipage}
}
\vspace{0.1in}


\section{Interface Naming}

If you're used to Linux, you may be surprised that FreeBSD names it's
Ethernet interfaces with names like {\stt fxp0}, {\stt fxp1},
{\stt dc0} and {\stt xl3}, rather than {\stt eth0}, {\stt eth1}, etc.
The advantage is that you can tell exactly what the device driver is
that's being used, and that if you know you have one Intel 10/100 and one
DEC Tulip in the machine, you know they'll be called {\stt fxp0} and
{\stt dc0}, no matter which PCI slot they're in.  The disadvantage is
that it's more confusing for beginners who don't want to know this detail.

Some people get religious about such things.  We don't - this just
reflects the underlying operating system's naming convention.  If you
ran XORP on Linux, you'd see {\stt eth0}, etc.
