Monday, May 9, 2011

Lab 129 - BGP Next-Hop using Next-Hop-Self

Prerequisites: CCNP level skills.

Topology

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

Task 1
Configure OSPF area 0 only on point-to-point links between:
  • R1 and R3
  • R2 and R3
Do not enable OSPF on links connecting AS 123 to AS 40 and AS 50!

Task 2
Configure BGP peering as per Pic. 1. Advertise all loopbacks into BGP. Make sure that R3 can reach loopbacks advertised by AS 40 and R1 and R2 can reach the loopback advertised by AS 50. Do not use route-map or redistribution into OSPF to accomplish that.

Solution

Task 1
Configure OSPF area 0 only on point-to-point links between:
  • R1 and R3
  • R2 and R3
Do not enable OSPF on links connecting AS 123 to AS 40 and AS 50!


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

R2 Configuration:
!
router ospf 1
 router-id 172.16.102.2
 log-adjacency-changes
 network 10.1.23.2 0.0.0.0 area 0
!


R3 Configuration:
!
router ospf 1
 router-id 172.16.103.3
 log-adjacency-changes
 network 10.1.13.3 0.0.0.0 area 0
 network 10.1.23.3 0.0.0.0 area 0
!


Verification:
Pic. 2 - OSPF Neighbors on R3.

Task 2
Configure BGP peering as per Pic. 1. Advertise all loopbacks into BGP. Make sure that R3 can reach loopbacks advertised by AS 40 and R1 and R2 can reach the loopback advertised by AS 50. Do not use route-map or redistribution into OSPF to accomplish that.
R1 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.101.1
 bgp log-neighbor-changes
 network 172.16.101.0 mask 255.255.255.0
 neighbor 10.1.13.3 remote-as 123
 neighbor 10.1.14.4 remote-as 40
 no auto-summary
!


R2 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.102.2
 bgp log-neighbor-changes
 network 172.16.102.0 mask 255.255.255.0
 neighbor 10.1.23.3 remote-as 123
 neighbor 10.1.24.4 remote-as 40
 no auto-summary
!

R3 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.103.3
 bgp log-neighbor-changes
 network 172.16.103.0 mask 255.255.255.0
 neighbor 10.1.13.1 remote-as 123
 neighbor 10.1.13.1 route-reflector-client
 neighbor 10.1.23.2 remote-as 123
 neighbor 10.1.23.2 route-reflector-client
 neighbor 10.1.35.5 remote-as 50
 no auto-summary
!

R4 Configuration:
!
router bgp 40
 no synchronization
 bgp router-id 172.16.104.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
 redistribute connected route-map CONN_TO_BGP
 neighbor 10.1.14.1 remote-as 123
 neighbor 10.1.24.2 remote-as 123
 no auto-summary
!

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

Verification:
Pic. 3 - BGP Table on R3.

Notice!
All prefixes learned from AS 40 have missing best path marker '>'. The reason is that R3 does not know how to reach the next hop for these (10.1.14.4 and 10.1.24.4). The same problem will R1 and R2 have for prefix learned from AS 50. This is due to the fact that eBGP next-hop attribute is preserved over iBGP session.

Pic. 4 - R3's Routing Table - Next Hop Addresses.

The BGP table for a specific prefix shows the problem.

Pic. 5 - Detailed BGP Prefix Information.

In order to fix this problem, the next-hop-self command can be used given the stipulations (no redistribution into OSPF, or route-map to be used).

R1 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.101.1
 bgp log-neighbor-changes
 network 172.16.101.0 mask 255.255.255.0
 neighbor 10.1.13.3 remote-as 123
 neighbor 10.1.13.3 next-hop-self
 neighbor 10.1.14.4 remote-as 40
 no auto-summary
!


R2 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.102.2
 bgp log-neighbor-changes
 network 172.16.102.0 mask 255.255.255.0
 neighbor 10.1.23.3 remote-as 123
 neighbor 10.1.23.3 next-hop-self
 neighbor 10.1.24.4 remote-as 40
 no auto-summary
!

R3 Configuration:
!
router bgp 123
 no synchronization
 bgp router-id 172.16.103.3
 bgp log-neighbor-changes
 network 172.16.103.0 mask 255.255.255.0
 neighbor 10.1.13.1 remote-as 123
 neighbor 10.1.13.1 route-reflector-client
 neighbor 10.1.13.1 next-hop-self
 neighbor 10.1.23.2 remote-as 123
 neighbor 10.1.23.2 route-reflector-client
 neighbor 10.1.23.2 next-hop-self
 neighbor 10.1.35.5 remote-as 50
 no auto-summary
!

Verification:
Pic. 6 - BGP Table on R3.