Reference
https://www.practicalnetworking.net/stand-alone/bgp-oldest-path/

BGP_Path
# 決定BGP選擇路徑的優先順序
# 分成上下兩半部來記憶,1~6表上都很明顯能認出
# *> : 選擇的最佳路徑
1. weight : (對應圖片Weight,沒寫就預設0)
cisco專屬, 預設0 > 大的優先
2. local preference : (對應圖片LocPrf,沒寫就預設100)
預設 100 > 大的優先
3. self-originate : (對應圖片next hop 0.0.0.0)
本機產生路由
4. AS_PATH : (對應圖片Path)
短的優先
5. origin_codes : (對應圖片Path後面i ?)
i > e > ?,i是network,?是redistribute
6. MED : (對應圖片Metric)
相同AS才比較 > 小的優先
==
7. BGP AD : (show ip route bgp > [20/0]是eBGP,[200/0]是iBGP)
eBGP優先於iBGP,AD值20優先於200。
8. IGP cost : (show ip route > [200/0]的0,前面是AD 後面是cost)
IGP cost小的優先
9. eBGP Peering : (詳見Reference,看不到)
存活久的優先,新的路徑出現 > 1~8都一樣,那會保留舊的路徑
10. lowest RID : (show ip bgp neighbors 192.168.1.1)
RID小的優先
11. lowest neighbor IP : (show ip bgp summary > Neighbor)
Neighbor IP小的優先
Check
# 1 2 3 4 5 6
show ip bgp
# 7 8
show ip route bgp
# ※9
show ip bgp neighbor > Up/down
不是peer的存活時間,而是session的存活時間
> 最後一次成功進入 Established 狀態後,維持了多久沒有被 reset
# 10
show ip bgp neighbors 192.168.1.1
> BGP neighbor is 192.168.1.1, remote router ID 1.1.1.1
# 11
show ip bgp summary
# 檢測最優路徑指令
show ip bgp 192.168.1.0/24 best-path-reason