2013/11/16

WB1 7.23 BGP Bestpath Selection - Always Compare MED

7.23 BGP Bestpath Selection - Always Compare MED
• Remove the BGP configuration made for the previous task.
• Create a new Loopback 1 interface on both R6 and SW3 with the IP address 1.2.3.4/32 and advertise it into BGP on both R6 and SW3.
• Using just the MED attribute configure the network so that traffic from AS 200 going to this prefix is always received by SW3.

 
Note
 
As discussed previously, comparing automatically generated MED attributes makes sense only if all prefixes are originated from directly connected AS.
 
This limitation could be disabled by entering the command bgp always compare-med under BGP configuration mode. This will instruct BGP code to ignore the first AS# in the AS_PATH attributes when comparing MED values.
 
In this task, both AS 300 and AS 100 advertise the same prefix (artificially created). Border routers in AS 300 (SW1) and AS 100 (R1 and R4) are configured to set metrics so that the exit point between R3 and SW1 is used to reach this subnet. In order to make AS 200 account for metrics from different
ASes we enable the always-compared-med feature in all router of AS 200.

 
Configuration
 
R6:
interface Loopback1
ip address 1.2.3.4 255.255.255.255
!
router bgp 100
network 1.2.3.4 mask 255.255.255.255

SW3:
interface Loopback1
ip address 1.2.3.4 255.255.255.255
!
router bgp 300
network 1.2.3.4 mask 255.255.255.255

 
R1:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R3 permit 10
match ip address prefix-list LOOPBACK1
set metric 1000
!
route-map TO_R3 permit 100
!
router bgp 100
neighbor 155.1.13.3 route-map TO_R3 out

 
R4:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R5 permit 10
match ip address prefix-list LOOPBACK1
set metric 1000
!
route-map TO_R5 permit 100
!
router bgp 100
neighbor 155.1.45.5 route-map TO_R5 out

 
SW1:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R3 permit 10
match ip address prefix-list LOOPBACK1
set metric 100

!
route-map TO_R3 permit 100
!
router bgp 300
neighbor 155.1.37.3 route-map TO_R3 out

 
以下的指令bgp always-compare-med我都先不下,晚一點後面會說明:
 
R2:
router bgp 200
bgp always-compare-med


R3:
router bgp 200
bgp always-compare-med

 
R5:
router bgp 200
bgp always-compare-med

SW2:
router bgp 200
bgp always-compare-med

SW4:
router bgp 200
bgp always-compare-med


--------------------------------------------------------
 
R3由於比較基準都一致時,選擇SW1 - Metric 100為best route
 
Rack1R3#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 61
Paths: (3 available, best #3, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    2    3
  100
    155.1.45.4 (metric 27262976) from 155.1.0.5 (150.1.5.5)
      Origin IGP, metric 1000, localpref 100, valid, internal
  100
    155.1.13.1 from 155.1.13.1 (150.1.1.1)
      Origin IGP, metric 1000, localpref 100, valid, external
  300
    155.1.37.7 from 155.1.37.7 (150.1.7.7)
      Origin IGP, metric 100, localpref 100, valid, external, best
Rack1R3#

 
R5選擇 R4 - external 為best route
 
Rack1R5#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 44
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        2    3
  100
    155.1.45.4 from 155.1.45.4 (150.1.4.4)
      Origin IGP, metric 1000, localpref 100, valid, external, best
  300
    155.1.37.7 (metric 2172416) from 155.1.23.3 (150.1.3.3)
      Origin IGP, metric 100, localpref 100, valid, internal
Rack1R5#

 
R3由於比較基準都一致時,選擇SW1 - Low RID 150.1.3.3為best route
 
Rack1R2#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 60
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1
  100
    155.1.45.4 (metric 27769600) from 155.1.0.5 (150.1.5.5)
      Origin IGP, metric 1000, localpref 100, valid, internal
  300
    155.1.37.7 (metric 2172416) from 155.1.23.3 (150.1.3.3)
     
Origin IGP, metric 100, localpref 100, valid, internal, bestRack1R2#

在AS200區域裡將指令全部補下bgp always-compare-med之後,
R5選擇 R4 - metric 100 為best route
(instruct BGP code to ignore the first AS# in the AS_PATH attributes when comparing MED values.)

Rack1R5#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 2
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    3
  300
    155.1.37.7 (metric 2172416) from 155.1.23.3 (150.1.3.3)
      Origin IGP, metric 100, localpref 100, valid, internal, best  100
    155.1.45.4 from 155.1.45.4 (150.1.4.4)
      Origin IGP, metric 1000, localpref 100, valid, external
Rack1R5#

沒有留言:

張貼留言