Prerequisites: CCNP level skills.
Topology
Personal Note!
This week I'm in Mechelen, Belgium. My poor laptop barely handles four dynamips instances :(.
Pic. 1 - Topology Diagram.
Icons designed by: Andrzej Szoblik - http://www.newo.pl
Task 1
Using AS-Path Prepending try to influence the returning traffic towards 172.16.101.0/24 to flow through AS 20.
Task 2
On R3 check the bgp table and pay attention to the path towards 172.16.101.0/24. Ensure that R3 overrides the path selection choosing the best path to the subnet in question.
Lab Solution
Task 1
Using AS-Path Prepending try to influence the returning traffic towards 172.16.101.0/24 to flow through AS 20.
R1 Configuration:
!
ip prefix-list Lo0 seq 5 permit 172.16.101.0/24
!
route-map AS_PREPEND permit 10
match ip address prefix-list Lo0
set as-path prepend 10 10 10
route-map AS_PREPEND permit 999
!
match ip address prefix-list Lo0
set as-path prepend 10 10 10
route-map AS_PREPEND permit 999
!
router bgp 10
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.12.2 remote-as 20
neighbor 10.1.13.3 remote-as 30
neighbor 10.1.13.3 route-map AS_PREPEND out
no auto-summary
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.12.2 remote-as 20
neighbor 10.1.13.3 remote-as 30
neighbor 10.1.13.3 route-map AS_PREPEND out
no auto-summary
!
Task 2
On R3 check the bgp table and pay attention to the path towards 172.16.101.0/24. Ensure that R3 overrides the path selection choosing the best path to the subnet in question.
Pic. 2 - BGP Table on R3.
R3 prefers AS 20 towards 172.16.101.0/24 due to the shorter AS path.
R3 Configuration:
!
router bgp 30
no synchronization
bgp router-id 172.16.103.3
bgp log-neighbor-changes
bgp bestpath as-path ignore
network 172.16.103.0 mask 255.255.255.0
neighbor 10.1.13.1 remote-as 10
neighbor 10.1.23.2 remote-as 20
no auto-summary
no synchronization
bgp router-id 172.16.103.3
bgp log-neighbor-changes
bgp bestpath as-path ignore
network 172.16.103.0 mask 255.255.255.0
neighbor 10.1.13.1 remote-as 10
neighbor 10.1.23.2 remote-as 20
no auto-summary
!
Notice!
The command is now hidden (as of the time of writing this post) and does NOT show using help. For this command to take effect: 'clear ip bgp *'
Verification:
Pic. 3 - BGP Table on R3.
AS-Path length is now ignored. R3 chooses the longer path towards 172.16.101.0/24.
source:
http://www.cisco.com/en/US/docs/ios/12_3t/ip_route/command/reference/ip2_b1gt.html#wp1072077