[BGP] best path selection_3
3. low Origin
lower origin have preference: IGP = 0, EGP = 1, INCOMPLETE = 2
해당 항목은 origin 코드를 보고 IGP를 우선한다는 내용이다.
R3을 origin code igp, R4는 origin code egp로 설정 후 R2에서 확인해 보면
igp인 R3의 경로가 우선임을 알 수 있다.
*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 egp 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 None 30.1.1.1 None - No As-Path *e 20.1.11.0/24 100 None 30.1.1.2 None - No As-Path ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
A:R2>config# 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 : None 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 : No As-Path Route Tag : 0 Neighbor-AS : N/A Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 06h04m28s
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 : None 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 : No As-Path Route Tag : 0 Neighbor-AS : N/A Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 06h04m29s
------------------------------------------------------------------------------- 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 : None 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 EGP TieBreakReason : Origin Route Source : Internal AS-Path : No As-Path Route Tag : 0 Neighbor-AS : N/A Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h04m38s
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 : None 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 EGP TieBreakReason : Origin Route Source : Internal AS-Path : No As-Path Route Tag : 0 Neighbor-AS : N/A Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h04m38s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
ㅁ 2번, 3번 비교
R2와 R5에서 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 None 30.1.1.1 None - 500 *e 20.1.11.0/24 100 None 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 : None 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 : 00h08m14s
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 : None 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 : 00h08m15s
------------------------------------------------------------------------------- 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 : None 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 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 : 00h00m47s
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 : None 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 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 : 00h00m47s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 |
A:R5>config>router# 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 *i 20.1.11.0/24 None None 7.7.7.7 None - 4768 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== *A:R5>config>router# 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 : 02h18m48s
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 : 02h18m49s
------------------------------------------------------------------------------- Original Attributes
Network : 20.1.11.0/24 Nexthop : 7.7.7.7 Path Id : None From : 7.7.7.7 Res. Nexthop : 10.1.23.1 Local Pref. : n/a 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 IGP TieBreakReason : ASPathLen Route Source : External AS-Path : 4768 500 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h13m43s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 7.7.7.7 Path Id : None From : 7.7.7.7 Res. Nexthop : 10.1.23.1 Local Pref. : None 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 IGP TieBreakReason : ASPathLen Route Source : External AS-Path : 4768 500 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h13m43s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 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.1 None - 500 *i 20.1.11.0/24 100 None 30.1.1.3 None - 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== *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.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 : None 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 : 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 : 00h09m09s
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 : None 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 : 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 : 00h09m09s
------------------------------------------------------------------------------- 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 : Valid IGP TieBreakReason : OriginatorID 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 : 00h30m54s
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 : Valid IGP TieBreakReason : OriginatorID 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 : 00h30m55s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
R2와 R5에서 동일한 20.1.11.0/24 NH 30.1.1.1(3)의 정보를 R1으로 올리게 되는데
local-preference값과 as-path가 동일하므로, Originator ID값을 비교하여 작은 R3에서 광고한
정보가 best로 잡히게 됩니다.
R3 ~ R6의 Originator ID를 동일하게 10.10.10.10으로 설정한 뒤, 비교해보면
*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.1 None - 500 *i 20.1.11.0/24 100 None 30.1.1.3 None - 500 ------------------------------------------------------------------------------- Routes : 2 ===============================================================================
*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.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 : None AIGP Metric : None Connector : None Community : No Community Members Cluster : 2.2.2.2 Originator Id : 10.10.10.10 Peer Router Id : 2.2.2.2 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 : 00h00m49s
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 : None AIGP Metric : None Connector : None Community : No Community Members Cluster : 2.2.2.2 Originator Id : 10.10.10.10 Peer Router Id : 2.2.2.2 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 : 00h00m49s
------------------------------------------------------------------------------- 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 : 10.10.10.10 Peer Router Id : 5.5.5.5 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : PeerIP 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 : 00h00m26s
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 : 10.10.10.10 Peer Router Id : 5.5.5.5 Fwd Class : None Priority : None Flags : Valid IGP TieBreakReason : PeerIP 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 : 00h00m26s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 ===============================================================================
|
Peer IP를 비교하여 작은 쪽인 R2가 광고한 대역을 best로 잡고 있다.