IPv6 BGP Local Preference

The local preference designates a route to a certain network as the preferred exit route to that network from the AS. The route with a highest local preference is the preferred route. The default value of the local preference is 100, but this can be changed using the set local-preference command.

IPv6 BGP Local Preference Configuration

To configure the local preference of a preferred route in an AS:

On R1:
interface Loopback0
: ipv6 address 1111:111:111:A::/64 eui−64
: ipv6 ospf 10 area 0
 
interface FastEthernet0/0
: ipv6 address AB01:CD1:123:A::/64 eui−64
: ipv6 ospf 10 area 0
!
interface Serial0/0
: ipv6 address AB01:CD1:123:C::/64 eui−64
!
interface FastEthernet0/1
: ipv6 address AB01:CD1:123:B::/64 eui−64
: ipv6 ospf 10 area 0
!
: ipv6 router ospf 10 router−id 1.1.1.1 log−adjacency−changes
: redistribute connected route−map CONNECTED
!
route−map CONNECTED permit 10
: match interface Serial0/0
!
router bgp 123
bgp router−id 1.1.1.1
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 remote−as 123
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 update−source Loopback0
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 remote−as 123
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 update−source Loopback0
: neighbor AB01:CD1:123:C:C604:16FF:FE98:0 remote−as 101
: neighbor AB01:CD1:123:C:C604:16FF:FE98:0 ebgp−multihop 5
!
address−family ipv6
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 activate
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 next−hop−self
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 activate
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 next−hop−self
: neighbor AB01:CD1:123:C:C604:16FF:FE98:0 activate exit−address−family
 
On R2:
interface Loopback0
: ipv6 address 2222:222:222:A::/64 eui−64
: ipv6 ospf 10 area 0
!
interface FastEthernet0/0
: ipv6 address AB01:CD1:123:A::/64 eui−64
: ipv6 ospf 10 area 0
!
interface FastEthernet0/1
: ipv6 address AB01:CD1:123:D::/64 eui−64
: ipv6 ospf 10 area 0
!
: ipv6 router ospf 10 router−id 2.2.2.2 log−adjacency−changes
!
router bgp 123
bgp router−id 2.2.2.2
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 remote−as 123
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 update−source Loopback0
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 remote−as 123
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 update−source Loopback0
 
address−family ipv6
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 activate
: neighbor 3333:333:333:A:C603:3FF:FEF0:0 activate
exit−address−family
 
On R3:
interface Loopback0
: ipv6 address 3333:333:333:A::/64 eui−64
: ipv6 ospf 10 area 0
!
interface FastEthernet0/0
: ipv6 address AB01:CD1:123:B::/64 eui−64
: ipv6 ospf 10 area 0
!
interface Serial0/0
: ipv6 address AB01:CD1:123:E::/64 eui−64
!
interface FastEthernet0/1
: ipv6 address AB01:CD1:123:D::/64 eui−64
: ipv6 ospf 10 area 0
!
ipv6 router ospf 10
: router−id 3.3.3.3
: redistribute connected route−map CONNECTED
!
router bgp 123
: no synchronization
: bgp router−id 3.3.3.3
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 remote−as 123
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 update−source Loopback0
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 remote−as 123
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 update−source Loopback0
: neighbor AB01:CD1:123:E:C605:16FF:FE98:0 remote−as 202
: neighbor AB01:CD1:123:E:C605:16FF:FE98:0 ebgp−multihop 5
!
address−family ipv6
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 activate
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 next−hop−self
: neighbor 1111:111:111:A:C601:3FF:FEF0:0 route−map LOCAL_PREF out
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 activate
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 next−hop−self
: neighbor 2222:222:222:A:C602:3FF:FEF0:0 route−map LOCAL_PREF out
: neighbor AB01:CD1:123:E:C605:16FF:FE98:0 activate
exit−address−family
!
ipv6 prefix−list 10 seq 5 permit BC01:BC1:10:A::/64
!
route−map LOCAL_PREF permit 10
: match ipv6 address prefix−list 10
: set local−preference 500
!
route−map LOCAL_PREF permit 20
!
route−map CONNECTED permit 10
: match interface Serial0/0
On R4:
interface Serial0/0
: ipv6 address AB01:CD1:123:C::/64 eui−64
!
interface Loopback10
: ipv6 address BC01:BC1:10:A::/64 eui−64
!
interface Loopback11
: ipv6 address BC02:BC1:11:A::/64 eui−64
!
interface Loopback12
: ipv6 address BC03:BC1:12:A::/64 eui−64
 
router bgp 101
bgp router−id 4.4.4.4
: neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 remote−as 123
!
address−family ipv6
: neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 activate
: network BC01:BC1:10:A::/64 network BC02:BC1:11:A::/64
: network BC03:BC1:12:A::/64 exit−address−family
On R5:
interface Serial0/0
: ipv6 address AB01:CD1:123:E::/64 eui−64
: clock rate 2000000
!
interface Loopback10
: ipv6 address BC01:BC1:10:A::/64 eui−64
!
interface Loopback11
: ipv6 address BC02:BC1:11:A::/64 eui−64
!
interface Loopback12
: ipv6 address BC03:BC1:12:A::/64 eui−64
!
router bgp 202
bgp router−id 5.5.5.5
: neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 remote−as 123
: neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 ebgp−multihop 5
!
address−family ipv6
: neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 activate
: network BC01:BC1:10:A::/64
: network BC02:BC1:11:A::/64
: network BC03:BC1:12:A::/64
exit−address−family
 

To verify the route, use the show bgp ipv6 unicast command:

On R2:
R2> show bgp ipv6 unicast

Before the local preference is configured, R2 has R1 as its next hop for all learned IPv6 addresses. After configuring the local preference on R3 to 500, R2 has a different preferred exit route for prefix BC01:BC1:10:A::/64. R2 can now reach prefix BC01:BC1:10:A::/64 through the exit path of R3, which is now designated as the local preference.