xorpsh_userguide.tex

来自「BCAST Implementation for NS2」· TEX 代码 · 共 658 行 · 第 1/2 页

TEX
658
字号
\documentclass[11pt]{article}\usepackage{graphicx}\usepackage{times}\usepackage{xspace}\usepackage{alltt}\usepackage{stmaryrd}\textwidth 6.5in\topmargin 0.0in\textheight 8.5in\headheight 0in\headsep 0in\oddsidemargin 0in\parskip 0in%\newcommand{\xorpsh}{\textsc{xorpsh}}\newcommand{\xorpsh}{{\sf\small xorpsh}\xspace}\title{XORP Command Line Interface User Guide\\Part 1: Command Structure \\\vspace{1ex}Version 0.5}\author{ XORP Project					\\	 International Computer Science Institute	\\	 Berkeley, CA 94704, USA			\\	 {\it feedback@xorp.org}}\date{November 6, 2003}%\twocolumn\begin{document}\maketitle                            \section{Introduction}To interact with a XORP router using the command line interface (CLI),a user runs \xorpsh.  This allows configuration of the router andmonitoring of the router state.  In this document we describe how to interact with \xorpsh.  Thisdocument does not provide specifics of how to configure BGP, PIM, SNMPand other processes - this will eventually be described in additionaldocuments.The user interface style is loosely modelled on that of a Juniperrouter.  This manual and the xorpsh itself are works in progress, andso may change significantly in the future.\section{Running xorpsh}\xorpsh provides an interactive command shell to a XORP user, similarin many ways to the role played by a Unix shell.  In a productionrouter, it is envisaged that \xorpsh might be set up as a user's loginshell - they would login to the router via ssh and be directly in the\xorpsh environment.  However, for research and development purposes,it makes more sense to login normally to the machine running thertrmgr process, and to run \xorpsh directly from the Unix command line.\xorpsh should normally be run as a regular user; it is neithernecessary or desirable to run it as root.  If the user is to bepermitted to make changes to the running router configuration, theyneed to be in the Unix group {\tt xorp}.  The choice of GID for groupxorp is not important.\xorpsh needs to be able to communicate with the rtrmgr using the localfile system.  If the rtrmgr cannot write files in /tmp that \xorpshcan read, then \xorpsh will not be able to authenticate the user to thertrmgr.Multiple users can run \xorpsh simultaneously.  There is some degree ofconfiguration locking to prevent simultaneous changes to the routerconfiguration, but currently this is fairly primitive.\section{Basic Commands}On starting \xorpsh, you will be presented with a command line prompt:\vspace{0.1in}\noindent\fbox{\begin{minipage}{4in}\begin{alltt}Xorp>\end{alltt}\end{minipage}}\vspace{0.1in}\noindentYou can exit \xorpsh at any time by trying Control-d.\noindentTyping ``?'' at the prompt will list the commands currently available toyou:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}Xorp> \textbf{?}\\Po\=ssible compl\=etions:\\\>configure       \>Switch to configuration mode\\\>help            \>Provide help with commands\\\>quit            \>Quit this command session\\\>show            \>help\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentIf you type the first letter or letters of a command, and hit{\tt <Tab>}, then command completion will occur.\noindentAt any time you can type ``?'' again to see further command completions.  Forexample:\vspace{0.1in}\noindent\fbox{\begin{minipage}{4in}\begin{alltt}\begin{tabbing}Xorp> \textbf{config?}\\Po\=ssible compl\=etions:\\\>configure\>Switch to configuration mode\\Xorp> \textbf{config}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentIf the cursor is after the command, typing ``?'' will list the possibleparameters for the command:\vspace{0.1in}\noindent\fbox{\begin{minipage}{4in}\begin{alltt}\begin{tabbing}Xorp> \textbf{configure ?}\\Po\=ssible compl\=etions:\\\><[Enter]>       \>Execute this command\\\>exclusive       \>Switch to configuration mode, locking out other users\\\>|               \>Pipe through a command\\Xorp> \textbf{configure}\end{tabbing}\end{alltt}\end{minipage}}\subsection{Command History and Command Line Editing}\xorpsh supports emacs-style command history and editing of the texton the command line.  The most important commands are:\begin{itemize}\item The {\bf up-arrow} or {\bf control-p} moves to the previouscommand in the history.\item The {\bf down-arrow} or {\bf control-n} moves to the nextcommand in the history.\item The {\bf left-arrow} or {\bf control-b} moves back along thecommand line.\item The {\bf right-arrow} or {\bf control-f} move forward along thecommand line.\item {\bf control-a} moves to the beginning of the command line.\item {\bf control-e} moves to the end of the command line.\item {\bf control-d} deletes the character directly under the cursor.\item {\bf control-t} toggles (swaps) the character under the cursor withthe character immediately preceding it.\item {\bf control-space} marks the current cursor position.\item {\bf control-w} deletes the text between the mark and the currentcursor position, copying the deleted text to the cut buffer.\item {\bf control-k} kills (deletes) from the cursor to the end of thecommand line, copying the deleted text to the cut buffer.\item {\bf control-y} yanks (pastes) the text from the cut buffer,inserting it at thecurrent cursor location.\end{itemize}\newpage\section{Command Modes}\xorpsh has two command modes:\begin{description}\item{\bf Operational Mode,}  which allows interaction with the routerto monitor it's operation and status.\item{\bf Configuration Mode,} which allows the user to view theconfiguration of the router, to change that configuration, and toload and save configurations to file.\end{description}Generally speaking, operational mode is considered to givenon-privileged access; there should be nothing a user can type thatwould seriously impact the operation of the router.  In contrast,configuration mode allows all aspects of router operation to bemodified.In the long run, \xorpsh and the rtrmgr will probably come to supportfine-grained access control, so that some users can be givenpermission to change only subsets of the router configuration.  At thepresent time though, there is no fine-grained access control.A user can only enter configuration mode if they are in the {\tt xorp} Unixgroup.\newpage\section{Operational Mode}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}Xorp> \textbf{?}\\Po\=ssible compl\=etions:\\\>configure       \>Switch to configuration mode\\\>help            \>Provide help with commands\\\>quit            \>Quit this command session\\\>show            \>help\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}The main commands in operational mode are:\begin{description}\item{\bf configure}: switches from operational mode to configurationmode.\item{\bf help}: provides online help (not yet implemented)\item{\bf quit}: quit from xorpsh.  (not yet implemented - usecontrol-d instead).\item{\bf show}: displays many aspects of the running state of therouter.\end{description}\subsection{Show Command}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}Xorp> \textbf{show ?}\\Po\=ssible compl\=etions:\\\>  bgp             \>help\\\>  interface       \>help\\\>  vif             \>help\\Xorp> \textbf{show}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentThe show command is used to display many aspects of the running stateof the router.  We don't describe the sub-commands here, because theydepend on the running state of the router.  For example, only a routerthat is running BGP should provide {\tt show bgp} commands.  As an example, we show the peers of a BGP router:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}Xorp> \textbf{show bgp peers detail}\\OK\\Pe\=er 1: local 192.150.187.108/179 remote 192.150.187.109/179\\\>  Peer ID: 192.150.187.109\\\>  Peer State: ESTABLISHED\\\>  Admin State: START\\\>  Negotiated BGP Version: 4\\\>  Peer AS Number: 65000\\\>  Updates Received: 5157,  Updates Sent: 0\\\>  Messages Received: 5159,  Messages Sent: 1\\\>  Time since last received update: 4 seconds\\\>  Number of transitions to ESTABLISHED: 1\\\>  Time since last entering ESTABLISHED state: 47 seconds\\\>  Retry Interval: 120 seconds\\\>  Hold Time: 90 seconds,  Keep Alive Time: 30 seconds\\\>  Configured Hold Time: 90 seconds,  Configured Keep Alive Time: 30 seconds\\\>  Minimum AS Origination Interval: 0 seconds\\\>  Minimum Route Advertisement Interval: 0 seconds\\\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\newpage\section{Configuration Mode}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}Xorp> \textbf{configure}\\Entering configuration mode.\\There are no other users in configuration mode.\\\\\noindent[edit]\\XORP>\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentWhen in configuration mode, the command prompt changes to be allcapitals.The command prompt is also usually preceded by a line indicating whichpart of the configuration tree is currently being edited.\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}[edit]\\XORP> \textbf{?}\\Po\=ssible completi\=ons:\\\>delete  \>    Delete a configuration element\\\>edit    \>    Edit a sub-element\\\>exit    \>    Exit from this configuration level\\\>help    \>    Provide help with commands\\\>interfaces\>help\\\>load    \>    Load configuration from a file\\\>protocols\> help\\\>quit    \>    Quit from this level\\\>run     \>    Run an operational-mode command\\\>save    \>    Save configuration to a file\\\>set     \>    Set the value of a parameter\\

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?