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

📄 bgp.tex

📁 xorp源码hg
💻 TEX
📖 第 1 页 / 共 2 页
字号:
xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>bgp \{\\\>\>bgp-id: 128.16.32.1\\\>\>local-as: 45678\\\\\>\>peer 192.168.150.1 \{\\\>\>\>local-ip: 128.16.64.4\\\>\>\>as: 34567\\\>\>\>next-hop: 128.16.64.4\\\>\>\>holdtime: 120\\\\\>\>\>/* 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}This configuration is from a BGP router in AS 45678.  The router has aBGP identifier of 128.16.32.1, which will normally be one of the router'sIP addresses.This router has only one BGP peering configured, with a peer on IPaddress 192.168.150.1.  This peering is an EBGP connection because thepeer is in a different AS (34567).  This router's IP address used forthis peering is 128.16.64.4, and the router is also configured to setthe next hop router field in routes it advertises to the peer to be128.16.64.4.  Setting local-ip and next-hop to be the same is commonfor EBGP connections.  The holdtime for the peering is configured tobe 120 seconds, but the precise value of the holdtime actually useddepends on negotiation with the peer.  In addition to IPv4 unicastrouting, which is enabled by default, this peering is configured toallow the sending an receiving of IPv4 multicast routes and IPv6unicast routes.This router is also configured to {\it originate} routingadvertisements for two subnets.  These subnets might be directlyconnected, or might be reachable via IGP routing.The first advertisement this router originates is for subnet128.16.16/24, reachable via both unicast and multicast.  The nexthopspecified in 128.16.64.1, and this must be reachable via other routesin the routing table, or this advertisement will not be made.  If thisrouter had any IBGP peerings, then the BGP route advertised to thosepeers would indicate that 128.16.16/24 was reachable via next hop128.16.64.1. However in this case the only peering is an EBGP peering,and the next hop in {\it all} routes sent to that peer is set to128.16.64.4 according to the {\stt nexthop} directive for the peering.The second advertisement is for an IPv6 route, configured to be usableonly by IPv6 unicast traffic.\newpage\section{Monitoring BGP}On a router running BGP, the BGP routing state can be displayed usingthe {\stt show bgp} operational-mode command.  Information is availableabout the status of BGP peerings and about the routes received andused.  In the 1.0 release, the set of commands is fairly limited, andwill be increased in future releases to provide better ways to displaysubsets of this information.As always, command completion using $<$TAB$>$ or ? will display theavailable sub-commands and parameters:\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xxxxxxxxxxxxxxxxxxxxx\=\killuser@hostname> \textbf{show bgp ?}\\Possible completions:\\\>peers\>Show BGP peers info\\\>routes\>Print BGP routes\\\>|\>Pipe through a command\\\end{tabbing}\end{alltt}\end{minipage}}The {\stt show bgp peers} command will display information about theBGP peerings that have been configured.  It supports the optionalparameter {\stt detail} to give a lot more information:\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xxxxxxxxxxxxxxxxxxxxx\=\killuser@hostname> \textbf{show bgp peers ?}\\Possible completions:\\\><[Enter]>\>Execute this command\\\>detail\>Show detailed BGP peers info\\\>|\>Pipe through a command\\\end{tabbing}\end{alltt}\end{minipage}}By itself, {\stt show bgp peers} provides a short list of the peeringsthat are configured, irrespective of whether the peering isin established state or not:\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xxxxxxxxxxxxxxxx\=\killuser@hostname> \textbf{show bgp peers} \\Peer 1: local 192.150.187.112/179 remote 69.110.224.158/179\\Peer 2: local 192.150.187.112/179 remote 192.150.187.2/179\\Peer 3: local 192.150.187.112/179 remote 192.150.187.78/179\\Peer 4: local 192.150.187.112/179 remote 192.150.187.79/179\\Peer 5: local 192.150.187.112/179 remote 192.150.187.109/179\\\end{tabbing}\end{alltt}\end{minipage}}\newpageThe command {\stt show bgp peers detail} will give a large amount ofinformation about all the peerings:  \vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=\killuser@hostname> \textbf{show bgp peers detail}\\Peer 1: local 192.150.187.112/179 remote 69.110.224.158/179\\\>Peer ID: none\\\>Peer State: ACTIVE\\\>Admin State: START\\\>Negotiated BGP Version: n/a\\\>Peer AS Number: 65014\\\>Updates Received: 0,  Updates Sent: 0\\\>Messages Received: 0,  Messages Sent: 0\\\>Time since last received update: n/a\\\>Number of transitions to ESTABLISHED: 0\\\>Time since last in ESTABLISHED state: n/a\\\>Retry Interval: 120 seconds\\\>Hold Time: n/a,  Keep Alive Time: n/a\\\>Configured Hold Time: 120 seconds,  Configured Keep Alive Time: 40 seconds\\\>Minimum AS Origination Interval: 0 seconds\\\>Minimum Route Advertisement Interval: 0 seconds\\\\Peer 2: local 192.150.187.112/179 remote 192.150.187.2/179\\\>Peer ID: 192.150.187.2\\\>Peer State: ESTABLISHED\\\>Admin State: START\\\>Negotiated BGP Version: 4\\\>Peer AS Number: 64999\\\>Updates Received: 52786,  Updates Sent: 28\\\>Messages Received: 52949,  Messages Sent: 189\\\>Time since last received update: 2 seconds\\\>Number of transitions to ESTABLISHED: 17\\\>Time since last entering ESTABLISHED state: 6478 seconds\\\>Retry Interval: 120 seconds\\\>Hold Time: 120 seconds,  Keep Alive Time: 40 seconds\\\>Configured Hold Time: 120 seconds,  Configured Keep Alive Time: 40 seconds\\\>Minimum AS Origination Interval: 0 seconds\\\>Minimum Route Advertisement Interval: 0 seconds\\\\\end{tabbing}\end{alltt}\end{minipage}} \vspace{0.1in}The most important piece of information is typically whether or notthe peering is in ESTABLISHED state, indicating that the peering is upand capable of exchanging routes.  ACTIVE state means that the peeringis configured to be up on this router, but for some reason the peeringis not currently up.  Typically this is because the remote peer isunreachable, or because no BGP instance is running on the remote peer.\newpageThe {\stt show bgp routes} command displays the routes received by BGPfrom its peers.  On a router with a full BGP routing table (140000routes as of July 2004) this command will produce a large amount ofoutput:\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xxx\=xxxxxxxxxxxxxxxx\=xxxxxxxxxxxxxxxx\=xxxxxxxxxxxxxxx\=xx\=\killuser@hostname> \textbf{show bgp routes}\\Status Codes: * valid route, > best route\\Origin Codes: i IGP, e EGP, ? incomplete\\\\\>Prefix\>Nexthop\>Peer\>AS Path\\\>------\>-------\>----\>-------\\*>\>3.0.0.0/8\>192.150.187.2\>192.150.187.2\>16694 25 2152 3356 7018 80 i\\*>\>4.17.225.0/24\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 701 11853 6496 i\\*>\>4.17.226.0/23\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 701 11853 6496 i\\*>\>4.17.251.0/24\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 701 11853 6496 i\\*>\>4.17.252.0/23\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 701 11853 6496 i\\*>\>4.21.252.0/23\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 701 6389 8063 19198 i\\*>\>4.23.180.0/24\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 3561 6128 30576 i\\*>\>4.36.200.0/21\>192.150.187.2\>192.150.187.2\>16694 25 2152 174 3561 14742 11854 14135 i\\*>\>4.78.0.0/21\>192.150.187.2\>192.150.187.2\>16694 25 2152 11423 209 3561 6347 23071 22938 i\\*>\>4.78.32.0/21\>192.150.187.2\>192.150.187.2\>16694 25 2152 174 3491 29748 i\\*>\>4.0.0.0/8\>192.150.187.2\>192.150.187.2\>16694 25 2152 3356 i\\...\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}The format of the output is one route per line.  On each line:\begin{itemize}\item A status code is displayed, showing whether the route is valid,  and whether it was the best BGP route this router has received.  A  route is valid if the nexthop is reachable and it isn't filtered by  the inbound BGP filters.\item The network prefix for which the route applies is listed in the  form {\stt 4.17.226.0/23}.  This indicates the base address for the  network (address {\stt 4.17.226.0}), and the prefix length ({\stt 23} bits).  Thus this route applies for addresses {\stt 4.17.226.0} to {\stt  4.17.227.255} inclusive.\item The nexthop is the IP address of the intermediate router towards  which packet destined for the network prefix should be sent.  In  this example all the displayed routes have the same nexthop.\item The peer is the IP address of the BGP router which sent us this  route.  The nexthop and the peer need not the the same (they often  aren't with IBGP peerings for example) but in all the routes in this  example they are the same.\item The AS path is listed next.  This lists the AS numbers of the  autonomous systems that the route has traversed to reach our  router.  The AS at the left end of the path is the one nearest to  our router and the one at the right end of the path is usually the  AS number of the route's originator.  \item Finally, whether the route's origin is from an IGP ({\stt i}),  from EGP ({\stt e}, mostly obsolete), or incomplete ({\stt ?}) is  listed.\end{itemize}\subsection{BGP MIB}XORP includes SNMP support for BGP, though the BGP-4 MIB defined inRFC 1657.\section{BGP path selection}BGP can receive mutiple paths to the same destination, there are acomplicated set of rules to determine which path should be used. Atthis time there are no configuration options that modify the behaviourof the the path selection process, apart from policy that explicitydrops or modifies a path.\subsection{Reasons for ignoring a path}BGP requires that there is an Interior Gateway Protocol (IGP) route tothe NEXT\_HOP, if no route exists the route is ignored. It is expectedin release 1.5 that a switch will be available to toggle thisrequirement.If the NEXT\_HOP in a path belongs to the router itself then the pathis ignored.\subsection{BGP decision process}The BGP decision process is performed exactly as defined by RFC 4271.

⌨️ 快捷键说明

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