IPv6 - BGP MED

Lab:

Disclaimer

This Configuration Guide is designed to assist members to enhance their skills in particular technology area. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an “as is” basis. Neither the authors nor Forum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this guide. This configuration guide was developed by Forum. Any similarities between material presented in this configuration guide and any other material is completely coincidental.

Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.0(1)M9, RELEASE SOFTWARE (fc1)

R1 Router Config:

! 
ipv6 unicast-routing 
ipv6 cef
! 
interface Loopback0 
no ip address 
ipv6 address 2002:0:1:1::1/128 
ipv6 ospf 1 area 0 
! 
interface Loopback1 
no ip address 
ipv6 address 2002:0:1:2::1/128 
ipv6 ospf 1 area 0 
! 
interface Loopback2 
no ip address 
ipv6 address 2002:0:1:3::1/128 
ipv6 ospf 1 area 0 
! 
interface Serial1/0 
no ip address 
ipv6 address 2001:0:0:12::1/128 
ipv6 ospf 1 area 0 
no fair-queue 
serial restart-delay 0 
! 
interface Serial1/1 
ipv6 address 2001:0:0:13::1/64 
serial restart-delay 0 
! 
router bgp 65100 
bgp router-id 1.1.1.1 
no bgp default ipv4-unicast 
bgp log-neighbor-changes 
neighbor 2001:0:0:13::3 remote-as 65000 
neighbor 2002:0:2:1::2 remote-as 65000 
neighbor 2002:0:2:1::2 ebgp-multihop 5 
neighbor 2002:0:2:1::2 update-source 
Loopback0 
! 
address-family ipv6 
no synchronization 
network 2002:0:1:2::1/128 
network 2002:0:1:3::1/128 
neighbor 2001:0:0:13::3 activate 
neighbor 2002:0:2:1::2 activate
exit-address-family 
! 
ipv6 router ospf 1 
router-id 1.1.1.1 
log-adjacency-changes 
!

R4 Router Config:

! 
ipv6 unicast-routing 
ipv6 cef
! 
interface Loopback0 
no ip address 
ipv6 address 2002:0:4:1::4/128 
! 
interface Loopback1 
no ip address 
ipv6 address 2002:0:4:2::4/128 
! 
interface Loopback2 
no ip address 
ipv6 address 2002:0:4:3::4/128 
! 
interface Serial1/0 
no ip address 
ipv6 address 2001:0:0:34::4/128 
serial restart-delay 0 
clock rate 64000 
! 
router bgp 65200 
bgp router-id 4.4.4.4 
no bgp default ipv4-unicast 
bgp log-neighbor-changes 
neighbor 2002:0:3:1::3 remote-as 65000 
neighbor 2002:0:3:1::3 ebgp-multihop 5 
neighbor 2002:0:3:1::3 update-source 
Loopback0 
! 
address-family ipv6 
no synchronization 
network 2002:0:4:2::4/128 
network 2002:0:4:3::4/128 
neighbor 2002:0:3:1::3 activate 
exit-address-family 
! 
ipv6 route 2001:0:0:34::3/128 Serial1/0 
ipv6 route 2002:0:3:1::3/128 Serial1/0 
!

R2 Router Config:

! 
ipv6 unicast-routing 
ipv6 cef 
! 
interface Loopback0 
no ip address 
ipv6 address 2002:0:2:1::2/128 
ipv6 ospf 1 area 0 
! 
interface Loopback1 
no ip address 
ipv6 address 2002:0:2:2::2/128 
ipv6 ospf 1 area 0 
! 
interface Loopback2 
no ip address 
ipv6 address 2002:0:2:3::2/128 
ipv6 ospf 1 area 0 
! 
interface Serial1/0 
no ip address 
ipv6 address 2001:0:0:12::/64 eui-64 
ipv6 ospf 1 area 0 
no fair-queue 
serial restart-delay 0 
clock rate 64000 
! 
interface FastEthernet2/0 
no ip address 
duplex full 
speed 100 
ipv6 address 2001:0:0:23::/64 eui-64 
ipv6 ospf 1 area 0 
!
router bgp 65000 
bgp router-id 2.2.2.2 
no bgp default ipv4-unicast 
bgp log-neighbor-changes 
neighbor 2001::23:C803:CFF:FE78:38 
remote-as 65000 
neighbor 2002:0:1:1::1 remote-as 65100 
neighbor 2002:0:1:1::1 ebgp-multihop 5 
neighbor 2002:0:1:1::1 update-source 
Loopback0 
! 
address-family ipv6 
no synchronization 
network 2002:0:2:2::2/128 
network 2002:0:2:3::2/128 
neighbor 2001::23:C803:CFF:FE78:38 
activate 
neighbor 2002:0:1:1::1 activate 
exit-address-family 
! 
ipv6 router ospf 1 
router-id 2.2.2.2 
log-adjacency-changes 
!

R3 Router Config:

! 
ipv6 unicast-routing 
ipv6 cef 
! 
interface Loopback0 
no ip address 
ipv6 address 2002:0:3:1::3/128 
ipv6 ospf 1 area 0 
! 
interface Loopback1 
no ip address
ipv6 address 2002:0:3:2::3/128 
ipv6 ospf 1 area 0 
! 
interface Loopback2 
no ip address 
ipv6 address 2002:0:3:3::3/128 
ipv6 ospf 1 area 0 
! 
interface Serial1/0 
no ip address 
ipv6 address 2001:0:0:34::3/128 
no fair-queue 
serial restart-delay 0 
clock rate 64000 
! 
interface Serial1/1 
no ip address 
ipv6 address 2001:0:0:13::3/64 
serial restart-delay 0 
! 
interface FastEthernet2/0 
mac-address ca03.0c78.0038 
no ip address
duplex auto 
speed auto 
ipv6 address 2001:0:0:23::/64 eui-64 
ipv6 ospf 1 area 0 
! 
router bgp 65000 
bgp router-id 3.3.3.3 
no bgp default ipv4-unicast 
bgp log-neighbor-changes 
neighbor 2001:0:0:13::1 remote-as 65100 
neighbor 2001::23:C802:CFF:FE78:38 
remote-as 65000 
neighbor 2002:0:4:1::4 remote-as 65200 
neighbor 2002:0:4:1::4 ebgp-multihop 5 
neighbor 2002:0:4:1::4 update-source 
Loopback0 
! 
address-family ipv6 
no synchronization 
network 2002:0:3:2::3/128 
network 2002:0:3:3::3/128 
neighbor 2001:0:0:13::1 activate 
neighbor 2001::23:C802:CFF:FE78:38 
activate 
neighbor 2001::23:C802:CFF:FE78:38 
next-hop-self 
neighbor 2002:0:4:1::4 activate 
exit-address-family 
! 
ipv6 route 2001:0:0:34::4/128 Serial1/0 
ipv6 route 2002:0:4:1::4/128 Serial1/0 
! 
ipv6 router ospf 1 
router-id 3.3.3.3 
log-adjacency-changes 
! 

MED is RFC compliant non-transitive attribute. It is used for changing a router decision for selecting a path when same routes are learn by eBGP neighbors from a single neighbor AS in multi-homed environment. Lower the MED value, better the path is.

Note 1: In above topology OSPFv3 has been run over R1, R2 and R3 within same area AREA 0.

Note 2: Static routes has been used between R3 and R4 for reachability.

Verification:

R1#sh bgp ipv6 unicast

BGP table version is 11, local router ID is 1.1.1.1 
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, 
r RIB-failure, S Stale 
Origin codes: i – IGP, e – EGP, ? – incomplete 

 Network                 Next Hop         Metric       LocPrf      Weight      Path 
*> 2002:0:1:2::1/128     ::               0                        32768       i 
*> 2002:0:1:3::1/128     ::               0                        32768       i 
*> 2002:0:2:2::2/128     2001:0:0:13::3   0                        0           65000 i 
*                        2002:0:2:1::2    0                        0           65000 i 
*> 2002:0:2:3::2/128     2001:0:0:13::3   0                        0           65000 i 
*                        2002:0:2:1::2    0                        0           65000 i 
* 2002:0:3:2::3/128      2002:0:2:1::2    0                        0           65000 i 
*>                       2001:0:0:13::3   0                        0           65000 i 
* 2002:0:3:3::3/128      2002:0:2:1::2    0                        0           65000 i 
*>                       2001:0:0:13::3   0                        0           65000 i 
* 2002:0:4:2::4/128      2002:0:2:1::2    0                        0           65000 65200 i 
*>                       2001:0:0:13::3   0                        0           65000 65200 i 
* 2002:0:4:3::4/128      2002:0:2:1::2    0                        0           65000 65200 i 
*>                       2001:0:0:13::3   0                        0           65000 65200 i

Here the best paths selected by BGP are via R3.

Modifications on R1

R1(config)#router bgp 65100 
R1(config-router)#address-family ipv6 
R1(config-router-af)#neigh 2001:0:0:13::3 route-map MED in 
R1(config-router-af)#^Z 
R1(config)#route-map MED permit 10 
R1(config-route-map)#set metric 60 (Will increase the metric of routes by 60) 
R1(config-route-map)#exit 
R1(config)#route-map MED permit 20 
R1(config-route-map)#exit 
R1(config)#^Z 
R1#clear bgp ipv6 unicast 2001:0:0:13::3

Verification:

R1#sh bgp ipv6 unicast

BGP table version is 35, local router ID is 1.1.1.1 
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale 
Origin codes: i – IGP, e – EGP, ? – incomplete 

 Network                 Next Hop         Metric       LocPrf      Weight      Path 
*> 2002:0:1:2::1/128     ::               0                        32768       i 
*> 2002:0:1:3::1/128     ::               0                        32768       i 
* 2002:0:2:2::2/128      2001:0:0:13::3   60                       0           65000 i 
*>                       2002:0:2:1::2    0                        0           65000 i 
* 2002:0:2:3::2/128      2001:0:0:13::3   60                       0           65000 i 
*>                       2002:0:2:1::2    0                        0           65000 i 
* 2002:0:3:2::3/128      2001:0:0:13::3   60                       0           65000 i 
*>                       2002:0:2:1::2    0                        0           65000 i 
* 2002:0:3:3::3/128      2001:0:0:13::3   60                       0           65000 i 
*>                       2002:0:2:1::2    0                        0           65000 i 
* 2002:0:4:2::4/128      2001:0:0:13::3   60                       0           65000 65200 i 
*>                       2002:0:2:1::2    0                        0           65000 65200 i 
* 2002:0:4:3::4/128      2001:0:0:13::3   60                       0           65000 65200 i 
*>                       2002:0:2:1::2    0                        0           65000 65200 i

Weight has been increased by 60 for the route updates learned via R3 (2001:0:0:13::3) and hence paths via R2 (2002:0:2:1::2) become best paths.