1. 程式人生 > >BGP路徑屬性與選路原則

BGP路徑屬性與選路原則

目錄  路徑屬性

1.定義

2.分類 

3.GNS3實驗分析路徑屬性

4.點選連結檢視路由屬性實驗詳解

5.BGP按照如下順序選擇一條沒有環路並且可用的路由

 


 

路徑屬性

1.定義

路徑屬性:path attributes,作用類似有metric,用於度量BGP的路由優劣(用來進行選路)

 

2.分類 

公認強制屬性:所有的BGP的updata訊息都要包含該屬性

>>>AS路徑(AS-path)

>>>下一跳(next-hop)

>>>起源(origin)

公認自由屬性:該屬性是可選可不選的,但是所有的BGP程序都能識別

>>>本地優先順序(local preferent)

可選傳遞屬性:即使BGP程序不能識別該屬性,也會繼續傳遞下去

>>>團體屬性(community)

可選非傳遞屬性:如果BGP程序不能識別該屬性,可以忽略這條updata,並且不傳遞下去

 >>>MED

 

 

3.GNS3實驗分析路徑屬性

實驗目的:通過修改bgp路徑屬性(as-path、next-hop、origin、local preferent、MED)來修改bgp的選路

 

 

4.點選連結檢視路由屬性實驗詳解

as-path 實驗分析

next-hop 實驗分析

origin 實驗分析

local preference 實驗分析

MED 實驗分析

weight 實驗分析

 

 

  5.BGP按照如下順序選擇一條沒有環路並且可用的路由:

  1. 權重:Prefer highest weight (local to router).
  2. 本地優先順序:Prefer highest local preference (global within AS).
  3. 起源於本地:Prefer route originated by the local router (next hop = 0.0.0.0)
  4. 最短AS路徑:Prefer shortest AS path.
  5. 最低的起源屬性:Prefer lowest origin code (IGP < EGP < incomplete).
  6. 最低的MED:Prefer lowest MED.
  7. EBGP優於IBGP:Prefer EBGP path over IBGP path.
  8. 最近的IGP鄰居:Prefer the path through the closest IGP neighbor.
  9. 生存最長的路由:Prefer oldest route for EBGP paths.
  10. 最低的router-id:Prefer the path with the lowest neighbor BGP router ID.
  11. 最低的IP地址:Prefer the path with the lowest neighbor IP address.