This document explains the IPv6 Border Gateway Protocol (BGP) Local-Preference feature. Local preference is an indication to the AS about which path has preference to exit the AS in order to reach a certain network. A path with higher local preference is preferred more. The default value of preference is 100.
Ensure that you meet these requirements before you attempt this configuration:
Understanding of BGP routing protocol and its operation
Understanding of IPv6 Addressing scheme
The information in this document is tested on these software and hardware versions
Cisco IOS Software Release 12.4, Advance IP Services Feature Set
• Cisco 3700 Series Multiservice Access Routers
Refer to Cisco Technical Tips Conventions for more information on document conventions.
In the example, Router R1, R2 and R3 are part of BGP Autonomous System number 123. R4 is part of Autonomous System 101 and R5 part of Autonomous System 100.
The three routers (R1, R2 and R3) are configured with OSPFv3 for IGP connectivity. IPv6 prefix of loop back interface Lo 0 (1111:111:111:A::/64 eui-64, 2222:222:222:A::/64 eui-64 And 3333:333:333:A::/64 eui-64) of all three routers is advertised in Area 0 of OSPFv3 routing protocol.
IBGP peering is formed between routers R1, R2 and R3 through learnt loopback prefixes. Router R1 and R4 are connected over a WAN link (serial connection) and forms EBGP peering. Similarly router R3 and R5 are forming EBGP peering over WAN link.
Router R4 and R5 inject the same IPv6 prefixes:
network BC01:BC1:10:A::/64
network BC02:BC1:11:A::/64
network BC03:BC1:12:A::/64
As the two Routers R4 and R5 inject the same IPv6 prefixes, the path selection is based on BGP well-known Attributes. In this example, Local Preference is chosen. The BGP Local Preference value of 500 is set for the prefix BC01:BC1:10:A::/64 on router R3 through route-map. This results in R3 as the exit point for this prefix and R1 the exit point for the remaining two prefixes.
The fast Ethernet interfaces (F0/0 And F0/1) of routers R1, R2 And R3 are IPv6 enabled with IPv6 address of format eui-64.
This document uses this network setup:
This document uses these configurations:
Note: All the routers are enabled with forwarding of IPv6 packets by using the ipv6 unicast-routing command .
R1 |
---|
interface Loopback0 no ip address ipv6 address 1111:111:111:A::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 !--- Enables OSPFv3 on the interface and associates !--- the interface loopback0 to area 0. ! interface FastEthernet0/0 description CONNECTED TO Rtr2 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:A::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 ! interface Serial0/0 no ip address ipv6 address AB01:CD1:123:C::/64 eui-64 ipv6 enable clock rate 2000000 ! interface FastEthernet0/1 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:B::/64 eui-64 ipv6 enable 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 no bgp default ipv4-unicast bgp log-neighbor-changes 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 |
R2 |
---|
interface Loopback0 no ip address ipv6 address 2222:222:222:A::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:A::/64 eui-64 ipv6 ospf 10 area 0 ! interface FastEthernet0/1 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:D::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 ! ipv6 router ospf 10 router-id 2.2.2.2 log-adjacency-changes ! router bgp 123 no synchronization bgp router-id 2.2.2.2 bgp log-neighbor-changes 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 no auto-summary ! 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 |
R3 |
---|
interface Loopback0 no ip address ipv6 address 3333:333:333:A::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:B::/64 eui-64 ipv6 enable ipv6 ospf 10 area 0 ! interface Serial0/0 no ip address ipv6 address AB01:CD1:123:E::/64 eui-64 ipv6 enable clock rate 2000000 ! interface FastEthernet0/1 no ip address duplex auto speed auto ipv6 address AB01:CD1:123:D::/64 eui-64 ipv6 ospf 10 area 0 ! ipv6 router ospf 10 router-id 3.3.3.3 log-adjacency-changes redistribute connected route-map CONNECTED ! router bgp 123 no synchronization bgp router-id 3.3.3.3 bgp log-neighbor-changes 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 no auto-summary ! 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 |
R4 |
---|
interface Serial0/0 no ip address ipv6 address AB01:CD1:123:C::/64 eui-64 ipv6 enable clock rate 2000000 ! interface Loopback10 no ip address ipv6 address BC01:BC1:10:A::/64 eui-64 ipv6 enable ! interface Loopback11 no ip address ipv6 address BC02:BC1:11:A::/64 eui-64 ipv6 enable ! interface Loopback12 no ip address ipv6 address BC03:BC1:12:A::/64 eui-64 ipv6 enable router bgp 101 bgp router-id 4.4.4.4 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 remote-as 123 neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 ebgp-multihop 5 ! 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 |
R5 |
---|
interface Serial0/0 no ip address ipv6 address AB01:CD1:123:E::/64 eui-64 ipv6 enable clock rate 2000000 ! interface Loopback10 no ip address ipv6 address BC01:BC1:10:A::/64 eui-64 ipv6 enable ! interface Loopback11 no ip address ipv6 address BC02:BC1:11:A::/64 eui-64 ipv6 enable ! interface Loopback12 no ip address ipv6 address BC03:BC1:12:A::/64 eui-64 ipv6 enable ! router bgp 202 bgp router-id 5.5.5.5 no bgp default ipv4-unicast bgp log-neighbor-changes 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 |
This section provides information you can use to confirm your configuration properly works.
On Router R1
On Router R2
Note: When Local Preference is not configured, router R2 (Rtr2) has router R1 (Rtr1) as its next hop for all the learnt IPv6 addresses.
Note: The prefix BC01:BC1:10:A::/64 takes an exit path of Router R3 as the Local Preference is set higher.
On Router R3
Use these commands for troubleshooting