BGP IPv6 - MED Attributes

MED Attributes

The BGP (Border Gateway Protocol) IPv6 Multi-Exit Discriminator (MED) attribute is a parameter used to influence the selection of routing paths within BGP networks. Similar to its IPv4 counterpart, BGP IPv6 MED is a numerical value associated with a route that represents the desirability of that route. Lower MED values are considered more preferable, and routers use this attribute to make decisions when multiple exit points to the same destination exist within different Autonomous Systems (ASes). BGP IPv6 MED provides a mechanism for network administrators to fine-tune routing decisions based on factors such as link bandwidth, congestion, or policy preferences. While configuring BGP IPv6 MED, it's essential to ensure consistency and compatibility between routers, as the interpretation of this attribute can vary across different BGP implementations. Careful use of MED attributes helps achieve efficient traffic engineering and load balancing within BGP IPv6 networks.

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, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.2(4)M1, DEVELOPMENT TEST SOFTWARE

Task 1: Configure IPv6 BGP MED Attributes for Autonomous

Step 1: In the configuration mode of router configure IPv6 BGP MED Attributes by following command:

R1:
interface serial 2/3
ipv6 address 13::1/64
ipv6 ospf 1 area 0
no shutdown
exit
router bgp 65100
neighbor 13::3 remote-as 65000
address-family ipv6
neighbor 13::3 activate
neighbor 13::3 soft-reconfiguration inbound
exit
R2:
interface serial 2/3
ipv6 address 24::2/64
ipv6 ospf 1 area 0
no shutdown
exit
router bgp 65000
neighbor 24::4 remote-as 65200
address-family ipv6
neighbor 24::4 activate
neighbor 24::4 soft-reconfiguration inbound
exit
R3:
interface s2/3
ipv6 address 13::3/64
ipv6 ospf 1 area 0
no shutdown
exit
router bgp 65000
neighbor 13::1 remote-as 65100
address-family ipv6
neighbor 13::1 activate
neighbor 13::1 soft-reconfiguration inbound
exit
R4:
interface serial 2/3
ipv6 address 24::4/64
ipv6 ospf 1 area 0
no shutdown
exit
router bgp 65200
neighbor 24::2 remote-as 65000
address-family ipv6
neighbor 24::2 activate
neighbor 24::2 soft-reconfiguration inbound
exit

Step 2: Verify IPv4 BGP routes by following command:

R1#show bgp ipv6 unicast
BGP table version is 22, local router ID is 11.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop          Metric    LocPrf    Weight    Path
 *>  11:0:1::/64          ::              0         	    32768     i
 *>  11:0:2::/64          ::              0                 32768     i
 *>  11:0:3::/64          ::              0                 32768     i
 *>  22:0:1::/64      13::3                                  0        65000 i
 *                  22:0:1::2             0                  0        65000 i
 *>  22:0:2::/64      13::3                                  0        65000 i
 *                  22:0:1::2             0                  0        65000 i
 *>  22:0:3::/64       13::3                                 0        65000 i
 *                  22:0:1::2             0                  0        65000 i
 *>  33:0:1::/64      13::3               0                  0        65000 i
 *                  22:0:1::2                                0        65000 i
 *>  33:0:2::/64      13::3               0                  0        65000 i
 *                  22:0:1::2                                0        65000 i
 *>  33:0:3::/64      13::3               0                  0        65000 i
*                   22:0:1::2                                0        65000 i
*>  44:0:1::/64      13::3                                   0        65000 65200 i
 *                  22:0:1::2                                0        65000 65200 i
 *>  44:0:2::/64     13::3                                   0        65000 65200 i
 *                  22:0:1::2                                0        65000 65200 i
 *>  44:0:3::/64      13::3                                  0        65000 65200 i
 *                  22:0:1::2               	             0        65000 65200 i

MED is local to a router and it is use to change router’s decision when it receives multiple path from same AS.

Router R1 can reach 22:0:2::0 via 22:0:1::2 and via 13::3 through AS 65000 i.e. Router R1 has multiple path to reach AS 65000. But Router R1 will select path via 13::3 as best path because MED select directly connected path as best path when having multiple exit. Therefore MED selects 13::3 as best directly connected to reach R2 as best path as 13::3 is directly connected.

R4#show bgp ipv6 unicast
BGP table version is 22, local router ID is 44.0.3.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop       Metric   LocPrf   Weight    Path
 *>  11:0:1::/64      24::2                            0         65000 65100 i
 *                   33:0:1::3                         0         65000 65100 i
 *>  11:0:2::/64      24::2                            0 	     65000 65100 i
 *                   33:0:1::3                         0         65000 65100 i
 *>  11:0:3::/64      24::2                            0	     65000 65100 i
 *                   33:0:1::3                         0	     65000 65100 i
 *>  22:0:1::/64      24::2            0       		   0 	     65000 i
 *                   33:0:1::3                         0	     65000 i
 *>  22:0:2::/64      24::2            0               0	     65000 i
 *                   33:0:1::3                         0	     65000 i
 *>  22:0:3::/64      24::2            0               0	     65000 i
 *                   33:0:1::3                         0	     65000 i
 *>  33:0:1::/64      24::2                            0	     65000 i
 *                   33:0:1::3         0               0 	     65000 i
 *>  33:0:2::/64      24::2                            0         65000 i
 *                   33:0:1::3         0               0 	     65000 i
 *>  33:0:3::/64      24::2                            0	     65000 i
 *                   33:0:1::3         0               0	     65000 i
 *>  44:0:1::/64         ::            0               32768 	   i
 *>  44:0:2::/64         ::            0         	   32768       i
 *>  44:0:3::/64         ::            0               32768       i

Router R4 can reach 11:0:2::0 via 33:0:1::3 and via 24::2 through AS 65000 65100 i.e. Router R4 has multiple path to reach AS 65000. But Router R1 will select path via 24::2 as best path because MED select directly connected path as best path when having multiple exit. Therefore MED selects 24::2 as best directly connected to reach R2 as best path as 24::2 is directly connected.

Task 2: Configure BGP Selective Manipulation using MED for Autonomous

Step 1: In the configuration mode of router configure BGP Selective Manipulation using MED by following command:

R1:
router bgp 65100
address-family ipv6
neighbor 13::3 route-map iii in
exit
route-map iii permit 10
match ipv6 address uuu
set metric 5000
exit
route-map iii permit 20
ipv6 access-list uuu
permit 22:0:2::/64 any
exit

Step 2: Verify IPv6 BGP route by following command:

R1#show bgp ipv6 unicast
BGP table version is 41, local router ID is 11.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop        Metric    LocPrf    Weight     Path
 *>  11:0:1::/64        ::              0  		          32768      i
 *>  11:0:2::/64        ::              0		          32768      i
 *>  11:0:3::/64        ::              0      	          32768      i
 *>  22:0:1::/64       13::3                     	        0 	     65000 i
 *                    22:0:1::2         0	                0 	     65000 i
 *   22:0:2::/64       13::3                	 5000       0 	     65000 i
 *>                   22:0:1::2         0                   0 	     65000 i
 *>  22:0:3::/64       13::3                                0 	     65000 i
 *                    22:0:1::2         0                   0 	     65000 i
 *>  33:0:1::/64       13::3            0             	    0        65000 i
 *                    22:0:1::2                             0        65000 i
 *>  33:0:2::/64       13::3            0                   0        65000 i
*                     22:0:1::2                             0        65000 i
 *>  33:0:3::/64       13::3            0                   0        65000 i
 *>  33:0:1::/64       13::3            0                   0        65000 i
 *                    22:0:1::2                	            0	     65000 i
 *>  33:0:2::/64       13::3            0             	    0	     65000 i
 *                    22:0:1::2                             0	     65000 i
 *>  33:0:3::/64       13::3            0	                0	     65000 i
 *                    22:0:1::2     	                    0 	     65000 i
 *>  44:0:1::/64       13::3                                0 	     65000 65200 i
 *                 	  22:0:1::2 	                        0 	     65000 65200 i
 *>  44:0:2::/64       13::3                     	        0 	     65000 65200 i
 *                    22:0:1::2           		            0	     65000 65200 i
*>  44:0:3::/64       13::3                                 0	     65000 65200 i
 *                	  22:0:1::2	                            0	     65000 65200 i

Router R1 can now reach 22:0:2:: via 22:0:1::2. This is done by calling route map policy in which selective route 22:0:2::0 only will set 13::3 metric 5000 and rest all routes will select their best path via 13::3. Hence Selective Route Manipulation is done.