5. EBGP peer > IBGP peer
*A:R6>config>router>bgp# 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 next-hop 30.1.1.3 exit exit
*A:R6>config>router>bgp# *A:R6>config>router>bgp# info ---------------------------------------------- min-route-advertisement 1 export "upper" router-id 10.10.10.10 next-hop-resolution use-bgp-routes exit group "Uplink" family ipv4 neighbor 5.5.5.5 local-as 4766 peer-as 4766 exit exit no shutdown
|
*A:R7>config>router# show router policy "upper" entry 10 from protocol static tag 100 exit to protocol bgp exit action accept origin igp next-hop 30.1.1.4 exit exit
*A:R7>config>router>bgp# info ---------------------------------------------- min-route-advertisement 1 export "upper" local-as 4766 router-id 10.10.10.10 next-hop-resolution use-bgp-routes exit group "Uplink" family ipv4 neighbor 5.5.5.5 local-as 4768 peer-as 4766 exit exit no shutdown ----------------------------------------------
|
서로 다른 as로 부터 들어온 정보라는 기준을 맞추기 위해
as-path-pretend를 각각 같은 as를 붙여서 확인해 보면
R5 - R6 간 IBGP(AS4766)
R5 - R7 간 eBGP(AS4768) 관계일 때,
R5에서 bgp routes를 확인해 보면,
*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 100 30.1.1.3 None - No As-Path *i 20.1.11.0/24 None 100 7.7.7.7 None - 4768 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
위와 같이 iBGP로의 경로가 as-path때문에 우선됨을 알 수 있다.
R7 같은 경웅는 eBGP 관계이기 때문에 as-path가 찍혀있는 반면
ibgp인 R6은 같은 AS이기 때문에 No As-Path가 찍혀있어 TieBreakReason은 as-path로 인해
iBGP인 경로가 우선시 되는 것을 알 수 있다.
그렇기 때문에 iBGP관계인 R6에 as-prefend를 붙여 iBGP, eBGP간 as 정보를 R5에게 광고하게
테스트 해보면
*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 None 100 7.7.7.7 None - 4768 *i 20.1.11.0/24 100 100 30.1.1.3 None - 500 ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
20.1.11.0/24 NH 7.7.7.7인 eBGP경로가 best 경로로 잡는 것을 확인할 수 있으며 detail 정보를 확인해보면
이유를 알 수 있다.
*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 : 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 : 100 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 : Used Valid Best IGP Route Source : External AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h06m59s
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 : 100 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 : Used Valid Best IGP Route Source : External AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h07m00s
------------------------------------------------------------------------------- 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 : 100 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 : Valid IGP TieBreakReason : EBGPRoute 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 : 00h10m28s
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 : 100 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 : Valid IGP TieBreakReason : EBGPRoute 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 : 00h10m28s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
ㅁ 4번, 5번 비교
R2와 R5에서 best 경로로 잡은 거를 확인해 보면,
A:R2>config>router# 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# 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 : 11h16m26s
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 : 11h16m26s
------------------------------------------------------------------------------- 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 : 11h16m19s
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 : 11h16m20s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 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 None None 7.7.7.7 None - 4768 *i 20.1.11.0/24 100 None 30.1.1.3 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 : 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 : Used Valid Best IGP Route Source : External AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m43s
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 : Used Valid Best IGP Route Source : External AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h03m44s
------------------------------------------------------------------------------- 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 : Valid IGP TieBreakReason : EBGPRoute 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 : 00h03m47s
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 : Valid IGP TieBreakReason : EBGPRoute 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 : 00h03m48s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
R1에서 확인해보면,
*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 7.7.7.7 None - 4768 *i 20.1.11.0/24 100 100 30.1.1.1 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 : 7.7.7.7 Path Id : None From : 5.5.5.5 Res. Nexthop : 10.1.21.1 Local Pref. : 100 Interface Name : Te1/1/2 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 : 5.5.5.5 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h13m18s
Modified Attributes
Network : 20.1.11.0/24 Nexthop : 7.7.7.7 Path Id : None From : 5.5.5.5 Res. Nexthop : 10.1.21.1 Local Pref. : 100 Interface Name : Te1/1/2 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 : 5.5.5.5 Fwd Class : None Priority : None Flags : Used Valid Best IGP Route Source : Internal AS-Path : 4768 Route Tag : 0 Neighbor-AS : 4768 Orig Validation: NotFound Source Class : 0 Dest Class : 0 Add Paths Send : Default Last Modified : 00h13m18s
------------------------------------------------------------------------------- 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 : NHCost 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 : 11h44m04s
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 : NHCost 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 : 11h44m04s
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Routes : 2 =============================================================================== |
TieBreakReason : NHCost인 이유는
*A:R1# show router isis routes
=============================================================================== Rtr Base ISIS Instance 0 Route Table =============================================================================== Prefix[Flags] Metric Lvl/Typ Ver. SysID/Hostname NextHop MT AdminTag/SID[F] ------------------------------------------------------------------------------- 1.1.1.1/32 0 2/Int. 12 R1 0.0.0.0 0 0 2.2.2.2/32 10 2/Int. 32 R2 10.1.11.2 0 0 3.3.3.3/32 20 2/Int. 45 R2 10.1.11.2 0 0 4.4.4.4/32 20 2/Int. 45 R2 10.1.11.2 0 0 5.5.5.5/32 10 2/Int. 37 R5 10.1.21.1 0 0 6.6.6.6/32 20 2/Int. 45 R5 10.1.21.1 0 0 7.7.7.7/32 20 2/Int. 45 R5 10.1.21.1 0 0 10.1.11.0/24 10 2/Int. 31 R1 0.0.0.0 0 0 10.1.12.0/24 20 2/Int. 32 R2 10.1.11.2 0 0 10.1.13.0/24 20 2/Int. 36 R2 10.1.11.2 0 0 10.1.21.0/24 10 2/Int. 33 R1 0.0.0.0 0 0 10.1.22.0/24 20 2/Int. 37 R5 10.1.21.1 0 0 10.1.23.0/24 20 2/Int. 37 R5 10.1.21.1 0 0 30.1.1.0/24 21 2/Int. 45 R2 10.1.11.2 0 300 ------------------------------------------------------------------------------- No. of Routes: 14 |
R1기준으로 받은 2개의 bgp 정보의 igp next-hop cost 값이 20 > 21 이기 때문에
next-hpodl 30.1.1.0/24인 정보가 best 경로가 된다.
R5쪽 경로가 우선되는 것을 확인할 수 있습니다.
'Network' 카테고리의 다른 글
[BGP] best path selection_9 (0) | 2020.12.06 |
---|---|
[BGP] best path selection_7 (0) | 2020.12.06 |
[BGP] best path selection_4 (0) | 2020.12.06 |
[BGP] best path selection_3 (0) | 2020.12.06 |
[BGP] best path selection_2 (0) | 2020.12.06 |