xorpsh_userguide.tex
来自「BCAST Implementation for NS2」· TEX 代码 · 共 658 行 · 第 1/2 页
TEX
658 行
\>show \> Show the value of a parameter\\\>top \> Exit to top level of configuration\\\>up \> Exit one level of configuration\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentThe router configuration has a tree form similar to the directorystructure on a Unix filesystem. The current configuration or parts ofthe configuration can beshown with the show command:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\kill[edit]\\XORP> \textbf{show interfaces}\\\>interface rl0 \{\\\>\>description: "control interface"\\\>\>vif rl0 \{\\\>\>\>address 192.150.187.108 \{\\\>\>\>\>prefix-length: 25\\\>\>\>\>broadcast: 192.150.187.255\\\>\>\>\}\\\>\>\}\\\>\}\\\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\subsection{Moving around the Configuration Tree}You can change the current location in the configuration tree usingthe edit, up, top and exit commands.\begin{itemize}\item \textbf{edit $<$\textit{element name}$>$}: Edit a sub-element\item \textbf{exit}: Exit from this configuration level, or ifat top level, exitconfiguration mode.\item \textbf{quit}: Quit from this level\item \textbf{top}: Exit to top level of configuration\item \textbf{up}: Exit one level of configuration\end{itemize}\noindentFor example:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\kill[edit]\\XORP> \textbf{edit interfaces interface rl0 vif rl0}\\\\\noindent[edit interfaces interface rl0 vif rl0]\\XORP> \textbf{show}\\\>address 192.150.187.108 \{\\\>\>prefix-length: 25\\\>\>broadcast: 192.150.187.255\\\>\}\\\\\noindent[edit interfaces interface rl0 vif rl0]\\XORP> \textbf{up}\\\\\noindent[edit interfaces interface rl0]\\XORP> \textbf{top}\\\\\noindent[edit]\\XORP>\end{tabbing}\end{alltt}\end{minipage}}\subsection{Loading and Saving Configurations}On startup, the rtrmgr will read a configuration file. It will thenstart up and configure the various router components as specified inthe configuration file.The configuration file can be created externally, using a normal texteditor, or it can be saved from the running router configuration. Aconfiguration file can also be loaded into a running router, causingthe previous running configuration to be discarded. The commands forthis are:\begin{itemize}\item \textbf{save $<$\textit{filename}$>$}: save the currentconfiguration in the specified file.\item \textbf{load $<$\textit{filename}$>$}: load the specified file,discarding the currently running configuration.\end{itemize}\subsection{Setting Configuration Values}\begin{itemize}\item \textbf{set $<$\textit{path to config}$>$$<$\textit{value}$>$}: set the value of the specified configurationnode.\end{itemize}The set command is used to set or change the value of a configurationoption. The change does not actually take effect immediately - thecommit command must be used to apply this and any other uncommittedchanges.In the example below, the prefix length (netmask) of address192.150.187.108 on vif rl0 is changed, but not yet committed. The``{\tt >}'' indicates parts of the configuration that have changed butnot yet been committed.\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\kill\noindent[edit interfaces interface rl0]\\XORP> \textbf{show}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\\>\>\>prefix-length: 25\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\\\\\noindent[edit interfaces interface rl0]\\XORP> \textbf{set vif rl0 address 192.150.187.108 prefix-length 24}\\OK\\\\\noindent[edit interfaces interface rl0]\\XORP> \textbf{show}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\>\>\> prefix-length: 24\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\\\end{tabbing}\end{alltt}\end{minipage}}\newpage\subsection{Adding New Configuration}New configuration can simply be typed at the command line while inconfiguration mode. The user interface for this is currently ratherprimitive and doesn't permit the more free-form configuration allowedin configuration files.For example, to configure a second vif on interface rl0:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\kill\noindent[edit interfaces interface rl0]\\XORP> \textbf{show}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\\>\>\>prefix-length: 24\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\\\\\noindent[edit interfaces interface rl0]\\XORP> \textbf{vif rl0b \{}\\\>\>>\> \textbf{address 10.0.0.1 \{}\\\>\>>\>\> \textbf{prefix-length 16}\\\>\>>\>\> \textbf{broadcast 10.0.255.255}\\\>\>>\>\> \textbf{\}}\\\>\>>\> \textbf{\}}\\OK. Use "commit" to apply these changes.\\\\\noindent[edit interfaces interface rl0]\\XORP> \textbf{show}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\\>\>\>prefix-length: 24\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\\> vif rl0b \{\\>\>\> address 10.0.0.1 \{\\>\>\>\> prefix-length: 16\\>\>\>\> broadcast: 10.0.255.255\\>\>\>\}\\>\>\}\\\end{tabbing}\end{alltt}\end{minipage}}\subsection{Deleting Parts of the Configuration}The delete command can be used to delete subtrees from theconfiguration. The deletion will be visible in the results of theshow command, but will not actually take place until the changes arecommitted.\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killXORP> \textbf{show interfaces interface rl0}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\\>\>\>prefix-length: 24\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\\\>vif rl0b \{\\\>\> address 10.0.0.1 \{\\\>\>\> prefix-length: 16\\\>\>\> broadcast: 10.0.255.255\\\>\>\}\\\>\}\\\\\noindent[edit]\\XORP> \textbf{delete interfaces interface rl0 vif rl0b}\\Deleting:\\\>address 10.0.0.1 \{\\\>\>prefix-length: 16\\\>\>broadcast: 10.0.255.255\\\>\}\\\\OK\\\\\noindent[edit]\\XORP> \textbf{show interfaces interface rl0}\\\>description: "control interface"\\\>vif rl0 \{\\\>\>address 192.150.187.108 \{\\\>\>\>prefix-length: 24\\\>\>\>broadcast: 192.150.187.255\\\>\>\}\\\>\}\end{tabbing}\end{alltt}\end{minipage}}\newpage\subsection{Committing Changes}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}\noindent[edit interfaces interface rl0]\\XORP> \textbf{commit}\\OK\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}The commit command commits all the current configuration changes.This can take a number of seconds before the response is given.{\it If xorpsh was built with debugging enabled, the response can beconsiderably more verbose than shown above!}If two or more users are logged in using configuration mode, and oneof them changes the configuration, the others will receive a warning:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}\noindent[edit]\\XORP>\\The configuration had been changed by user mjh\\XORP>\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\subsection{Discarding Changes}The user can discard a batch of changes by editing them back to theiroriginal configuration, or by using the exit command to leaveconfiguration mode:\vspace{0.1in}\noindent\fbox{\begin{minipage}{6in}\begin{alltt}\begin{tabbing}\noindent[edit]\\XORP> \textbf{exit}\\Error: There are uncommitted changes\\Use "commit" to commit the changes, or "exit discard" to discard them\\\\XORP> \textbf{exit discard}\\Xorp>\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\end{document}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?