Programmable Internetworking & Communication Operating System Docs ... Click Spaces -> Space Directory to see docs for all releases ...
Page tree
Skip to end of metadata
Go to start of metadata

This section demonstrates how MED can be used by one AS to influence routing decisions of another AS. 

 

                                                      Figure 1-18

Step 1: Configure BGP as TOPO displayed

Switch A:

admin@XorPlus#set protocols bgp bgp-id 6.6.6.6
admin@XorPlus#set protocols bgp local-as "6"
admin@XorPlus#set protocols bgp peer 1001::2 local-ip "1001::1"
admin@XorPlus#set protocols bgp peer 1001::2 as "9"
admin@XorPlus#set protocols bgp peer 1001::2 ipv6-unicast true
admin@XorPlus#set protocols bgp peer 3003::2 local-ip "3003::1"
admin@XorPlus#set protocols bgp peer 3003::2 as "9"
admin@XorPlus#set protocols bgp peer 3003::2 ipv6-unicast true

Switch B:

admin@XorPlus#set protocols bgp bgp-id 26.26.26.26
admin@XorPlus#set protocols bgp local-as "9"
admin@XorPlus#set protocols bgp peer 1001::1 local-ip "1001::2"
admin@XorPlus#set protocols bgp peer 1001::1 as "6"
admin@XorPlus#set protocols bgp peer 1001::1 ipv6-unicast true
admin@XorPlus#set protocols bgp peer 2002::2 local-ip "2002::1"
admin@XorPlus#set protocols bgp peer 2002::2 as "12"
admin@XorPlus#set protocols bgp peer 2002::2 ipv6-unicast true

Switch C:

admin@XorPlus#set protocols bgp bgp-id 9.9.9.9
admin@XorPlus#set protocols bgp local-as "9"
admin@XorPlus#set protocols bgp peer 3003::1 local-ip "3003::2"
admin@XorPlus#set protocols bgp peer 3003::1 as "6"
admin@XorPlus#set protocols bgp peer 3003::1 ipv6-unicast true
admin@XorPlus#set protocols bgp peer 5005::2 local-ip "5005::1"
admin@XorPlus#set protocols bgp peer 5005::2 as "10"
admin@XorPlus#set protocols bgp peer 5005::2 ipv6-unicast true

Switch D:

admin@XorPlus#set protocols bgp bgp-id 44.44.44.44
admin@XorPlus#set protocols bgp local-as 12
admin@XorPlus#set protocols bgp peer 2002::1 local-ip "2002::2"
admin@XorPlus#set protocols bgp peer 2002::1 as 9
admin@XorPlus#set protocols bgp peer 2002::1 ipv6-unicast true

Switch E:

admin@XorPlus#set protocols bgp bgp-id 33.33.33.33
admin@XorPlus#set protocols bgp local-as 10
admin@XorPlus#set protocols bgp peer 5005::1 local-ip "5005::2"
admin@XorPlus#set protocols bgp peer 5005::1 as 9
admin@XorPlus#set protocols bgp peer 5005::1 ipv6-unicast true

 

Step 2: Switch D and Switch E propagate BGP route entry 9999::/64 to Switch B andSwitch C

Note: check the BGP route table on Switch A.

Switch B:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 9999::/64                     2002::2                   44.44.44.44      12 i

Switch C:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 9999::/64                     5005::2                   33.33.33.33      10 i

Switch A:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*  9999::/64                     1001::2                   26.26.26.26      9 12 i
*> 9999::/64                     3003::2                   9.9.9.9          9 10 i
admin@XorPlus#
admin@XorPlus# run show bgp routes ipv6 de
Possible completions:
  <IPNet>                       Print BGP IPv6 routes of specified prefix
  detail                        Print detailed BGP IPv6 routes
admin@XorPlus# run show bgp routes ipv6 detail
9999::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 3003::2
        Multiple Exit Discriminator: 0
        Local Preference: 100
9999::/64
        From peer: 26.26.26.26
        Route: Not Used
        Origin: IGP
        AS Path: 9 12
        Nexthop: 1001::2
        Multiple Exit Discriminator: 0
        Local Preference: 100
 

Note: The MED all is 0. The two BGP route entry.

 

Step 3: Modify the MED value on Switch C

Switch C:

admin@XorPlus# set protocols bgp med 100

Switch A:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*  9999::/64                     3003::2                   9.9.9.9          9 10 i
*> 9999::/64                     1001::2                   26.26.26.26      9 12 i
admin@XorPlus# run show bgp routes ipv6 detail
9999::/64
        From peer: 26.26.26.26
        Route: Winner
        Origin: IGP
        AS Path: 9 12
        Nexthop: 1001::2
        Multiple Exit Discriminator: 0
        Local Preference: 100
9999::/64
        From peer: 9.9.9.9
        Route: Not Used
        Origin: IGP
        AS Path: 9 10
        Nexthop: 3003::2
        Multiple Exit Discriminator: 100
        Local Preference: 100
admin@XorPlus#

Note: The best route is coming from Switch B, as the BGP route entry from Switch B has a smaller MED value. It will select the BGP route entry with smaller MED value if other attributes all have the same priority.

 

Step 4: Modify the MED larger than Switch C

Switch B:

admin@XorPlus# set protocols bgp med 200

Switch A:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*  9999::/64                     1001::2                   26.26.26.26      9 12 i
*> 9999::/64                     3003::2                   9.9.9.9          9 10 i
admin@XorPlus# run show bgp routes ipv6 detail
9999::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 3003::2
        Multiple Exit Discriminator: 100
        Local Preference: 100
9999::/64
        From peer: 26.26.26.26
        Route: Not Used
        Origin: IGP
        AS Path: 9 12
        Nexthop: 1001::2
        Multiple Exit Discriminator: 200
        Local Preference: 100

Note: The BGP speaker selects the BGP route entry with the smaller MED.

  • No labels