Saturday, April 2, 2011

Lab 97 - BGP Path Selection using MED

Prerequisites: CCNP level skills.

Topology

Note!
All routers are configured as per topology diagram (pic. 1) and loopback advertised into BGP.
Pic. 1 - Topology Diagram.
Icons designed by: Andrzej Szoblik - http://www.newo.pl

Task 1
Ensure that R4 receives the traffic towards 172.16.104.0/24 from R1, and the traffic towards 172.16.144.0/24 from R2. Use MED to accomplish the goal.


Lab Solution

Task 1
Ensure that R4 receives the traffic towards 172.16.104.0/24 from R1, and the traffic towards 172.16.144.0/24 from R2. Use MED to accomplish the goal.

Pic. 2 -Traceroute from R5.
Notice!
Currently, traffic is sent through R1 to both destinations.

Pic. 3 - BGP Table on R3.


R4 Configuration:
!
ip prefix-list Lo0 seq 5 permit 172.16.104.0/24
ip prefix-list Lo1 seq 5 permit 172.16.144.0/24
!
route-map RETURN_TRAFFIC_FROM_R1 permit 10
 match ip address prefix-list Lo1
 set metric 300
!
route-map RETURN_TRAFFIC_FROM_R1 permit 999
!        
route-map RETURN_TRAFFIC_FROM_R2 permit 10
 match ip address prefix-list Lo0
 set metric 300
!        
route-map RETURN_TRAFFIC_FROM_R2 permit 999
!
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
 neighbor 10.1.14.1 remote-as 123
 neighbor 10.1.14.1 next-hop-self
 neighbor 10.1.14.1 route-map RETURN_TRAFFIC_FROM_R1 out
 neighbor 10.1.24.2 remote-as 123
 neighbor 10.1.24.2 next-hop-self
 neighbor 10.1.24.2 route-map RETURN_TRAFFIC_FROM_R2 out
 no auto-summary
!

Notice!
Again, 'clear ip bgp *' out must be issued for the changes to take effect.

Pic. 4 - BGP Table on R3.

Pic. 5 - Traceroute from R5.