BGP Local Preference
Used to prefer a particular path out of an AS when there are multiple paths/peers. Local Pref attribute is shared with other iBGP peers, whereas "weight" is only local to that single router (and is Cisco Proprietary) and is not shared with iBGP peers.
A higher Local Preference is preferred. The default is value is 100. You could also lower the Local Pref value to
Local Preference is only locally significant to BGP peers within the same AS - Does get sent to eBGP peers.
To influence eBGP peer routing, something like AS-Path Prepend is often used (But there are also other options).
Note: IP Prefix list of "0.0.0.0/0 le 32" matches ALL routes, whereas "0.0.0.0/0" would match only a default route.
On R16
ip prefix-list ALL_ROUTES permit 0.0.0.0/0 le 32
!
route-map LOCAL_PREF permit 10
match ip address prefix-list ALL_ROUTES
set local-preference 200
!
route-map LOCAL_PREF permit 20
!
router bgp 123
neighbor 15.15.15.15 route-map LOCAL_PREF in
Used to prefer a particular path out of an AS when there are multiple paths/peers. Local Pref attribute is shared with other iBGP peers, whereas "weight" is only local to that single router (and is Cisco Proprietary) and is not shared with iBGP peers.
A higher Local Preference is preferred. The default is value is 100. You could also lower the Local Pref value to
Local Preference is only locally significant to BGP peers within the same AS - Does get sent to eBGP peers.
To influence eBGP peer routing, something like AS-Path Prepend is often used (But there are also other options).
Note: IP Prefix list of "0.0.0.0/0 le 32" matches ALL routes, whereas "0.0.0.0/0" would match only a default route.
On R16
ip prefix-list ALL_ROUTES permit 0.0.0.0/0 le 32
!
route-map LOCAL_PREF permit 10
match ip address prefix-list ALL_ROUTES
set local-preference 200
!
route-map LOCAL_PREF permit 20
!
router bgp 123
neighbor 15.15.15.15 route-map LOCAL_PREF in
AS-Path Prepend
Add AS hops to route advertisements to eBGP peers to influence their preferred paths back in. Routes to the same subnets with additional AS hops are less preferable.
On R17
ip prefix-list SUBNETS seq 10 permit 10.10.10.0/24
ip prefix-list SUBNETS seq 10 permit 20.20.20.0/24
!
route-map PREPEND permit 10
match ip address prefix-list SUBNETS
set as-path prepend 123 123 123
!
route-map PREPEND permit 20
(Note: you need this last route-map permit statement to advertise any other routes NOT matched in the previous route-map statement. Those addt'l routes will be advertised without the any prepending. Without the 2nd Permit statement, anything NOT matched in the previous statement would be dropped.)
router bgp 123
neighbor 15.15.15.15 route-map PREPEND out
neighbor 19.19.19.19 route-map PREPEND out
Add AS hops to route advertisements to eBGP peers to influence their preferred paths back in. Routes to the same subnets with additional AS hops are less preferable.
On R17
ip prefix-list SUBNETS seq 10 permit 10.10.10.0/24
ip prefix-list SUBNETS seq 10 permit 20.20.20.0/24
!
route-map PREPEND permit 10
match ip address prefix-list SUBNETS
set as-path prepend 123 123 123
!
route-map PREPEND permit 20
(Note: you need this last route-map permit statement to advertise any other routes NOT matched in the previous route-map statement. Those addt'l routes will be advertised without the any prepending. Without the 2nd Permit statement, anything NOT matched in the previous statement would be dropped.)
router bgp 123
neighbor 15.15.15.15 route-map PREPEND out
neighbor 19.19.19.19 route-map PREPEND out