Wired Intelligent Edge (Campus Switching and Routing)

Aruba 3810 Switch - How to Change the BGP Route Selection by Configuring BGP Local Preference

MVP
MVP
Requirement:

This article discusses how to modify the BGP routing process to use the Local-Preference rule to select only one path.



Solution:

In the following example, switches Rack2sw1, Rack2sw2 and Rack2sw3 are configured for BGP routing. Rack2sw1 is receiving a valid Nexthop from switches Rack2sw2 and Rack2sw3 for the prefix 10.10.10.10/32 (see output of show ip bgp below).

 

Rack2sw1# show ip bgp

  Local AS            : 1             Local Router-id  : 1.1.1.1
  BGP Table Version   : 6

  Status codes: * - valid, > - best, i - internal, e - external, s - stale
  Origin codes: i - IGP, e - EGP, ? - incomplete

     Network            Nexthop         Metric     LocalPref  Weight AsPath
     ------------------ --------------- ---------- ---------- ------ ---------
*  e  10.10.10.10/32     192.168.12.2    0                     0      2        ?
*>e  10.10.10.10/32     192.168.12.3    0                     0      3        ?

By default the maximum number of equal cost IP load sharing paths is four.
This is the reason for two entries in the routing table for the 10.10.10.10/32 prefix:

Rack2sw1# show ip route

                                IP Route Entries

  Destination        Gateway         VLAN Type      Sub-Type   Metric     Dist.
  ------------------ --------------- ---- --------- ---------- ---------- -----
  10.10.10.10/32     192.168.12.2    1    bgp       external   0          20
  10.10.10.10/32     192.168.12.3    1    bgp       external   0          20

 

The "ip load-sharing" configuration option can be configured for the values of 2-4. Having only one path for a prefix requires configuring the BGP router for path selection. The following  BGP configuration is an example that  does not include a path selection:


Rack2sw1# show running-config router bgp

Running configuration:

router bgp 1
   enable
   bgp router-id 1.1.1.1
   neighbor 192.168.12.2 remote-as 2
   neighbor 192.168.12.3 remote-as 3


The first three BGP path selection rules follow.

 • Prefer the route with the lowest Administrative Distance.
 • Prefer the route with the larger weight.
 • Prefer the route with the highest LOCAL_PREF value.



Configuration:

The modified switch configuration for path selection;

 • Adds an “IP Prefix-List” which matches the IP address 10.10.10.10.
 • Adds a “Route-Map” which sets the BGP Local-Preference for the neighbor Rack2sw1.
 • The BGP configuration includes the Route-Map .

 

********** IP Prefix-List to match Rack2sw1 **********


Rack2sw1# show run | begin prefix
ip prefix-list "ten-ten-ten-ten" seq 5 permit 10.10.10.10 255.255.255.255 ge 32 le 32​

Rack2sw1# show ip prefix-list

 ip prefix-list ten-ten-ten-ten: 1 entries
    5            permit 10.10.10.10/32 ge 32 le 32

********** Route-Map to set the BGP local preference **********


Rack2sw1# show running-config | begin route-map "Local-Preference" permit

route-map "Local-Preference" permit seq 10
   match ip address prefix-list "ten-ten-ten-ten"
   set local-preference 110

Rack2sw1# show route-map

 Routemap information

route-map "Local-Preference" permit seq 10
   match ip address prefix-list "ten-ten-ten-ten"
   set local-preference 110


********** Modify the BGP routing process to use the route-map **********


Rack2sw1# show running-config router bgp

Running configuration:

router bgp 1
   enable
   bgp router-id 1.1.1.1
   neighbor 192.168.12.2 remote-as 2
   neighbor 192.168.12.2 route-map "Local-Preference" in <==========
   neighbor 192.168.12.3 remote-as 3


********** Restart BGP neighbor **********

Rack2sw1# clear ip bgp neighbor 192.168.12.2



Verification

Updated Routing Table Has A Single Entry For 10.10.10.10/32:

Rack2sw1# show ip route bgp

                                IP Route Entries

  Destination        Gateway         VLAN Type      Sub-Type   Metric     Dist.
  ------------------ --------------- ---- --------- ---------- ---------- -----
  10.10.10.10/32     192.168.12.2    1    bgp       external   0          170


Rack2sw1# show ip bgp 10.10.10.10 255.255.255.255

  Local AS            : 1             Local Router-id  : 1.1.1.1
  BGP Table Version   : 89

  Network     : 10.10.10.10/32        Nexthop          : 192.168.12.2
  Peer        : 192.168.12.2          Origin           : incomplete
  Metric      : 0                     Local Pref       :
  Weight      : 0                     Calc. Local Pref : 110
  Valid       : Yes                   Type             : external
  Stale       : No
  Best        : Yes (Higher Local Preference)
  AS-Path     : 2
  Communities :

  Network     : 10.10.10.10/32        Nexthop          : 192.168.12.3
  Peer        : 192.168.12.3          Origin           : incomplete
  Metric      : 0                     Local Pref       :
  Weight      : 0                     Calc. Local Pref : 100
  Valid       : Yes                   Type             : external
  Stale       : No
  Best        : No
  AS-Path     : 3
  Communities :

Version history
Revision #:
1 of 1
Last update:
‎05-29-2020 09:01 AM
Updated by:
 
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: