📄 livecd.tex
字号:
%% $XORP: xorp/docs/user_manual/livecd.tex,v 1.2 2005/11/11 06:24:02 pavlin 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}See the XORP Web site ({\stt http://www.xorp.org/}) for informationhow 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 aCD-R or CD-RW drive. For example, in case of FreeBSD you can simply run:{\tt burncd -f /dev/acd0c -e data LiveCD.iso fixate}See the XORP Web site for some URLs with instructions on how to burn CD imageson other systems.\section{Running the Live CD}To boot from the Live CD, your PC needs to have the CD-ROM deviceset as the primary boot device. If this is not already the case, you willneed to modify the settings in the BIOS. The boot order should along thelines 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 solong as they're after the CD drive in the boot order. This is usuallypretty easy to change in the BIOS - you might want to make a note ofthe 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 madewhen it is rebooted, you'll also need a floppy disk, but you can trythe Live CD without this.Then reboot the PC. The PC should boot from the CD. Normally it willdisplay a low resolution XORP logo for 30 seconds to a minute whilebooting completes. Sorry - there's no progress bar to let you knowanything is happening.If you've got a floppy in the floppy drive, and you've done thisbefore, then the XORP configuration will be copied into the memoryfilesystem, along with passwords, sshd keys, etc. Then the XORProuting protocols will be started.If there's no floppy in the drive, or it doesn't have the files on itthat XORP expects, then a simple interactive script will run to allowyou to configure passwords and decide which network interfaces youwant XORP to use.\section{Starting XORP the First Time}The startup script that runs the first time you run XORP is quitesimple. If there's no floppy in the floppy drive, or it's notDOS-formatted, you'll be presented with a warning similar to the one inFigure~\ref{fig:livecd:cd1}.\begin{figure}[h] \begin{center} \includegraphics[width=6.0in]{figs/cd1} \caption{LiveCD missing floppy-related warning} \label{fig:livecd:cd1} \end{center}\end{figure}Hit enter, and you'll be given the choices shown inFigure~\ref{fig:livecd:cd2}.\begin{figure}[h] \begin{center} \includegraphics[width=6.0in]{figs/cd2} \caption{LiveCD floppy-related 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 you hadn't got a floppy in the drive, you can add one now, and select 1.If your floppy is not DOS formatted, you can reformat it (erasing all the dataon it) by selecting 3.If you don't have a floppy to hand, you can continue by selecting 2,but you won't be able to preserve any configuration changes you makelater.If you now have a blank writable DOS formatted floppy in the floppydrive, you'll get the notice shown in Figure~\ref{fig:livecd:cd3}.\begin{figure}[h] \begin{center} \includegraphics[width=6.0in]{figs/cd3} \caption{LiveCD floppy-related message} \label{fig:livecd:cd3} \end{center}\end{figure}Hit Enter, and you will be prompted to enter the root password for theFreeBSD system. This will allow you to login to the machine as thesuperuser to diagnose any problems, or to see how XORP works behindthe scenes.Next you will be prompted to enter the password for the "xorp" useraccount. On a normal XORP router, you might have many user accountsfor the different router administrators, but on the Live CD we justcreate one user called "xorp". Please do enter a reasonable password,as this user will be able to login over the network using the sshsecure shell and this password.Finally you will be prompted as to which network interfaces you wishXORP to manage. These interfaces will show up in the default XORPconfiguration file, ready to have IP addresses assigned. The menulooks 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 andthe loopback interface from the Live CD at this stage, because currentlyXORP has no built-in support for dial-up links. Move up and down using thecursor keys, and hit space to select or unselect an option (an "X"implies the option is selected). When you are finished, hit Tab, toselect 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 loginprompt, and you can login to XORP as the "xorp" user with the passwordyou have chosen, and interact with the XORP command line interface tocomplete the configuration, assign IP addresses, etc.\section{Saving Config}The location of the router configuration file used by XORP can be setusing command line parameters, so different XORP systems might chooseto use a different location for this file. On the Live CD, theconfiguration file is stored in {\stt /etc/xorp.cfg}.If you change the router configuration using the XORP shell, and wantto 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\=\killuser@hostname\# \textbf{save /etc/xorp.cfg}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}If you save to any other location, the file will still be preserved onthe floppy, but will not be loaded automatically the next time XORP reboots.\section{Debugging}The Live CD includes two versions of the XORP system binaries. Thenormal version is mounted in a memory filesystem in{\stt /usr/local/xorp</B>}. This version has had the debugging systemsstripped so that the binaries are small enough to reside in a memoryfilesystem. This allows them to load quickly, and to run on a PC withless memory.If you need a debugging version, you can run the following command:{\tt umount /usr/local/xorp}A second copy of {\stt /usr/local/xorp} with debuggingbinaries resides on the CD, and is revealed when the memory filesystemis unmounted. These binaries are rather large, and load slowly, sodon't use them unless you really need them. Using them rather assumesyou know how XORP works internally, so is beyond the scope of thistutorial.\section{Interface Naming}If you're used to Linux, you may be surprised that FreeBSD names it'sEthernet 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 isthat's being used, and that if you know you have one Intel 10/100 and oneDEC 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 isthat 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 justreflects the underlying operating system's naming convention. If youran XORP on Linux, you'd see {\stt eth0}, etc.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -