Social Icons

Thursday, April 24, 2014

CCNP ROUTE: 4. BGP Table

To advertise routes to eBGP peers, particularly the public IP address prefix(es) used by that Enterprise, the Enterprise BGP router needs some additional configuration, as discussed futher.
A router stores all learned BGP prefixes and PAs in its BGP table. The router can then advertise its BGP table to its neighbors, advertising only the best route for each prefix.

When a BGP neighborship reaches the established state, those neighbors begin sending BGP Update messages to each other.
The router receiving an Update places those learned prefixes into its BGP table, regardless of whether the route appears to be the best route.
Like EIGRP and OSPF, BGP puts all learned routing information into its table, and then BGP processes all such potential routes to choose the best route for each prefix.

BGP uses the Update message to both announce and withdraw routes.
For example, when a router realizes that a route in the router’s BGP table has failed, that router withdraws that route by sending a BGP Update to its neighbors, listing the prefix in the list of withdrawn routes.
When a router receives an Update that lists a prefix as withdrawn, that router knows that the route has failed.

First, we should configure BGP neighborships between R1, R101, R102, R103 and R104:

R1:
!
interface Loopback1
 ip address 1.1.1.1 255.255.255.255
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 101.101.101.101 remote-as 101
 neighbor 101.101.101.101 password ccnp
 neighbor 101.101.101.101 ebgp-multihop 2
 neighbor 101.101.101.101 update-source Loopback1
 neighbor 102.102.102.102 remote-as 102
 neighbor 102.102.102.102 ebgp-multihop 2
 neighbor 102.102.102.102 update-source Loopback1
 no auto-summary
!
ip route 101.101.101.101 255.255.255.255 201.1.1.2
ip route 102.102.102.102 255.255.255.255 202.2.2.2
!

R101:
!
interface Loopback101
 ip address 101.101.101.101 255.255.255.255
!
router bgp 101
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 password ccnp
 neighbor 1.1.1.1 ebgp-multihop 2
 neighbor 1.1.1.1 update-source Loopback101
 neighbor 104.104.104.104 remote-as 104
 neighbor 104.104.104.104 password ccnp
 neighbor 104.104.104.104 ebgp-multihop 2
 neighbor 104.104.104.104 update-source Loopback101
 no auto-summary
!
ip route 1.1.1.1 255.255.255.255 201.1.1.1
ip route 104.104.104.104 255.255.255.255 114.1.1.2
!

R102:
!
interface Loopback102
 ip address 102.102.102.102 255.255.255.255
!
router bgp 102
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 ebgp-multihop 2
 neighbor 1.1.1.1 update-source Loopback102
 neighbor 103.103.103.103 remote-as 103
 neighbor 103.103.103.103 ebgp-multihop 2
 neighbor 103.103.103.103 update-source Loopback102
 no auto-summary
!
ip route 1.1.1.1 255.255.255.255 202.2.2.1
ip route 103.103.103.103 255.255.255.255 123.1.1.2
!

R103:
!
interface Loopback103
 ip address 103.103.103.103 255.255.255.255
!
router bgp 103
 no synchronization
 bgp log-neighbor-changes
 neighbor 102.102.102.102 remote-as 102
 neighbor 102.102.102.102 ebgp-multihop 2
 neighbor 102.102.102.102 update-source Loopback103
 neighbor 104.104.104.104 remote-as 104
 neighbor 104.104.104.104 ebgp-multihop 2
 neighbor 104.104.104.104 update-source Loopback103
 no auto-summary
!        
ip route 102.102.102.102 255.255.255.255 123.1.1.1
ip route 104.104.104.104 255.255.255.255 134.1.1.2
!

R104:
!
interface Loopback40
 ip address 192.168.40.40 255.255.255.255
!
interface Loopback41
 ip address 192.168.41.41 255.255.255.255
!
interface Loopback42
 ip address 192.168.42.42 255.255.255.255
!
interface Loopback43
 ip address 192.168.43.43 255.255.255.255
!
interface Loopback44
 ip address 192.168.44.44 255.255.255.255
!
router bgp 104
 no synchronization
 bgp log-neighbor-changes
 network 192.168.40.40 mask 255.255.255.255
 network 192.168.41.41 mask 255.255.255.255
 network 192.168.42.42 mask 255.255.255.255
 network 192.168.43.43 mask 255.255.255.255
 network 192.168.44.44 mask 255.255.255.255
 neighbor 101.101.101.101 remote-as 101
 neighbor 101.101.101.101 password ccnp
 neighbor 101.101.101.101 ebgp-multihop 2
 neighbor 101.101.101.101 update-source Loopback104
 neighbor 103.103.103.103 remote-as 103
 neighbor 103.103.103.103 ebgp-multihop 2
 neighbor 103.103.103.103 update-source Loopback104
 no auto-summary
!
ip route 101.101.101.101 255.255.255.255 114.1.1.1
ip route 103.103.103.103 255.255.255.255 134.1.1.1
!

Note: R103's FastEthernet interfaces will be shutdown for this lab.

Let's check all the BGP neighborships:

R1#show ip bgp summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
101.101.101.101 4   101     132     130        6    0    0 01:38:24        5
102.102.102.102 4   102      19      19        6    0    0 00:14:46        5

R101#show ip bgp summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   100     131     133        6    0    0 01:39:14        0
104.104.104.104 4   104      69      69        6    0    0 01:03:43        5

R102#show ip bgp summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   100      20      20       11    0    0 00:15:40        5
103.103.103.103 4   103      16      17       11    0    0 00:11:17        5

R103#show ip bgp summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
102.102.102.102 4   102      17      16       11    0    0 00:11:22        0
104.104.104.104 4   104      12      13       11    0    0 00:07:54        5

R104#show ip bgp summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
101.101.101.101 4   101      69      69        6    0    0 01:03:55        0
103.103.103.103 4   103      13      12        6    0    0 00:07:57        0

Let's verify the BGP table on R1 - it shoud contain two routes for each loopback interface on R104 - one is learned from R101 and the other from R102:

R1#show ip bgp
BGP table version is 6, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  192.168.40.40/32 102.102.102.102                        0 102 103 104 i
*>                  101.101.101.101                        0 101 104 i
*  192.168.41.41/32 102.102.102.102                        0 102 103 104 i
*>                  101.101.101.101                        0 101 104 i
*  192.168.42.42/32 102.102.102.102                        0 102 103 104 i
*>                  101.101.101.101                        0 101 104 i
*  192.168.43.43/32 102.102.102.102                        0 102 103 104 i
*>                  101.101.101.101                        0 101 104 i
*  192.168.44.44/32 102.102.102.102                        0 102 103 104 i
*>                  101.101.101.101                        0 101 104 i

The above output has the following columns:

- The Network heading lists the destination prefix/length (NLRI).
- The Next Hop heading lists the next-hop IP address (BGP router ID address) that would be used for the route.
- The Path heading lists the AS_Path PA (AS list). BGP show commands list the AS_Path with the first-added ASN on the right and the last-added ASN on the left.
- The > denotes the chosen best route. None of the routers inside the various ISPs set PAs for the purpose of influencing the best path choice, so the first used BGP best path decision is the shortest AS_Path.
- We can confirm that all E1’s BGP table entries were learned using eBGP, rather than iBGP, by the absence of the letter “i” in the third column. Immediately after the *>, a space appears in the output. If a route was learned with iBGP, an “i” would appear in this third character position.

Let's check the routing table of R1 - it should contain the routes from the BGP table that were chosen as best routes (>):

R1#show ip route bgp
     192.168.44.0/32 is subnetted, 1 subnets
B       192.168.44.44 [20/0] via 101.101.101.101, 01:01:03
     192.168.42.0/32 is subnetted, 1 subnets
B       192.168.42.42 [20/0] via 101.101.101.101, 01:01:03
     192.168.43.0/32 is subnetted, 1 subnets
B       192.168.43.43 [20/0] via 101.101.101.101, 01:01:03
     192.168.40.0/32 is subnetted, 1 subnets
B       192.168.40.40 [20/0] via 101.101.101.101, 01:01:33
     192.168.41.0/32 is subnetted, 1 subnets
B       192.168.41.41 [20/0] via 101.101.101.101, 01:01:03

More info about each BGP route can be seen using:

R1#show ip route 192.168.44.44
Routing entry for 192.168.44.44/32
  Known via "bgp 100", distance 20, metric 0
  Tag 101, type external
  Last update from 101.101.101.101 01:01:59 ago
  Routing Descriptor Blocks:
  * 101.101.101.101, from 101.101.101.101, 01:01:59 ago
      Route metric is 0, traffic share count is 1
      AS Hops 2
      Route tag 101
     
Verification Commands for eBGP-Learned Routes

show ip bgp neighbors ip-address received-routes - List routes learned from one neighbor, before any inbound filtering is applied.
show ip bgp neighbors ip-address routes - List routes learned from a specific neighbor that passed any inbound filters.
show ip bgp neighbors ip-address advertised-routes - Lists routes advertised to a neighbor after applying outbound filtering.

No comments:

Post a Comment