Thursday, March 31, 2011

Lab 89 - non-BGP Transit with IGP Redistribution

Prerequisites: CCNP level skills.

Topology

Pic. 1 - Topology Diagram.
Icons designed by: Andrzej Szoblik - http://www.newo.pl

Notice!
Router R1 is NOT running BGP in AS 134.

Initial Configuration:

BGP Peering:
  • R2 EBGP with R4
  • R3 IBGP with R4
  • R3 EBGP with R5

OSPF Configuration:
Routers R1, R3, and R4 should run OSPF area 0. Do NOT advertise loopbacks of these routers into OSPF.


Task 1
Configure BGP and OSPF as per topology diagram.

Task 2
Ensure 172.16.105.0/24 (R5) can reach 172.16.102.0/24 (R2). Use IGP redistribution to accomplish the goal.

Lab Solution

Task 1
Configure BGP and OSPF as per topology diagram.

R1 Configuration:
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 10.1.13.1 0.0.0.0 area 0
 network 10.1.124.1 0.0.0.0 area 0
!

R2 Configuration:
!
router bgp 20
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 network 172.16.102.0 mask 255.255.255.0
 neighbor 10.1.124.4 remote-as 134
 no auto-summary
!

R3 Configuration:
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 10.1.13.3 0.0.0.0 area 0
!
router bgp 134
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 network 172.16.103.0 mask 255.255.255.0
 neighbor 10.1.35.5 remote-as 50
 neighbor 10.1.124.4 remote-as 134
 neighbor 10.1.124.4 next-hop-self
 no auto-summary
!

R4 Configuration:
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 network 10.1.124.4 0.0.0.0 area 0
!
router bgp 134
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 network 172.16.104.0 mask 255.255.255.0
 network 172.16.144.0 mask 255.255.255.0
 neighbor 10.1.13.3 remote-as 134
 neighbor 10.1.124.2 remote-as 20
 no auto-summary
!

R5 Configuration:
!
router bgp 50
 no synchronization
 bgp router-id 5.5.5.5
 bgp log-neighbor-changes
 network 172.16.105.0 mask 255.255.255.0
 neighbor 10.1.35.3 remote-as 134
 no auto-summary
!

Pic. 2 - R2's BGP Table.

Pic. 3 - Ping Fails.

Pic. 4 - R5's BGP Table.

Notice!
R1 is NOT running BGP. It creates a 'black hole' between 172.16.102.0/24 and 172.16.105.0/24. Since it is not running BGP in never receives the two subnets in question. Packets traversing R1 are being dropped. The 'synchronization' rule was supposed to protect system from such situations. Now, the synchronization is turned off by default!

Pic. 5 - R1's Routing Table.

Task 2
Ensure 172.16.105.0/24 (R5) can reach 172.16.102.0/24 (R2). Use IGP redistribution to accomplish the goal.

R3 Configuration:
!
ip prefix-list BGP_PRFX seq 5 permit 172.16.105.0/24
!
route-map BGP_TO_OSPF permit 10
 match ip address prefix-list BGP_PRFX
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 redistribute bgp 134 subnets route-map BGP_TO_OSPF
 network 10.1.13.3 0.0.0.0 area 0
!

R4 Configuration:
!
ip prefix-list BGP_PRFX seq 5 permit 172.16.102.0/24
!
route-map BGP_TO_OSPF permit 10
 match ip address prefix-list BGP_PRFX
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 redistribute bgp 134 subnets route-map BGP_TO_OSPF
 network 10.1.124.4 0.0.0.0 area 0
!


Verification:
Pic. 6 - Ping Test.

Notice!
If the prefixes have been learned using EBGP peer the redistribution from BGP into IGP works by default.

If BGP router receives the prefixes from IBGP peer, the redistribution from BGP into IGP protocol does NOT work by default. It is a loop prevention mechanism. In order to be able to redistribute them you must use the following command under the BGP process:
bgp redistribute internal

Caution must be taken when using this solution since it is prone to create routing loops.