This command, with no subcommands, does not activate BGP.
Only one instance of BGP can be configured on the router at a single time.
The autonomous system number identifies the autonomous system to which the router belongs.
The autonomous system number in this command is compared to the autonomous system numbers listed in neighbor statements to determine if the neighbor is an internal or external neighbor.
This command allows the BGP process to use the IP address of a specified interface as the source IP address of all BGP updates to that neighbor.
A loopback interface is usually used, as it will be available as long as the router is operational.
The IP address used in this command will be the destination IP address of all BGP updates and should be the loopback interface of the other router.
The update-source command is normally used only with IBGP neighbors.
The address of an EBGP neighbor must be directly connected by default. The loopback of an EBGP neighbor is not directly connected.
Example: BGP Using Loopback Addresses
Example: ebgp-multihop Command
Next-Hop Behavior
BGP is an AS-by-AS routing protocol, not a router-by-router routing protocol.
In BGP, the next hop does not mean the next router, it means the IP address to reach the next AS.
Router A advertises network 172.16.0.0 to router B in EBGP, with a next hop of 10.10.10.3.
Router B advertises 172.16.0.0 in IBGP to router C, keeping 10.10.10.3 as the next-hop address.
Next Hop on a Multiaccess Network
The following takes place in a multiaccess network:
Router B advertises network 172.30.0.0 to router A in EBGP with a next hop of 10.10.10.2, not 10.10.10.1. This avoids an unnecessary hop.
BGP is being efficient by informing AS 64520 of the best entry point into AS 65000 for network 172.30.0.0.
Router B in AS 65000 also advertises to AS 64520 that the best entry point for each network in AS 64600 is the next hop of router C because that is the best pathway to transit AS 65000 to AS 64600 from AS 64520.
This command tells BGP what network to advertise, not how to advertise the network.
The command does not activate the protocol on an interface.
Without a mask option, it advertises classful networks. If a subnet of the classful network exists in a routing table, the classful address is announced if autosummary is enabled. Autosummary is enabled by default.
BGP looks for an exact match in the local routing table before announcing this route.
BGP Synchronization
Synchronization rule: Do not use or advertise to an external neighbor a route learned by IBGP until a matching route has been learned from an IGP.
Ensures consistency of information throughout the AS
Avoids black holes within the AS
Safe to turn off if all routers in the AS are running full-mesh IBGP
no synchronization Router(config-router)#
Disables BGP synchronization so that a router will advertise routes in BGP without learning them in IGP
Example: BGP Synchronization
If synchronization is on (the default), then:
Routers A, C, and D would not use or advertise the route to 172.16.0.0 until they receive the matching route via an IGP.
Router E would not hear about 172.16.0.0.
If synchronization is off, then:
Routers A, C, and D would use and advertise the route they receive via IBGP; router E would hear about 172.16.0.0.
If router E sends traffic for 172.16.0.0, routers A, C, and D would route the packets correctly to router B.
When establishing a BGP session, BGP goes through the following steps:
Idle: Router is searching routing table to see if a route exists to reach the neighbor.
Connect: Router found route and has completed three-way TCP handshake.
Open sent: Open message sent with the parameters for the BGP session.
Open confirm: Router received agreement on the parameters for establishing session.
Established: Peering is established; routing begins.
BGP Session Establishment debug ip bgp events BGP events debugging is on RouterA# BGP : 172.16.1.2 passive open BGP : 172.16.1.2 went from idle to connect BGP : 172.16.1.2 open rcvd, version 4 BGP : 172.16.1.2 went from connect to open sent BGP : 172.16.1.2 sending open, version 4 BGP : 172.16.1.2 went from open sent to open confirm BGP : Scanning routing tables BGP : 172.16.1.2 went from open confirm to established The best way to see session setup is with the following command: Router#
BGP Idle and Established States
Idle: The router in this state cannot find the address of the neighbor in the routing table. Check for an IGP problem. Is the neighbor announcing the route?
Established: The established state is the proper state for BGP operations. In the show ip bgp summary command, if the state column is blank or has a number, then the established state is in place. The number is how many routes have been learned from this neighbor.
BGP Active State Troubleshooting
Active: The router has sent out an open packet and is waiting for a response. The state may cycle between active and idle. The neighbor may not know how to get back to this router because of the following reasons:
Neighbor peering with the wrong address
Neighbor does not have neighbor statement for this router
Neighbor does not have a route to the source IP address of the BGP open packet generated by this router
BGP Peering RouterA# show ip bgp summary BGP table version is 23, main routing table version 23 10 network entries and 11 paths using 1242 bytes of memory 4 BGP path attribute entries using 380 bytes of memory BGP activity 23/13 prefixes, 38/27 paths 0 prefixes revised. Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.1.1.100 4 65200 211 211 13 0 0 00:01:53 5 192.168.1.18 4 65101 214 226 23 0 0 00:00:13 1 192.168.1.34 4 65101 214 226 23 0 0 00:00:09 1 192.168.1.50 4 65101 214 225 23 0 0 00:00:06 3
show ip bgp Command RouterA# show ip bgp BGP table version is 23, local router ID is 192.168.1.49 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0 10.1.1.100 0 0 65200 i *> 172.16.10.0/24 10.1.1.100 0 0 65200 i *> 172.16.11.0/24 10.1.1.100 0 0 65200 i *>i172.26.1.16/28 192.168.1.50 0 100 0 i *>i172.26.1.32/28 192.168.1.50 0 100 0 i *>i172.26.1.48/28 192.168.1.50 0 100 0 i *> 192.168.1.0 0.0.0.0 0 32768 i *> 192.168.2.0 10.1.1.100 0 65200 65102 i *> 192.168.2.64/28 10.1.1.100 0 65200 65102 i * i192.168.101.0 192.168.1.34 0 100 0 i *>i 192.168.1.18 0 100 0 i The table displays networks from lowest network to highest.
Clearing the BGP Session
When policies such as access lists, timers, or attributes are changed, the BGP session must be reset.
The change takes effect immediately, and the next time a prefix or pathway is advertised or received, the new policy will be used. It can take a long time for the policy to be applied to all networks.
The session should be reset to ensure the policy is immediately applied to all affected prefixes and pathways.
Resetting BGP Sessions clear ip bgp * router#
Resets all BGP connections with this router
Entire BGP forwarding table is discarded
BGP session transitions from established to idle; everything must be relearned
clear ip bgp [ ip-address ] router#
Resets only a single neighbor
BGP session transitions from established to idle; everything from this neighbor must be relearned
Better than the clear ip bgp *
The clear ip bgp soft out Option clear ip bgp { * | address } [soft out] Router#
Routes learned from this neighbor are not lost.
This router resends all BGP information to the neighbor without resetting the connection.
The connection remains established.
This option is highly recommended when changing outbound policy.
The soft out option does not help if changing inbound policy.
The clear ip bgp soft in Option clear ip bgp { * | address } [soft in] Router#
Routes advertised to this neighbor are not withdrawn.
This router stores all updates sent from this neighbor so new inbound policies can be evaluated without resetting the BGP session.
A router BGP subcommand that notifies this router to store all updates from this neighbor in case the inbound policy is changed.
The command is memory-intensive.
The show ip bgp neighbors Command RouterA# show ip bgp neighbors BGP neighbor is 10.1.1.1, remote AS 65000, external link Index 1, Offset 0, Mask 0x2 BGP version 4, remote router ID 172.16.10.1 BGP state = Established , table version = 5, up for 00:10:47 Last read 00:00:48, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 30 seconds Received 16 messages, 0 notifications, 0 in queue Sent 15 messages, 1 notifications, 0 in queue Prefix advertised 1, suppressed 0, withdrawn 0 Connections established 1; dropped 0 Last reset 00:16:35, due to Peer closed the session 2 accepted prefixes consume 64 bytes 0 history paths consume 0 bytes --More--
The debug ip bgp Command routerA# debug ip bgp updates BGP updates debugging is on RTRA# clear ip bgp * 3w5d: BGP: 10.1.1.1 computing updates, neighbor version 0, table version 1, starting at 0.0.0.0 3w5d: BGP: 10.1.1.1 update run completed, ran for 0ms, neighbor version 0, start version 1, throttled to 1, check point net 0.0.0.0 3w5d: BGP: 10.1.1.1 rcv UPDATE w/ attr: nexthop 10.1.1.1, origin i, aggregated by 65000 172.16.10.1, path 65000 3w5d: BGP: 10.1.1.1 rcv UPDATE about 172.16.0.0/16 3w5d: BGP: nettable_walker 172.16.0.0/16 calling revise_route 3w5d: BGP: revise route installing 172.16.0.0/16 -> 10.1.1.1 3w5d: BGP: 10.1.1.1 rcv UPDATE w/ attr: nexthop 10.1.1.1, origin i, metric 0, path 65000 3w5d: BGP: 10.1.1.1 rcv UPDATE about 192.168.1.0/24 3w5d: BGP: nettable_walker 192.168.1.0/24 calling revise_route 3w5d: BGP: revise route installing 192.168.1.0/24 -> 10.1.1.1
Summary
This lesson presented these key points:
BGP is configured with the following basic BGP commands:
router bgp autonomous-system
neighbor ip-address remote-as autonomous-system
network network-number
The show and debug commands are used to identify the states of a BGP peering relationship and troubleshoot the BGP session.
The clear ip bgp commands are used to reset BGP sessions.
0 comments
Post a comment