R1
* i 40.1.1.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
* i 40.1.2.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
* i 40.1.3.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
* i 40.1.4.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
* i 44.4.4.4/32 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
R2
* i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
R5
*>i 40.1.1.0/24 28.0.0.8 0 100 0 201 i
* i 3.3.3.3 0 100 0 201 i
*>i 40.1.2.0/24 28.0.0.8 0 100 0 201 i
* i 3.3.3.3 0 100 0 201 i
*>i 40.1.3.0/24 28.0.0.8 0 100 0 201 i
* i 3.3.3.3 0 100 0 201 i
*>i 40.1.4.0/24 28.0.0.8 0 100 0 201 i
R8
ip prefix-list dot seq 5 permit 40.1.2.0/24
ip prefix-list dot seq 10 permit 40.1.1.0/24
!
route-map ASPATH permit 10
match ip address prefix-list dot
set as-path prepend 201 201 201
!
route-map ASPATH permit 30
R8(config)#router bgp 201
R8(config-router)#neighbor 28.0.0.2 route-map ASPATH out
after applying the configuration
R2
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
* 28.0.0.8 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* 28.0.0.8 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
R1
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* i 40.1.3.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
* i 40.1.4.0/24 2.2.2.2 0 100 0 201 i
*>i 3.3.3.3 0 100 0 201 i
R5
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*>i 40.1.3.0/24 28.0.0.8 0 100 0 201 i
* i 3.3.3.3 0 100 0 201 i
*>i 40.1.4.0/24 28.0.0.8 0 100 0 201 i
* i 3.3.3.3 0 100 0 201 i
Case-1 ...if Local-pref for 40.1.1.0/24 is increased then.......
R2:-
R2#sh run | sec bgp
router bgp 101
bgp log-neighbor-changes
neighbor 28.0.0.8 remote-as 201
neighbor 28.0.0.8 route-map localp in
router bgp 101
bgp log-neighbor-changes
neighbor 28.0.0.8 remote-as 201
neighbor 28.0.0.8 route-map localp in
ip prefix-list dotone seq 5 permit 40.1.1.0/24
route-map localp permit 10
match ip address prefix-list dotone
set local-preference 200
!
route-map localp permit 20
!
Network Next Hop Metric LocPrf Weight Path
*> 40.1.1.0/24 28.0.0.8 200 0 201 201 201 201 i
{ preferred over R3 even As-path is long}
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* 28.0.0.8 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
--More--
R1
*>i 40.1.1.0/24 2.2.2.2 0 200 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*>i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
AS-PATH is well known mandatory attribute.
Case 3- if we want to ignore AS-PATH attribute in best selection
R2(config)#router bgp 101
R2(config-router)#bgp bestpath as-path ignore
{ This command is is hidden command in cisco IOS , but it is accepted}
Network Next Hop Metric LocPrf Weight Path
*> 40.1.1.0/24 28.0.0.8 200 0 201 201 201 201 i
* i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
Network Next Hop Metric LocPrf Weight Path
*> 40.1.1.0/24 28.0.0.8 200 0 201 201 201 201 i
{ preferred over R3 even As-path is long}
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* 28.0.0.8 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
--More--
R1
*>i 40.1.1.0/24 2.2.2.2 0 200 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*>i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
R6
*> 40.1.1.0/24 1.1.1.1 0 101 201 201 201 201 i
* 5.5.5.5 0 101 201 201 201 201 i
*> 40.1.2.0/24 1.1.1.1 0 101 201 i
* 5.5.5.5 0 101 201 i
* 40.1.3.0/24 1.1.1.1 0 101 201 i
Case 3- if we want to ignore AS-PATH attribute in best selection
R2(config)#router bgp 101
{ This command is is hidden command in cisco IOS , but it is accepted}
Network Next Hop Metric LocPrf Weight Path
* i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*> 28.0.0.8 0 201 i
* i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
R1
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 201 201 201 i
*>i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 201 201 201 i
*>i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201 i
*>i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
* i 2.2.2.2 0 100 0 201
R5
*>i 40.1.1.0/24 3.3.3.3 0 100 0 201 i
* i 28.0.0.8 0 100 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* i 28.0.0.8 0 100 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*>i 28.0.0.8 0 100 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*>i 28.0.0.8 0 100 0 201 i
* i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
* i 28.0.0.8 0 100 0 201 201 201 201 i
*>i 40.1.2.0/24 3.3.3.3 0 100 0 201 i
* i 28.0.0.8 0 100 0 201 201 201 201 i
* i 40.1.3.0/24 3.3.3.3 0 100 0 201 i
*>i 28.0.0.8 0 100 0 201 i
* i 40.1.4.0/24 3.3.3.3 0 100 0 201 i
*>i 28.0.0.8 0 100 0 201 i
* i 44.4.4.4/32 3.3.3.3 0 100 0 201 i
No comments:
Post a Comment