⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config_overview.tex

📁 xorp源码hg
💻 TEX
📖 第 1 页 / 共 2 页
字号:
%% $XORP: xorp/docs/user_manual/config_overview.tex,v 1.22 2006/06/30 00:43:04 pavlin Exp $%\chapter{Configuration Overview}\section{Introduction}A XORP router must be configured to perform the desired operations.The configuration information can be provided in one of the two ways:\begin{itemize}\item  Use a configuration file when the \rtrmgr is started.  By default, the \rtrmgr will load the configuration from file  ``config.boot'' in the XORP installation directory.  This file can be specified by the ``-b~~$<$filename$>$'' command line  option:\begin{verbatim}    xorp_rtrmgr -b my_config.boot\end{verbatim}    See ``rtrmgr/config.boot.sample'' for an example of a    configuration file (note that this file MUST be modified    before using it).\item  Use the \xorpsh command line interface after the \rtrmgr is started.  It should be noted that command line completion in the \xorpsh  does greatly simplify configuration.\end{itemize}\noindentA mixture of both methods is permissible. For example,a configuration file can also be loaded from within the \xorpsh.At very minimum, a router's interfaces must be configured (seeSection~\ref{sec:network_interfaces}). Typically, the FEA needs to beconfigured (\eg to enable unicast forwarding); the FEA configuration isdescribed in Section~\ref{sec:fea}. All protocol configuration isdescribed in Section~\ref{sec:protocols}.\section{Network Interfaces}\label{sec:network_interfaces}A XORP router will only use interfaces that it has been explicitlyconfigured to use. Even for protocols such as BGP that are agnostic tointerfaces, if the next-hop router for a routing entry is not througha configured interface the route will not be installed. For protocolsthat are explicitly aware of interfaces only configured interfaceswill be used.Every physical network device in the system is considered to be an``interface''. Every interface can contain a number of virtualinterfaces (``vif''s). In the majority of cases the interface name andvif name will be identical and will map to the name given to theinterface by the operating system. A virtual interface is configuredwith the address or addresses that should be used. At each level inthe configuration hierarchy ({\tt interface}, {\tt vif} and{\tt address}) it is necessary to enable this part of theconfiguration.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killinterfaces \{\\\>restore-original-config-on-shutdown: false\\\>interface dc0 \{\\\>\>description: "data interface"\\\>\>disable: false\\\>\>/* default-system-config */\\\>\>vif dc0 \{\\\>\>\>disable: false\\\>\>\>address 10.10.10.10 \{\\\>\>\>\>prefix-length: 24\\\>\>\>\>broadcast: 10.10.10.255\\\>\>\>\>disable: false\\\>\>\>\}\\\>\>\>/*\\\>\>\>address 10:10:10:10:10:10:10:10 \{\\\>\>\>\>prefix-length: 64\\\>\>\>\>disable: false\\\>\>\>\}\\\>\>\>*/\\\>\>\}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}We recommend that you select the interfaces that you want to use onyour system and configure them as above. If you are configuring aninterface that is currently being used by the the system make surethat there is no mismatch in the {\tt address}, {\tt prefix-length} and{\tt broadcast} arguments.If the \linebreak{\tt default-system-config} statement is used, itinstructs the FEA that the interface should be configured by usingthe existing interface information from the underlying system.In that case, the {\tt vif} and {\tt address} sections must not beconfigured.\section{Forwarding Engine Abstraction}\label{sec:fea}It is a requirement to explicitly enable forwarding for eachprotocol family.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killfea \{\\\>unicast-forwarding4 \{\\\>\>disable: false\\\>\}\\/*\\\>unicast-forwarding6 \{\\\>\>disable: false\\\>\}\\*/\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}If IPv4 forwarding is required you will require the configurationabove. If the system supports IPv6 and IPv6 forwarding is required,then the {\tt unicast-forwarding6} statement must be used to enableit~\footnote{Note that prior to XORP Release-1.1, the{\tt enable-unicast-forwarding4} and {\tt enable-unicast-forwarding6}flags were used instead to enable or disable the IPv4 and IPv6 forwarding.}.\newpage\section{Protocols}\label{sec:protocols}A unicast router typically will be configured with one or moreof the following protocols:StaticRoutes (Section~\ref{sec:protocols:static_routes}),RIP (Section~\ref{sec:protocols:rip})or BGP (Section~\ref{sec:protocols:bgp}).A multicast router must have the MFEA configured(Section~\ref{sec:protocols:mfea}). Typically, a multicast router shouldhave IGMP/MLD configured (Section~\ref{sec:protocols:mld6igmp}).Currently, PIM-SM is the only multicast routing protocol implemented(Section~\ref{sec:protocols:pim}). If some multicast-specific staticroutes need to be installed in the MRIB (for computing the reverse-pathforwarding information), those can be specified in the StaticRoutesconfiguration (Section~\ref{sec:protocols:static_routes}).If there are nounicast routing protocols configured, the FIB2MRIB module mayneed to be configured as well (Section~\ref{sec:protocols:fib2mrib}).\subsection{Static Routes}\label{sec:protocols:static_routes}This is the simplest routing protocol in XORP. It allows theinstallation of unicast or multicast static routes (either IPv4 orIPv6).  Note that in case of multicast the routes are installed onlyin the user-level Multicast Routing Information Base and are used formulticast-specific reverse-path forwarding information by multicast routingprotocols such as PIM-SM.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>static \{\\\>\>route 10.20.0.0/16 \{\\\>\>\>nexthop: 10.10.10.20\\\>\>\>metric: 1\\\>\>\}\\\>\>mrib-route 10.20.0.0/16 \{\\\>\>\>nexthop: 10.10.10.30\\\>\>\>metric: 1\\\>\>\}\\\>\>/*\\\>\>route 20:20:20:20::/64 \{\\\>\>\>nexthop: 10:10:10:10:10:10:10:20\\\>\>\>metric: 1\\\>\>\}\\\>\>mrib-route 20:20:20:20::/64 \{\\\>\>\>nexthop: 10:10:10:10:10:10:10:30\\\>\>\>metric: 1\\\>\>\}\\\>\>*/\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\newpage\subsection{Routing Information Protocol}\label{sec:protocols:rip}In order to run RIP it is sufficient to specify the set of interfaces,vifs and addresses ({\tt interface}, {\tt vif} and {\tt address}) onwhich RIP is enabled~\footnote{Note that prior to XORP Release-1.1,the {\tt enable} flag was used instead of {\tt disable} to enableor disable each part of the configuration.}.If you wish to announce routes then it is necessary tothe routes that are to be announced. For example, {\tt connected} and {\tt static}~\footnote{Starting with XORP Release-1.2 policy is used toexport routes into RIP with the {\tt export} statement.  Prior to XORPRelease-1.2 the {\tt export} statement was used with a different syntax.}.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killpolicy \{\\\>/* Describe connected routes for redistribution */\\\>policy-statement connected \{\\\>\>term export \{\\\>\>\>from \{\\\>\>\>\>protocol: "connected"\\\>\>\>\}\\\>\>\}\\\>\}\\\}\\policy \{\\\>/* Describe static routes for redistribution */\\\>policy-statement static \{\\\>\>term export \{\\\>\>\>from \{\\\>\>\>\>protocol: "static"\\\>\>\>\}\\\>\>\}\\\>\}\\\}\\protocols \{\\\>rip \{\\/* Redistribute routes for connected interfaces */\\/*\\\>\>export: "connected"\\*/\\/* Redistribute static routes */\\/*\\\>\>export: "static"\\*/\\/* Redistribute connected and static routes */\\/*\\\>\>export: "connected,static"\\*/\\/* Run on specified network interface addresses */\\\>\>interface dc0 \{\\\>\>\>vif dc0 \{\\\>\>\>\>address 10.10.10.10 \{\\\>\>\>\>\>disable: false\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\newpage\subsection{Open Shortest Path First}\label{sec:protocols:ospf}In order to run OSPF Version 2 the {\tt router-id} must be specified, itis a unique IPv4 address within the Autonomous System. The smallest IPaddress of an interface belonging to the router is a good choice.OSPF splits networks into areas so an {\tt area} must be configured.Configure one or more of the routers configured interface/vif/addressin this area.{\bf The {\stt 4} in {\stt ospf4} refers to the IPv4 address family.}\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>ospf4 \{\\\>\>router-id: 10.10.10.10\\\\\>\>area 0.0.0.0 \{\\\>\>\>interface dc0 \{\\\>\>\>\>vif dc0 \{\\\>\>\>\>\>address 10.10.10.10 \{\\\>\>\>\>\>\}\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\>\}\\\}\\\end{tabbing}\end{alltt}\end{minipage}}\newpage\subsection{Border Gateway Protocol}\label{sec:protocols:bgp}In order to run BGP the {\tt bgp-id} (BGP Identifier) and {\tt local-as}(Autonomous System number) must be specified.The {\tt peer} statement specifies a peering. The argument to the peerstatement is the IP address of the peer. The {\tt local-ip} is the IPaddress that TCP should use. The {\tt as} is the Autonomous System Numberof the peer.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>bgp \{\\\>\>bgp-id: 10.10.10.10\\\>\>local-as: 65002\\\\\>\>peer 10.30.30.30 \{\\\>\>\>local-ip: 10.10.10.10\\\>\>\>as: 65000\\\>\>\>next-hop: 10.10.10.20\\\>\>\>/*\\\>\>\>local-port: 179\\\>\>\>peer-port: 179\\\>\>\>*/\\\>\>\>/* holdtime: 120 */\\\>\>\>/* disable: false */\\\\\>\>\>/* IPv4 unicast is enabled by default */\\\>\>\>/* ipv4-unicast: true */\\\\\>\>\>/* Optionally enable other AFI/SAFI combinations */\\\>\>\>/* ipv4-multicast: true */\\\>\>\>/* ipv6-unicast: true */\\\>\>\>/* ipv6-multicast: true */\\\>\>\}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\newpage\subsection{Multicast Forwarding Engine Abstraction}\label{sec:protocols:mfea}The MFEA must be configured if the XORP router is to be used for multicastrouting. The MFEA for IPv4 and IPv6 are configured separately.In the configuration we must explicitly configure the entity itself, andeach {\tt vif}. The {\tt traceoptions} section is used to explicitly enablelog information that can be used for debugging purpose~\footnote{Note thatprior to XORP Release-1.1, the {\tt enable} flag was used instead of{\tt disable} to enable or disable each part of the configuration.}.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killplumbing \{\\\>mfea4 \{\\\>\>disable: false\\\>\>interface dc0 \{\\\>\>\>vif dc0 \{\\\>\>\>\>disable: false\\\>\>\>\}\\\>\>\}\\\>\>interface register\_vif \{\\\>\>\>vif register\_vif \{\\\>\>\>\>/* Note: this vif should be always enabled */\\\>\>\>\>disable: true\\\>\>\>\}\\\>\>\}\\\>\>traceoptions \{\\\>\>\>flag all \{\\\>\>\>\>disable: true\\\>\>\>\}\\\>\>\}\\\>\}\\\}\\\\plumbing \{\\\>mfea6 \{\\\>\>disable: true\\\>\>interface dc0 \{\\\>\>\>vif dc0 \{\\\>\>\>\>disable: true\\\>\>\>\}\\\>\>\}\\\>\>interface register\_vif \{\\\>\>\>vif register\_vif \{\\\>\>\>\>/* Note: this vif should be always enabled */\\\>\>\>\>disable: true\\\>\>\>\}\\\>\>\}\\\>\>traceoptions \{\\\>\>\>flag all \{\\\>\>\>\>disable: true\\\>\>\>\}\\\>\>\}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}

⌨️ 快捷键说明

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