Tuesday, October 11, 2016

use bgp local preference to influence outbound route selection

1- the route before apply, local preference



R3: 10.0.0.2
R5: 10.0.7.1

2- we will set local preference to 110 for subnet 10.0.4.0/24 when it update subnet lists from router 3

below is the configuration running for R1

router bgp 1
 bgp router-id 10.0.7.2
 network 10.0.0.0/8
 network 10.0.0.0/24
 network 10.0.7.0/24
 neighbor n3 peer-group
 neighbor n3 remote-as 3
 neighbor n3 soft-reconfiguration inbound
 neighbor n3 route-map RMAP-R3 in
 neighbor n5 peer-group
 neighbor n5 remote-as 5
 neighbor n5 soft-reconfiguration inbound
 neighbor 10.0.0.2 peer-group n3
 neighbor 10.0.7.1 peer-group n5
 exit
!
ip prefix-list MATCHALL seq 20 permit 0.0.0.0/0 le 24
ip prefix-list SUBNET-OUT-R3 seq 20 permit 10.0.4.0/24

!
route-map RMAP-R3 permit 20
 match ip address prefix-list SUBNET-OUT-R3
 set local-preference 110
!
route-map RMAP-R3 permit 30
 match ip address prefix-list MATCHALL


3- after update the configuration issue the following command to make the changes take effect.

clear ip bgp 10.0.0.2 soft in 


4- show we can use show command to see the changes

- snapshot of ip route


- snapshot of show ip bgp, and we can see the local preference that we have set


No comments:

Post a Comment