[BGP] best path selection_4
4. lowest MED
*A:R3>config>router>bgp# info ---------------------------------------------- min-route-advertisement 1 med-out 100 export "upper" next-hop-resolution use-bgp-routes exit group "Uplink" family ipv4 neighbor 2.2.2.2 peer-as 4766 exit exit no shutdown ---------------------------------------------- |
*A:R4>config>router>bgp# info ---------------------------------------------- min-route-advertisement 1 med-out 200 export "upper" next-hop-resolution use-bgp-routes exit group "Uplink" family ipv4 neighbor 2.2.2.2 peer-as 4766 exit exit no shutdown ---------------------------------------------- |
A:R3>config>router# show router policy "upper" entry 10 from protocol static tag 100 exit to protocol bgp exit action accept as-path-prepend 500 1 origin igp local-preference 100 next-hop 30.1.1.1 exit exit |
*A:R4>config>router# show router policy "upper" entry 10 from protocol static tag 100 exit to protocol bgp exit action accept as-path-prepend 500 1 origin igp local-preference 100 next-hop 30.1.1.2 exit exit |
*A:R2>config>router>bgp# show router bgp routes 20.1.11.0/24 =============================================================================== BGP Router ID:2.2.2.2 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Flag Network LocalPref MED Nexthop (Router) Path-Id Label As-Path ------------------------------------------------------------------------------- u*>i 20.1.11.0/24 100 100 30.1.1.1 None - 500 *i 20.1.11.0/24 100 200 30.1.1.2 None - 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
*A:R2>config>router>bgp# show router bgp routes 20.1.11.0/24 detail =============================================================================== BGP Router ID:2.2.2.2 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 3.3.3.3 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 3.3.3.3 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m13s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 3.3.3.3 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 3.3.3.3 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m13s
------------------------------------------------------------------------------- Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.2 Path Id : None From : 4.4.4.4 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 200 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 4.4.4.4 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m07s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.2 Path Id : None From : 4.4.4.4 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 200 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 4.4.4.4 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m07s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
ㅁ3번, 4번 비교
R2와 R5를 비교하여 med 값과 origin 간 best 경로를 확인해 보면,
*A:R2>config>router>bgp# show router bgp routes 20.1.11.0/24 =============================================================================== BGP Router ID:2.2.2.2 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Flag Network LocalPref MED Nexthop (Router) Path-Id Label As-Path ------------------------------------------------------------------------------- u*>i 20.1.11.0/24 100 100 30.1.1.1 None - 500 *i 20.1.11.0/24 100 200 30.1.1.2 None - 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== *A:R2>config>router>bgp# show router bgp routes 20.1.11.0/24 detail =============================================================================== BGP Router ID:2.2.2.2 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 3.3.3.3 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 3.3.3.3 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m17s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 3.3.3.3 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 3.3.3.3 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m17s
------------------------------------------------------------------------------- Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.2 Path Id : None From : 4.4.4.4 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 200 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 4.4.4.4 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m11s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.2 Path Id : None From : 4.4.4.4 Res. Nexthop : 10.1.12.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 200 AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 4.4.4.4 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m13s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
*A:R5>config>router>bgp# show router bgp routes 20.1.11.0/24 =============================================================================== BGP Router ID:5.5.5.5 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Flag Network LocalPref MED Nexthop (Router) Path-Id Label As-Path ------------------------------------------------------------------------------- u*>i 20.1.11.0/24 100 None 30.1.1.3 None - 500 *e 20.1.11.0/24 100 None 30.1.1.4 None - 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== *A:R5>config>router>bgp# show router bgp routes 20.1.11.0/24 detail =============================================================================== BGP Router ID:5.5.5.5 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.3 Path Id : None From : 6.6.6.6 Res. Nexthop : 10.1.23.1 Local Pref. : 100 Interface Name : Te1/1/3 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 6.6.6.6 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m14s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.3 Path Id : None From : 6.6.6.6 Res. Nexthop : 10.1.23.1 Local Pref. : 100 Interface Name : Te1/1/3 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 6.6.6.6 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m14s
------------------------------------------------------------------------------- Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.4 Path Id : None From : 7.7.7.7 Res. Nexthop : 10.1.23.1 Local Pref. : 100 Interface Name : Te1/1/3 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 7.7.7.7 Fwd Class : None Priority : None Flags : Valid EGP TieBreakReason : Origin Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m56s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.4 Path Id : None From : 7.7.7.7 Res. Nexthop : 10.1.23.1 Local Pref. : 100 Interface Name : Te1/1/3 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : No Cluster Members Originator Id : None Peer Router Id : 7.7.7.7 Fwd Class : None Priority : None Flags : Valid EGP TieBreakReason : Origin Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h00m57s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
*A:R1>config>router# show router bgp routes 20.1.11.0/24 =============================================================================== BGP Router ID:1.1.1.1 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Flag Network LocalPref MED Nexthop (Router) Path-Id Label As-Path ------------------------------------------------------------------------------- u*>i 20.1.11.0/24 100 None 30.1.1.3 None - 500 *i 20.1.11.0/24 100 100 30.1.1.1 None - 500 ------------------------------------------------------------------------------- Routes : 2 ===============================================================================
R2과 R5의 동등한 경로를 R1으로 올리게 됩니다. R2은 med값 100 우선으로, R5는 origin igp 우선으로 올리게 되는데 R5의 경우 R6, R7이 med값을 설정하지 않아 med 값이 낮아 우선하게 됩니다. R6, R7의 med 값을 50으로 200으로 바꿀경우, 다른 라우터로 부터 받은 best 경로를 잡습니다.
*A:R1>config>router# show router bgp routes 20.1.11.0/24 detail =============================================================================== BGP Router ID:1.1.1.1 AS:4766 Local AS:4766 =============================================================================== Legend - Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid l - leaked, x - stale, > - best, b - backup, p - purge Origin codes : i - IGP, e - EGP, ? - incomplete
=============================================================================== BGP IPv4 Routes =============================================================================== Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.3 Path Id : None From : 5.5.5.5 Res. Nexthop : 10.1.11.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : 5.5.5.5 Originator Id : 6.6.6.6 Peer Router Id : 5.5.5.5 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h05m42s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.3 Path Id : None From : 5.5.5.5 Res. Nexthop : 10.1.11.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : None AIGP Metric : None Connector : None Community : No Community Members Cluster : 5.5.5.5 Originator Id : 6.6.6.6 Peer Router Id : 5.5.5.5 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h05m42s
------------------------------------------------------------------------------- Original Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 2.2.2.2 Res. Nexthop : 10.1.11.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : 2.2.2.2 Originator Id : 3.3.3.3 Peer Router Id : 2.2.2.2 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h05m52s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 30.1.1.1 Path Id : None From : 2.2.2.2 Res. Nexthop : 10.1.11.2 Local Pref. : 100 Interface Name : Te1/1/1 Aggregator AS : None Aggregator : None Atomic Aggr. : Not Atomic MED : 100 AIGP Metric : None Connector : None Community : No Community Members Cluster : 2.2.2.2 Originator Id : 3.3.3.3 Peer Router Id : 2.2.2.2 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : MED Route Source : Internal AS-Path : 500 Route Tag : 0 Neighbor-AS : 500 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h05m56s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |