BGP 13條選路原則

 if the next hop is unreachable,do not consider it. 

 
1.weight
prefer the path that has the largest weight
優先選擇高權重值的路徑
cisco私有屬性
 
2.loacl preference 
if the routes have the same weight,use the route with the highest loacl preference. 
具有相同權重值的,將選取最高優先級得路徑
the loacl preference attribute only is local to the autonomous system and does not get passed to EBGP neighbor
本地優先屬性只在本自治系統有效,不會傳遞給EBGP鄰居
 
3.originated
if the routes have same local preference,prefer the route that was originated by BGP on this router.
優選從本地路由器使發的路由,包括本地network,redistribute和IGP已有的路由,有BGP配置的聚合地址也包括在內。
 
4,AS Path 
if no route was originated,prefer the route with the shortest AS path 
 
5,origin code 
if all paths are of the same as length,prefer the route with lowest origin code(IGP < EGP < incomplete)
EGP已經不在使用
 
6,MED
if the origin codes are the same,prefer the path with the lowest multi exit dicriminator(多路徑入口,主要影響入站流量)
the MED is exchanged between ASs;however,the MED that comes into an AS does not leave.
the MED can be used to influence the outbound decision of another AS.the lower the MED,the more preferred the route.
MED只在相同AS的情況下才對比,默認情況下不同的AS路由是進行MED對比的。
MED通告規則:
1,ebgp在發佈從ibgp學來的路由時,會清除MED的值。如果想強制通告,可以在宣告的路由上使用"set metric-type internal"
2,如果使用network或redistribute命令將來自IGP的路由通告到BGP中,那麼BGP的MED是從IGP的metric導出的。
3,如果是aggregate-address命令注入路由,BGP的MED不被設置。
 
7,External paths over internal paths
if the MEDs are the same,prefer external paths over internal paths.
EBGP > confederation > IBGP 
 
8.The path through the closest IGP neighbor 
if they are still the same,prefer the path through the closest IGP neighbor 
優先選取BGP下一條具有最低IGP度量值的路徑
 
9. Multiple paths
Determine if multiple paths require installation in the routing table for BGP Multipath.
如果配置了“maximum-path N”。而且從同一個AS的對等體收到多條外部路由,側可以將N條路由加入到路由表中,使EBGP負載分擔。
N最大不能超過6;沒有配置此命令是,默認是1。可以通過“sh ip bgp X.X.X.X”來查看最優的路徑,這個最優是按接收時間來定的。
在這條最優路由轉發到內部對等體之前,需要執行與“next-hop-self”一樣的功能。
 
10. Prefer the path that was received first
When both paths are external, prefer the path that was received first (the oldest one)。
這可以使路由抖動重新收斂的影響降到最低,因爲新的路徑不會取代老的路徑。
 
11. BGP Router ID
If they are still the same, prefer the path with the lowest BGP Router ID.
 
12. Cluster-ID
如果從路由反射器學到,優選最小Cluster-ID的路由。
 
13. Peer Adress
優選具有最低對等體地址的路由。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章