• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

08-Segment Routing配置指導

目錄

02-SR-TE Policy配置

本章節下載 02-SR-TE Policy配置  (667.45 KB)

02-SR-TE Policy配置

  錄

1 SR-MPLS TE Policy

1.1 SR-MPLS TE Policy簡介

1.1.1 SR-MPLS TE Policy基本概念

1.1.2 SR-MPLS TE Policy創建方式

1.1.3 SR-MPLS TE Policy有效性

1.1.4 SR-MPLS TE Policy選路原則

1.1.5 SR-MPLS TE Policy轉發過程

1.1.6 SR-MPLS TE Policy引流

1.1.7 SR-MPLS TE Policy CBTS

1.1.8 SR-MPLS TE Policy與BFD聯動

1.1.9 SR-MPLS TE Policy熱備份功能

1.2 SR-MPLS TE Policy配置任務簡介

1.3 配置SID列表

1.4 創建SR-MPLS TE Policy

1.5 配置SR-MPLS TE Policy屬性

1.6 創建候選路徑並引用SID列表

1.7 配置BGP發布BGP IPv4 SR Policy路由

1.7.1 配置限製和指導

1.7.2 開啟BGP發布BGP IPv4 SR Policy路由能力

1.7.3 配置BGP引入BGP IPv4 SR Policy路由

1.7.4 控製BGP IPv4 SR Policy路由的優選和發布

1.7.5 維護BGP會話

1.8 配置SR-MPLS TE Policy引流

1.8.1 配置基於Color引流

1.8.2 配置基於隧道策略引流

1.8.3 配置基於DSCP引流

1.8.4 配置基於靜態路由引流

1.8.5 配置基於隧道迭代器引流

1.9 開啟SR-MPLS TE Policy的SBFD功能

1.10 開啟SR-MPLS TE Policy的echo報文方式的BFD檢測功能

1.11 開啟SR-MPLS TE Policy的熱備份功能

1.12 配置SR-MPLS TE Policy延遲激活的時間

1.13 配置SR-MPLS TE Policy CBTS

1.14 配置SR-TE的流量轉發統計功能

1.15 開啟SR-MPLS TE Policy的日誌功能

1.16 SR-MPLS TE Policy顯示和維護

1.16.1 顯示BGP IPv4 SR Policy路由信息

1.16.2 顯示SR-MPLS TE Policy的配置及運行狀態

1.16.3 顯示和清除SR-TE的轉發信息

1.17 SR-MPLS TE Policy典型配置舉例

1.17.1 SR-MPLS TE Policy基本轉發配置舉例

1.17.2 SR-MPLS TE Policy通過BGP引入配置舉例

1.17.3 SR-MPLS TE Policy基於Color引流配置舉例

1.17.4 SR-MPLS TE Policy基於DSCP引流的配置舉例

 


1 SR-MPLS TE Policy

1.1  SR-MPLS TE Policy簡介

SR-MPLS TE Policy(Segment Routing Policy,段路由策略)提供了靈活的轉發路徑選擇方法,滿足用戶不同的轉發需求。當Segment Routing網絡的源節點和目的節點之間存在多條路徑時,合理利用SR-MPLS TE Policy選擇轉發路徑,不僅可以方便管理員對網絡進行管理和規劃,還可以有效地減輕網絡設備的轉發壓力。

1.1.1  SR-MPLS TE Policy基本概念

1. SR-MPLS TE Policy的標識

一個SR-MPLS TE Policy由三部分標識:

·     BSID:入節點的SID。

·     Color:轉發路徑的Color屬性,用於在相同的源和目的節點之間區分多個SR-MPLS TE Policy。

·     End-point:SR-MPLS TE Policy目的節點,可由IP地址標識。

2. Candidate Paths

Candidate Paths是指SR-MPLS TE Policy的候選路徑,SR-MPLS TE Policy中的轉發路徑。SR-MPLS TE Policy包含一條或多條候選路徑。不同SR-MPLS TE Policy不能共享同一條候選路徑。

3. Preference

Preference為候選路徑的優先級,用於在通過SR-MPLS TE Policy轉發流量時,選擇候選路徑。

4. Segment List

Segment List(SID列表)是包含報文轉發路徑信息的列表。SID列表中的SID為轉發路徑上各個節點到下一跳的SID。候選路徑由一個SID列表或者多個帶權重的SID列表組成。

5. Weight

每個SID列表對應一個Weight(權重)。SR-MPLS TE Policy選擇某條候選路徑後,會根據SID列表的Weight,在候選路徑的多個SID列表間進行負載分擔。

6. SR-MPLS TE Policy隧道

建立SR-MPLS TE Policy後,會自動創建SR-MPLS TE Policy隧道,即從部署SR-MPLS TE Policy的節點到SR-MPLS TE Policy目的節點的一條虛擬點到點連接。SR-MPLS TE Policy隧道由SRLSP構成。

7. SR-MPLS TE Policy組

一組SR-MPLS TE Policy的集合。將SR-MPLS TE Policy加入SR-MPLS TE Policy組後,可以實現通過不同的SR-MPLS TE Policy轉發不同DSCP(Differentiated Services Code Point,區分服務編碼點)的報文。

1.1.2  SR-MPLS TE Policy創建方式

SR-MPLS TE Policy可以通過如下方式創建:

·     通過命令行手工創建

采用該方式時,需要手工配置候選路徑、候選路徑的優先級、候選路徑的SID列表及其權重。

·     通過SR-MPLS TE Policy路由學習

為了支持SR-MPLS TE Policy,MP-BGP定義了新的子地址族——BGP IPv4 SR Policy地址族,並新增了NLRI(Network Layer Reachability Information,網絡層可達性信息),即BGP IPv4 SR Policy路由。BGP IPv4 SR Policy路由中包含SR-MPLS TE Policy的相關配置,包括BSID、Color、Endpoint、候選路徑優先級、SID列表和SID列表的權重等。

在設備間建立BGP IPv4 SR Policy對等體後,設備可以將本地配置的SR-MPLS TE Policy通過BGP IPv4 SR Policy路由發布到對端。對端設備根據接收到的BGP IPv4 SR Policy路由生成對應的SR-MPLS TE Policy。

1.1.3  SR-MPLS TE Policy有效性

SR-MPLS TE Policy有效性判斷規則如圖1-1所示。

圖1-1 SR-MPLS TE Policy有效性判斷示意圖

 

判斷SID列表是否有效時,存在以下情況SID列表無效:

·     SID列表為空;

·     SID列表的權重為0;

·     SR節點無法根據SID列表中的棧頂SID找到出接口或下一跳地址。

1.1.4  SR-MPLS TE Policy選路原則

數據報文引流到SR-MPLS TE Policy後,在SR-MPLS TE Policy中選擇路徑的過程為:

(1)     在SR-MPLS TE Policy中選擇優先級取值最大的有效候選路徑轉發流量。

(2)     在優先級取值最大的有效候選路徑的各個SID列表間進行WECMP(Weighted ECMP,權重負載分擔),即基於權重對通過SR-MPLS TE Policy轉發的流量進行負載分擔。SR-MPLS TE Policy中有效SID列表轉發流量的比例為Weight x/(Weight 1+Weight 2+…+Weight n)。

圖1-2所示,根據BSID選擇有效的SR-MPLS TE Policy轉發流量,再選取優先級取值最大的有效候選路徑轉發流量。該候選路徑中有兩個有效的SID列表:SID List 1和SID List 2,其權重分別為20和80。通過該SR-MPLS TE Policy轉發流量時,SID List 1和SID List 2轉發的流量占比分別為1/5和4/5。

圖1-2 SR-MPLS TE Policy轉發流量時選路過程示意圖

 

1.1.5  SR-MPLS TE Policy轉發過程

圖1-3所示,SR-MPLS TE Policy轉發過程為:

(1)     Device A收到棧頂標簽為16001的報文後,查找LFIB(Label Forwarding Information Base,標簽轉發信息庫)表判斷該標簽為BSID,需要根據SR-MPLS TE Policy轉發該報文。Device A根據LFIB表獲取出標簽和下一跳(Device B),將BSID彈出並壓入SID列表的標簽棧{20002, 21003, 22004},然後將報文發送給Device B。其中,20002為Device A到達Device B的SID;21003為Device B到達Device C的SID;22004為Device C到達Device D的SID。

(2)     Device B收到報文後查找LFIB表,根據入標簽獲取到下一跳為Device C,將報文發送給Device C。

(3)     Device C收到報文後查找LFIB表,根據入標簽獲取到下一跳為Device D,將報文發送給Device D。

(4)     Device D收到報文後,如果報文攜帶標簽,則查找LFIB表轉發報文;如果報文未攜帶標簽,則查找IP轉發表轉發報文。

圖1-3 SR-MPLS TE Policy轉發過程示意圖

 

1.1.6  SR-MPLS TE Policy引流

可以通過如下方式將數據報文引流到SR-MPLS TE Policy,通過SR-MPLS TE Policy轉發該報文:

·     基於BSID引流:如果接收到的報文的棧頂標簽為某個SR-MPLS TE Policy的BSID,則通過該SR-MPLS TE Policy轉發該報文。

·     基於Color引流:查找是否存在Color和Endpoint地址與BGP路由的Color擴展團體屬性和下一跳地址完全相同的SR-MPLS TE Policy。若存在,則將該BGP路由迭代到SR-MPLS TE Policy。當設備收到匹配該BGP路由的報文時,會通過SR-MPLS TE Policy轉發該報文。

·     基於隧道策略引流:MPLS L3VPN或EVPN L3VPN組網中,通過負載分擔隧道策略,可以實現用指定SR-MPLS TE Policy的路徑作為公網隧道來承載特定VPN實例的私網報文。隧道策略的詳細介紹請參見“MPLS配置指導”中的“隧道策略”。

·     基於DSCP引流:根據報文的目的地址匹配隧道綁定策略,關聯到SR-MPLS TE Policy組後,根據報文的DSCP值查找與其關聯的Color屬性,再通過Color屬性匹配到SR-MPLS TE Policy組中的某個SR-MPLS TE Policy。這樣,攜帶指定DSCP的報文可以通過指定SR-MPLS TE Policy轉發。

·     基於靜態路由引流:配置靜態路由迭代到SR-MPLS TE Policy,如果設備收到匹配該靜態路由的報文,則通過指定SR-MPLS TE Policy轉發該報文。

·     基於隧道迭代器引流:將BGP公網流量引入隧道迭代器,根據隧道迭代器應用的隧道策略,使報文通過指定隧道轉發。

1.1.7  SR-MPLS TE Policy CBTS

1. SR-MPLS TE Policy CBTS簡介

SR-MPLS TE Policy CBTS(Class-based Tunnel Selection,基於服務類型的隧道選擇)是一種SR-MPLS TE Policy隧道的選擇方式。有別於傳統的隧道選擇方式,CBTS可以基於流量的轉發類選擇對應的隧道進行轉發,以便為不同的業務提供不同的轉發服務。

2. SR-MPLS TE Policy CBTS工作原理

SR-MPLS TE Policy CBTS工作原理為:

·     對需要經過SR-MPLS TE Policy轉發的流量,通過流分類進行匹配,將不同業務的流量映射成不同的轉發類。

·     配置SR-MPLS TE Policy的轉發類(Service-class屬性),映射到指定轉發類的業務流量可以通過具有對應轉發類的SR-MPLS TE Policy隧道轉發。

3. SR-MPLS TE Policy CBTS優選規則

SR-MPLS TE Policy CBTS的優選規則為:

(1)     設備會優先選擇與流量的轉發類值相同的SR-MPLS TE Policy轉發該流量。

(2)     如果存在多條與流量的轉發類值相同的SR-MPLS TE Policy,隻有一條流且為逐流負載分擔則隨機選擇一條SR-MPLS TE Policy轉發流量;有一條流但是為逐包負載分擔或有多條流,則流量在相同轉發類的SR-MPLS TE Policy間進行負載分擔。

(3)     如果沒有與流量的轉發類值相同的SR-MPLS TE Policy,則選擇隧道優先級最低的SR-MPLS TE Policy轉發流量。SR-MPLS TE Policy轉發類的取值越小,隧道轉發的優先級越低,沒有配置轉發類的隧道優先級最低。

4. SR-MPLS TE Policy CBTS示例

圖1-4 SR-MPLS TE Policy CBTS示意圖

 

圖1-4所示,隧道的選擇原則為:

·     從Device A到Device B轉發類值為3的流量通過SR-MPLS TE Policy B轉發。

·     從Device A到Device B轉發類值為6的流量通過SR-MPLS TE Policy C轉發。

·     從Device A到Device B轉發類值為4的流量通過SR-MPLS TE Policy A轉發。

·     從Device A到Device B未配置轉發類的流量通過SR-MPLS TE Policy A轉發。

1.1.8  SR-MPLS TE Policy與BFD聯動

1. SR-MPLS TE Policy與echo BFD聯動

echo報文方式的BFD對SR-MPLS TE Policy進行檢測時,如果候選路徑中存在多個SID列表,則SR-MPLS TE Policy會建立多個BFD會話分別用來檢測每一個SID列表對應的轉發路徑。

圖1-5所示,在Device A上配置SR-MPLS TE Policy,並使用echo報文方式的BFD檢測該SR-MPLS TE Policy,檢測過程如下:

(1)     頭節點發送BFD echo報文,BFD echo報文封裝SR-MPLS TE Policy中的SID列表。

(2)     尾節點收到BFD echo報文後,通過IP路由的最短路徑將BFD echo報文轉發回頭節點。

(3)     如果頭節點在檢測時間超時前能夠收到尾節點轉發回的BFD echo報文,則認為SR-MPLS TE Policy的SID列表正常。否則,頭節點認為SID列表故障。

圖1-5 echo報文方式的BFD會話檢測SR-MPLS TE Policy

 

2. SR-MPLS TE Policy與SBFD聯動

SR-MPLS TE Policy不會通過設備之間互相發送的消息來維持自身狀態,所以SR-MPLS TE Policy路徑故障檢測需要依靠SBFD(Seamless BFD,無縫BFD)完成。通過SBFD可以快速檢測到SR-MPLS TE Policy路徑中所發生的故障。

缺省情況下,SBFD僅檢測SR-MPLS TE Policy中優先級最高的候選路徑裏的所有SID列表。

圖1-6 SR-MPLS TE Policy與SBFD聯動示意圖

 

圖1-6所示,源節點Device A開啟SR-MPLS TE Policy與SBFD聯動功能後,將End-point地址作為SBFD的遠端描述符。當SR-MPLS TE Policy中優先級最高的候選路徑裏存在多個SID列表時,會建立多個SBFD會話分別用來檢測每一個SID列表對應的轉發路徑,所有SBFD會話的遠端描述符均相同。

通過SBFD檢測SR-MPLS TE Policy路徑過程如下:

(2)     源節點Device A對外發送SBFD報文,SBFD報文封裝SR-MPLS TE Policy對應的SID列表。

(3)     尾節點Device E收到SBFD報文後,通過查找IP路由表按照最短路徑發送回應報文。

(4)     源節點Device A如果收到SBFD回應報文,則認為該SID列表對應的轉發路徑正常;否則,會認為該SID列表對應轉發路徑故障。如果一個候選路徑下所有SID列表對應的轉發路徑都發生故障,則SBFD觸發候選路徑切換。

說明

對於同一源節點和目的節點之間不同的SR-MPLS TE Policy,由於SBFD回應報文時根據IP路由表進行轉發,所以SBFD回應報文的轉發路徑是相同的。SBFD回應報文的轉發路徑故障將引起所有SBFD會話Down,進而導致無法通過SR-MPLS TE Policy轉發流量。

 

1.1.9  SR-MPLS TE Policy熱備份功能

當SR-MPLS TE Policy中存在多條有效候選路徑時,設備通過優先級最大的候選路徑轉發報文。如果該候選路徑發生故障,則SR-MPLS TE Policy需要重新選擇有效候選路徑轉發報文。由於選擇新的有效候選路徑會耗費一些時間,所以在切換轉發路徑的過程中會造成丟包,影響業務流量轉發。

SR-MPLS TE Policy的熱備份功能可以解決上述問題。SR-MPLS TE Policy的熱備份是指通過備份候選路徑對主候選路徑進行保護。如果一個SR-MPLS TE Policy下存在多條候選路徑,則優先級最高的有效候選路徑作為主路徑,優先級次高的有效候選路徑作為備份路徑。如圖1-7所示,如果主路徑下所有SID列表對應的轉發路徑都發生故障,則將流量立即切換到備份候選路徑轉發,以減少對業務的影響。

圖1-7 SR-MPLS TE Policy熱備份示意圖

 

SR-MPLS TE Policy熱備份功能和SR-MPLS TE Policy與SBFD聯動配合使用時,SBFD可以同時檢測SR-MPLS TE Policy中優先級最高和次高的兩條候選路徑裏的所有SID列表對應的轉發路徑。如果優先級最高的候選路徑裏所有SID列表對應的轉發路徑都發生故障,則將流量切換到備份路徑。當流量切換到備份路徑後,會再次重新計算主備路徑。原備份路徑將作為主路徑,並重新選擇一個有效的候選路徑作為新的備份路徑。當主備路徑同時故障時,SR-MPLS TE Policy將重新計算主備路徑。

1.2  SR-MPLS TE Policy配置任務簡介

SR-MPLS TE Policy配置任務如下:

(1)     配置通過IGP擴展通告SID

需要在所有SR節點執行本配置,配置方法請參見“Segment Routing配置指導”中的“SR-MPLS”。

(2)     配置SID列表

(3)     創建SR-MPLS TE Policy

(4)     配置SR-MPLS TE Policy屬性

(5)     創建候選路徑並引用SID列表

(6)     (可選)配置BGP發布BGP IPv4 SR Policy路由

a.     開啟BGP發布BGP IPv4 SR Policy路由能力

b.     配置BGP引入BGP IPv4 SR Policy路由

c.     (可選)控製BGP IPv4 SR Policy路由的優選和發布

d.     (可選)維護BGP會話

(7)     (可選)配置SR-MPLS TE Policy引流

(8)     (可選)配置SR-MPLS TE Policy高可靠性

¡     開啟SR-MPLS TE Policy的SBFD功能

¡     開啟SR-MPLS TE Policy的echo報文方式的BFD檢測功能

¡     開啟SR-MPLS TE Policy的熱備份功能

¡     配置SR-MPLS TE Policy延遲激活的時間

(9)     (可選)配置SR-MPLS TE Policy CBTS

(10)     (可選)配置SR-TE的流量轉發統計功能

(11)     (可選)開啟SR-MPLS TE Policy的日誌功能

1.3  配置SID列表

1. 功能簡介

在SID列表中添加節點後,報文中的標簽棧從棧頂到棧底按照節點索引值從小到大排列。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     創建SR-TE,並進入SR-TE視圖。

traffic-engineering

(4)     創建SID列表,並進入SID列表視圖。

segment-list segment-list-name

(5)     在SID列表中添加節點。

index index-number mpls label label-value

1.4  創建SR-MPLS TE Policy

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     創建SR-TE,並進入SR-TE視圖。

traffic-engineering

(4)     創建SR-MPLS TE Policy,並進入SR-MPLS TE Policy視圖。

policy policy-name

1.5  配置SR-MPLS TE Policy屬性

1. 功能簡介

SR-MPLS TE Policy由BSID(入標簽)、Color和End point(目的節點IP地址)標識。

每個SR-MPLS TE Policy需要綁定一個BSID,設備收到棧頂標簽為BSID的報文後,根據BSID選擇對應的有效SR-MPLS TE Policy轉發流量。

BSID獲取方式如下:

·     手工配置。

·     動態獲取:SR-MPLS TE Policy下僅配置Color和End-point時,SR-MPLS TE Policy會自動申請一個BSID。

手工配置優先生效。

2. 配置限製和指導

配置BSID為MPLS標簽時,如果該標簽值不在SRGB和SRLB範圍內,或者該標簽值已經被其他協議占用,則配置不生效。有關SRGB和SRLB的詳細描述,請參見“Segment Routing配置指導”中的“SR-MPLS”。

不同SR-MPLS TE Policy不能配置相同Color,但可以配置相同的End-point。

3. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     創建SR-TE,並進入SR-TE視圖。

traffic-engineering

(4)     進入SR-MPLS TE Policy視圖。

policy policy-name

(5)     手工配置BSID。

binding-sid mpls mpls-label

(6)     配置Color和End-point。

color color-value end-point ipv4 ipv4-address

1.6  創建候選路徑並引用SID列表

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     進入SR-MPLS TE Policy視圖。

policy policy-name

(5)     創建SR-MPLS TE Policy候選路徑,並進入SR-MPLS TE Policy候選路徑視圖。

candidate-paths

(6)     配置候選路徑的優先級,並進入SR-MPLS TE Policy候選路徑優先級視圖。

preference preference-value

缺省情況下,未配置SR-MPLS TE Policy候選路徑的優先級。

不同的優先級代表不同的候選路徑。

(7)     為指定優先級的SR-MPLS TE Policy候選路徑配置顯式SID列表。

explicit segment-list segment-list-name [ weight weight-value ]

每條候選路徑可以引用多個SID列表。

1.7  配置BGP發布BGP IPv4 SR Policy路由

1.7.1  配置限製和指導

BGP相關命令的詳細介紹,請參見“三層技術-IP路由命令參考”中的“BGP”。

1.7.2  開啟BGP發布BGP IPv4 SR Policy路由能力

(1)     進入係統視圖。

system-view

(2)     配置全局Router ID。

router id router-id

缺省情況下,未配置全局Router ID。

(3)     啟動BGP實例,並進入BGP實例視圖。

bgp as-number [ instance instance-name ]

缺省情況下,係統沒有運行BGP。

(4)     配置對等體。

peer { group-name | ipv4-address [ mask-length ] } as-number as-number

(5)     創建BGP IPv4 SR Policy地址族,並進入BGP IPv4 SR Policy地址族視圖。

address-family ipv4 sr-policy

(6)     使能本地路由器與指定對等體/對等體組交換BGP IPv4 SR Policy路由的能力。

peer { group-name | ipv4-address [ mask-length ] } enable

缺省情況下,本地路由器不能與對等體/對等體組交換BGP IPv4 SR Policy路由。

1.7.3  配置BGP引入BGP IPv4 SR Policy路由

1. 功能簡介

通過配置本功能,設備可以將本地的BGP IPv4 SR Policy路由引入到BGP路由表中,並將BGP IPv4 SR Policy路由發布給IBGP對等體,以便對等體根據BGP IPv4 SR Policy轉發流量。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入BGP實例視圖。

bgp as-number [ instance instance-name ]

(3)     進入BGP IPv4 SR Policy地址族視圖。

address-family ipv4 sr-policy

(4)     將BGP IPv4 SR Policy路由引入到BGP路由表中。

import-route sr-policy

缺省情況下,BGP不會引入BGP IPv4 SR Policy路由。

1.7.4  控製BGP IPv4 SR Policy路由的優選和發布

(1)     進入係統視圖。

system-view

(2)     進入BGP實例視圖。

bgp as-number [ instance instance-name ]

(3)     進入BGP IPv4 SR Policy地址族視圖。

address-family ipv4 sr-policy

(4)     配置向對等體/對等體組發布路由時,將下一跳屬性修改為自身的地址。

peer { group-name | ipv4-address [ mask-length ] } next-hop-local

缺省情況下,向EBGP對等體/對等體組發布路由時,將下一跳屬性修改為自身的地址;向IBGP對等體/對等體組發布路由時,不修改下一跳屬性。

(5)     配置對於從對等體/對等體組接收的BGP消息,允許本地AS號在該消息的AS_PATH屬性中出現,並配置允許出現的次數。

peer { group-name | ipv4-address [ mask-length ] } allow-as-loop [ number ]

缺省情況下,不允許本地AS號在接收消息的AS_PATH屬性中出現。

(6)     為從對等體/對等體組接收的路由分配首選值。

peer { group-name | ipv4-address [ mask-length ] } preferred-value value

缺省情況下,從對等體/對等體組接收的路由的首選值為0。

(7)     配置允許從對等體/對等體組接收的路由的最大數量。

peer { group-name | ipv4-address [ mask-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

缺省情況下,不限製從對等體/對等體組接收的路由數量。

(8)     配置本機作為路由反射器,對等體/對等體組作為路由反射器的客戶機。

peer { group-name | ipv4-address [ mask-length ] } reflect-client

缺省情況下,沒有配置路由反射器及其客戶機。

(9)     為對等體/對等體組設置基於IPv4地址前綴列表的路由發布和接收過濾策略。

peer { group-name | ipv4-address [ mask-length ] } prefix-list ipv4-prefix-list-name { export | import }

缺省情況下,不對發布和接收的路由信息進行過濾。

(10)     對來自對等體/對等體組的路由或發布給對等體/對等體組的路由應用路由策略。

peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name { export | import }

缺省情況下,沒有為對等體/對等體組指定路由策略。

(11)     配置向對等體/對等體組發布團體屬性。

peer { group-name | ipv4-address [ mask-length ] } advertise-community

缺省情況下,不向對等體/對等體組發布團體屬性。

(12)     配置向對等體/對等體組發布擴展團體屬性。

peer { group-name | ipv4-address [ mask-length ] } advertise-ext-community

缺省情況下,不向對等體/對等體組發布擴展團體屬性。

1.7.5  維護BGP會話

請在用戶視圖下執行如下命令,複位或軟複位BGP會話。

·     複位BGP IPv4 SR Policy地址族下的BGP會話。

reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | all | external | group group-name | internal } ipv4 sr-policy

·     手工對BGP IPv4 SR Policy地址族下的BGP會話進行軟複位。

refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | all | external | group group-name | internal } { export | import } ipv4 sr-policy

1.8  配置SR-MPLS TE Policy引流

1.8.1  配置基於Color引流

(1)     進入係統視圖。

system-view

(2)     進入路由策略視圖。

route-policy route-policy-name { deny | permit } node node-number

(3)     配置BGP路由的Color擴展團體屬性。

apply extcommunity color color [ additive ]

缺省情況下,未配置BGP路由屬性。

(4)     退回係統視圖。

quit

(5)     進入BGP實例視圖。

bgp as-number [ instance instance-name ]

(6)     進入BGP IPv4單播地址族視圖、BGP IPv6單播地址族視圖、BGP VPNv4地址族視圖或BGP VPNv6地址族視圖。

¡     進入BGP IPv4單播地址族視圖。

address-family ipv4 [ unicast ]

¡     進入BGP IPv6單播地址族視圖。

address-family ipv6 [ unicast ]

¡     進入BGP VPNv4地址族視圖。

address-family vpnv4

¡     進入BGP VPNv6地址族視圖。

address-family vpnv6

(7)     對來自對等體/對等體組的路由或發布給對等體/對等體組的路由應用路由策略。

peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name { export | import }

缺省情況下,沒有為對等體/對等體組指定路由策略。

1.8.2  配置基於隧道策略引流

(1)     進入係統視圖。

system-view

(2)     創建隧道策略,並進入隧道策略視圖。

tunnel-policy tunnel-policy-name [ default ]

(3)     配置SR-MPLS TE Policy隧道的負載分擔策略。

select-seq sr-policy load-balance-number number

缺省情況下,未配置負載分擔策略。

本命令的詳細描述,請參見“MPLS命令參考”中的“隧道策略”。

(4)     退回係統視圖。

quit

(5)     進入VPN實例視圖、VPN實例IPv4地址族視圖或VPN實例IPv6地址族視圖。

¡     進入VPN實例視圖。

ip vpn-instance vpn-instance-name

¡     請依次執行以下命令進入VPN實例IPv4地址族視圖。

ip vpn-instance vpn-instance-name

address-family ipv4

¡     請依次執行以下命令進入VPN實例IPv6地址族視圖。

ip vpn-instance vpn-instance-name

address-family ipv6

(6)     配置VPN實例的隧道策略。

tnl-policy tunnel-policy-name

缺省情況下,未配置VPN實例的隧道策略。

本命令的詳細描述,請參見“MPLS命令參考”中的“MPLS L3VPN”。

1.8.3  配置基於DSCP引流

1. 功能簡介

SR-MPLS TE Policy組中不同SR-MPLS TE Policy的Color屬性不同。配置Color與DSCP的映射關係後,在一個SR-MPLS TE Policy組內,可以形成DSCP->Color->SR-MPLS TE Policy的映射關係,從而實現通過IP報文的DSCP值將報文引流到指定的SR-MPLS TE Policy。

2. 配置限製和指導

隻有SR-MPLS TE Policy有效時,才能將其Color值與DSCP關聯。

IPv4和IPv6地址族可以分別指定Color與DSCP的映射關係,但是對於同一個地址族的報文,每個DSCP值僅支持關聯一個Color值。

可以通過color match dscp default命令來配置某個SR-MPLS TE Policy作為指定地址族報文的缺省SR-MPLS TE Policy。當SR-MPLS TE Policy組內某個DSCP沒有關聯到SR-MPLS TE Policy時,可以使用該缺省SR-MPLS TE Policy轉發報文。一個SR-MPLS TE Policy組內,一個地址族隻能有一個缺省SR-MPLS TE Policy。

當設備收到未匹配SR-MPLS TE Policy組內Color和DSCP映射關係的IPv4/IPv6地址族報文時,依次按照如下原則選擇報文轉發方式:

(1)     如果本地址族已配置缺省的SR-MPLS TE Policy,且該SR-MPLS TE Policy有效,則采用該SR-MPLS TE Policy轉發報文。

(2)     如果本地址族已配置未匹配Color和DSCP映射關係的報文采用SR-BE轉發,且SR-BE有效,則采用SR-BE 轉發報文。

(3)     如果另一地址族已配置缺省的SR-MPLS TE Policy,且該SR-MPLS TE Policy有效,則采用該SR-MPLS TE Policy轉發報文。

(4)     如果另一地址族已配置未匹配Color和DSCP映射關係的報文采用SR-BE轉發,且SR-BE有效,則采用SR-BE 轉發報文。

(5)     如果本地址族下配置了Color和DSCP映射關係,且最小DSCP對應的SR-MPLS TE Policy有效,則采用該SR-MPLS TE Policy轉發。

(6)     如果另一地址族下配置了Color和DSCP映射關係,且最小DSCP對應的SR-MPLS TE Policy有效,則采用該SR-MPLS TE Policy轉發。

3. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     創建SR TE,並進入SR TE視圖。

traffic-engineering

(4)     創建SR-MPLS TE Policy組,並進入SR-MPLS TE Policy組視圖。

policy-group group-id

(5)     配置SR-MPLS TE Policy組的目的節點地址。

end-point ipv4 ipv4-address

缺省情況下,未配置SR-MPLS TE Policy組的目的節點地址。

加入到SR-MPLS TE Policy組的SR-MPLS TE Policy的目的節點地址必須與該SR-MPLS TE Policy組的目的節點地址相同。

(6)     配置SR-MPLS TE Policy組的Color和DSCP映射關係。

color color-value match dscp { ipv4 | ipv6 } dscp-value-list

color color-value match dscp { ipv4 | ipv6 } default

缺省情況下,未配置SR-MPLS TE Policy組的Color和DSCP映射關係。

未配置Color和DSCP映射關係時,無法根據報文的DSCP值進行引流。

(7)     (可選)配置對於未匹配Color和DSCP映射關係的報文采用SR-BE轉發。

best-effort { ipv4 | ipv6 } default

缺省情況下,對於未匹配Color和DSCP映射關係的報文不采用SR-BE轉發。

(8)     退回係統視圖。

quit

(9)     創建隧道策略,並進入隧道策略視圖。

tunnel-policy tunnel-policy-name [ default ]

(10)     配置隧道綁定策略,指定目的地址與SR-MPLS TE Policy組綁定。

binding-destination dest-ip-address sr-policy group sr-policy-group-id [ ignore-destination-check ] [ down-switch ]

缺省情況下,未將目的IP地址與任何隧道綁定。

本命令的詳細描述,請參見“MPLS命令參考”中的“隧道策略”。

1.8.4  配置基於靜態路由引流

1. 配置限製和指導

配置本功能後,需要在公網實例IPv4地址族下使用route-replicate命令將指定VPN實例的路由信息引入到公網中,從而使公網獲取指定VPN的路由,以便轉發用戶流量。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     配置靜態路由迭代到指定SR-MPLS TE Policy。

(公網)

ip route-static dest-address { mask-length | mask } sr-policy policy-name [ preference preference ] [ tag tag-value ] [ description text ]

(VPN網絡)

ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } sr-policy policy-name [ preference preference ] [ tag tag-value ] [ description text ]

缺省情況下,未配置靜態路由。

本命令的詳細描述,請參見“三層技術-IP路由命令參考”中的“靜態路由”。

1.8.5  配置基於隧道迭代器引流

1. 配置準備

部署隧道迭代器,有關隧道迭代器的詳細描述,請參見“MPLS配置指導”中的“隧道迭代器”。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入BGP實例視圖。

bgp as-number [ instance instance-name ]

(3)     進入BGP IPv4單播地址族視圖。

address-family ipv4 [ unicast ]

(4)     應用隧道迭代器。

apply tunnel-selector tunnel-selector-name [ all ]

缺省情況下,未應用隧道迭代器。

1.9  開啟SR-MPLS TE Policy的SBFD功能

1. 配置限製和指導

SR TE視圖和SR-MPLS TE Policy視圖下均可以配置SR-MPLS TE Policy的SBFD功能。SR TE視圖的配置對所有SR-MPLS TE Policy都有效,而SR-MPLS TE Policy視圖的配置隻對當前SR-MPLS TE Policy有效。對於一個SR-MPLS TE Policy來說,優先采用該SR-MPLS TE Policy內的配置,隻有該SR-MPLS TE Policy內未進行配置時,才采用SR TE視圖的配置。

使用SBFD檢測SR-TE Policy的連通性時,建議SR-TE Policy的候選路徑下隻存在單路徑,避免SBFD會話震蕩。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     開啟所有SR-MPLS TE Policy的SBFD功能。

sr-policy sbfd enable

缺省情況下,所有SR-MPLS TE Policy的SBFD功能處於關閉狀態。

(5)     進入SR-MPLS TE Policy視圖。

policy policy-name

(6)     配置SR-MPLS TE Policy的SBFD功能。

sbfd { disable | enable }

缺省情況下,未配置SR-MPLS TE Policy的SBFD功能。

1.10  開啟SR-MPLS TE Policy的echo報文方式的BFD檢測功能

1. 軟件版本適配關係

僅R5111及以上版本支持本功能。

2. 配置限製和指導

SR-TE視圖和SR-MPLS TE Policy視圖下均可以配置SR-MPLS TE Policy的echo報文方式的BFD檢測功能。SR-TE視圖的配置對所有SR-MPLS TE Policy都有效,而SR-MPLS TE Policy視圖的配置隻對當前SR-MPLS TE Policy有效。對於一個SR-MPLS TE Policy來說,優先采用該SR-MPLS TE Policy內的配置,隻有該SR-MPLS TE Policy內未進行配置時,才采用SR-TE視圖的配置。

目前,支持通過BFD echo報文和SBFD兩種方式檢測SR-MPLS TE Policy。在同一SR-MPLS TE Policy下同時配置以上兩種檢測方式時,SBFD檢測生效。

配置本功能後,如果沒有在係統視圖下配置bfd echo-source-ip命令,則BFD echo報文的源IP地址和目的IP地址均為source-ip參數指定的IP地址。為了避免對端發送大量的ICMP重定向報文造成網絡擁塞,需要在係統視圖下通過bfd echo-source-ip命令將BFD echo報文的源IP地址配置為不屬於本地設備該設備任何一個接口所在網段的地址。

通過本功能配置的源IP地址必須在遠端設備上路由可達,否則無法建立BFD會話。

3. 配置步驟

(1)     進入係統視圖。

system-view

(2)     配置BFD echo報文的源IP地址。

bfd echo-source-ip ip-address

缺省情況下,未配置BFD echo報文的源IP地址。

echo報文的源IP地址用戶可以任意指定。建議配置echo報文的源IP地址不屬於該設備任何一個接口所在網段。

本命令的詳細情況請參見“可靠性命令參考”中的“BFD”。

(3)     進入Segment Routing視圖。

segment-routing

(4)     進入SR-TE視圖。

traffic-engineering

(5)     全局開啟SR-MPLS TE Policy的echo報文方式的BFD檢測功能。

sr-policy bfd echo source-ip ipv4-address [ template template-name ] [ backup-template backup-template-name ]

缺省情況下,SR-MPLS TE Policy的echo報文方式的BFD檢測功能處於關閉狀態。

(6)     進入SR-MPLS TE Policy視圖。

policy policy-name

(7)     配置SR-MPLS TE Policy的echo報文方式的BFD檢測功能。

bfd echo { disable | enable [ source-ip ipv4-address ] [ template template-name ] [ backup-template backup-template-name ] }

缺省情況下,未配置SR-MPLS TE Policy的echo報文方式的BFD檢測功能,以SR-TE視圖下的配置為準。

如果配置本命令時未指定source-ip參數時,則必須在SR-TE視圖開啟SR-MPLS TE Policy的echo BFD功能,否則無法建立BFD會話。

1.11  開啟SR-MPLS TE Policy的熱備份功能

1. 配置限製和指導

SR TE視圖和SR-MPLS TE Policy視圖下均可以配置SR-MPLS TE Policy的熱備份功能。SR TE視圖的配置對所有SR-MPLS TE Policy都有效,而SR-MPLS TE Policy視圖的配置隻對當前SR-MPLS TE Policy有效。對於一個SR-MPLS TE Policy來說,優先采用該SR-MPLS TE Policy內的配置,隻有該SR-MPLS TE Policy內未進行配置時,才采用SR TE視圖的配置。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     開啟所有SR-MPLS TE Policy的熱備份功能。

sr-policy backup hot-standby enable

缺省情況下,所有SR-MPLS TE Policy的熱備份功能處於關閉狀態。

(5)     進入SR-MPLS TE Policy視圖。

policy policy-name

(6)     配置SR-MPLS TE Policy的熱備份功能。

backup hot-standby { disable | enable }

缺省情況下,未配置SR-MPLS TE Policy的熱備份功能。

1.12  配置SR-MPLS TE Policy延遲激活的時間

1. 功能簡介

當SR-MPLS TE Policy故障恢複時,為了避免SR-MPLS TE Policy頻繁震蕩導致丟包,可以配置本功能,使SR-MPLS TE Policy延遲激活,即延遲一段時間再使用該SR-MPLS TE Policy轉發流量,以確保SR-MPLS TE Policy的故障徹底消除。

配置本功能後,需要根據SR-MPLS TE Policy的SBFD功能的配置情況,啟動不同類型的延遲激活定時器:

·     LSP類型定時器:未開啟SBFD功能,且SID列表狀態由Down變為Up時,啟動LSP類型定時器。

·     SBFD類型定時器:開啟SBFD功能,且SBFD會話狀態由Down變為Up時,啟動SBFD類型定時器。

2. 配置限製和指導

可以通過display segment-routing te policy命令查看SBFD功能配置情況、SID列表狀態和SBFD會話狀態。

請根據網絡規模合理配置SR-MPLS TE Policy延遲激活的時間,避免故障消除後SR-MPLS TE Policy長時間無法處理用戶流量。

SR-TE視圖和SR-MPLS TE Policy視圖下均可以配置SR-MPLS TE Policy的延遲UP時間。SR-TE視圖的配置對所有SR-MPLS TE Policy都有效,而SR-MPLS TE Policy視圖的配置隻對當前SR-MPLS TE Policy有效。對於一個SR-MPLS TE Policy來說,優先采用該SR-MPLS TE Policy內的配置,隻有該SR-MPLS TE Policy內未進行配置時,才采用SR-TE視圖的配置。

配置本功能後,對於已處於延遲激活的SR-MPLS TE Policy不受影響。

3. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     配置SR-MPLS TE Policy延遲激活的時間。

sr-policy up-delay delay-time

缺省情況下,SR-MPLS TE Policy不延遲激活。

(5)     進入SR-MPLS TE Policy視圖。

policy policy-name

(6)     配置SR-MPLS TE Policy的延遲激活時間。

up-delay delay-time

缺省情況下,未配置延遲激活時間,以SR-TE視圖下的配置為準。

1.13  配置SR-MPLS TE Policy CBTS

1. 軟件版本適配關係

僅R5111及以上版本支持本功能。

2. 配置準備

配置SR-MPLS TE Policy CBTS前需要先通過remark service-class命令配置QoS流行為,標記流量的隧道轉發類,具體請參見“ACL和QoS命令參考”中的“QoS策略”。

3. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     進入SR-MPLS TE Policy視圖。

policy policy-name

(5)     配置SR-MPLS TE Policy的轉發類。

service-class service-class-value

缺省情況下,未配置SR-MPLS TE Policy的轉發類,該SR-MPLS TE Policy的轉發類值為255,轉發優先級最低。

 

1.14  配置SR-TE的流量轉發統計功能

1. 功能簡介

配置本功能後,可以統計通過SR-MPLS TE Policy轉發的流量的信息。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     開啟SR-TE的流量轉發統計功能。

forwarding statistics enable

缺省情況下,SR-TE的流量轉發統計功能處於關閉狀態。

(5)     (可選)配置SR-TE流量轉發統計信息收集的時間間隔。

forwarding statistics interval interval

缺省情況下,SR-TE流量轉發統計信息收集時間間隔為30秒。

1.15  開啟SR-MPLS TE Policy的日誌功能

1. 功能簡介

開啟SR-MPLS TE Policy的日誌功能後,設備將記錄SR-MPLS TE Policy的狀態變化情況,以便管理員對SR-MPLS TE Policy運行情況進行審計。設備生成的SR-MPLS TE Policy日誌信息將被發送到設備的信息中心,通過設置信息中心的參數,決定日誌信息的輸出規則(即是否允許輸出以及輸出方向)。有關信息中心參數的配置請參見“網絡管理和監控配置指導”中的“信息中心”。

2. 配置步驟

(1)     進入係統視圖。

system-view

(2)     進入Segment Routing視圖。

segment-routing

(3)     進入SR-TE視圖。

traffic-engineering

(4)     開啟SR-MPLS TE Policy的日誌功能。

sr-policy log enable

缺省情況下,SR-MPLS TE Policy的日誌功能處於關閉。

1.16  SR-MPLS TE Policy顯示和維護

1.16.1  顯示BGP IPv4 SR Policy路由信息

可在任意視圖下執行以下命令:

·     顯示BGP對等體或對等體組的狀態和統計信息。

display bgp [ instance instance-name ] peer ipv4 sr-policy [ ipv4-address mask-length | { ipv4-address | group-name group-name } log-info | [ ipv4-address ] verbose ]

·     顯示BGP IPv4 SR Policy路由信息。

display bgp [ instance instance-name ] routing-table ipv4 sr-policy [ sr-policy-prefix [ advertise-info ] | peer ipv4-address { advertised-routes | received-routes } [ statistics ] | statistics ]

1.16.2  顯示SR-MPLS TE Policy的配置及運行狀態

1. 軟件版本適配關係

僅R5111及以上版本支持display segment-routing te bfd命令。

2. 配置步驟

可在任意視圖下執行以下命令:

·     顯示SR-MPLS TE Policy信息。

display segment-routing te policy [ odn ] [ name policy-name | down | up | { color color-value | end-point ipv4 ip-address } * ]

·     顯示SR-MPLS TE Policy的統計信息。

display segment-routing te policy statistics

·     顯示SR-MPLS TE Policy的BFD信息。

display segment-routing te bfd [ down | policy { { color color-value | end-point ipv4 ipv4-address } * | name policy-name } | up ]

·     顯示SR-MPLS TE Policy組的信息。

display segment-routing te policy-group [ group-id ] [ verbose ]

1.16.3  顯示和清除SR-TE的轉發信息

可在任意視圖下執行以下命令,顯示SR-TE的轉發信息。

display segment-routing te forwarding [ policy { policy-name | { color color-value | end-point ipv4 ip-address } * } ] [ verbose ]

請在用戶視圖下執行以下命令,清除SR-TE流量轉發統計信息

reset segment-routing te forwarding statistics

1.17  SR-MPLS TE Policy典型配置舉例

1.17.1  SR-MPLS TE Policy基本轉發配置舉例

1. 組網需求

通過在IGP網絡中部署SR-MPLS TE Policy,實現根據用戶需求製定合理的轉發路徑。如圖1-8所示,用戶需要流量分別經過Device A、Device B、Device C、Device D轉發。通過部署以下功能可以實現該需求:

·     Device A~Device D設備之間運行IS-IS實現三層互通。

·     Device A~Device D設備之間部署SR-MPLS,建立SRLSP。

·     在Device A上配置SR-MPLS TE Policy,限定用戶流量的轉發路徑為Device A->Device B->Device C->Device D。

2. 組網圖

圖1-8 SR-MPLS TE Policy基本轉發配置組網圖

設備

接口

IP地址

設備

接口

IP地址

Device A

Loop1

1.1.1.1/32

Device B

Loop1

2.2.2.2/32

 

HGE1/0/1

12.0.0.1/24

 

HGE1/0/1

12.0.0.2/24

 

HGE1/0/2

14.0.0.1/24

 

HGE1/0/2

23.0.0.2/24

Device C

Loop1

3.3.3.3/32

Device D

Loop1

4.4.4.4/32

 

HGE1/0/1

34.0.0.3/24

 

HGE1/0/1

34.0.0.4/24

 

HGE1/0/2

23.0.0.3/24

 

HGE1/0/2

14.0.0.4/24

 

3. 配置準備

缺省情況下,本設備的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

4. 配置步驟

(1)     請按照圖1-8配置各接口的IP地址和子網掩碼,具體配置過程略

(2)     配置Device A

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceA> system-view

[DeviceA] isis 1

[DeviceA-isis-1] network-entity 00.0000.0000.0001.00

[DeviceA-isis-1] cost-style wide

[DeviceA-isis-1] quit

[DeviceA] interface hundredgige 1/0/1

[DeviceA-HundredGigE1/0/1] isis enable 1

[DeviceA-HundredGigE1/0/1] quit

[DeviceA] interface hundredgige 1/0/2

[DeviceA-HundredGigE1/0/2] isis enable 1

[DeviceA-HundredGigE1/0/2] quit

[DeviceA] interface loopback 1

[DeviceA-LoopBack1] isis enable 1

[DeviceA-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceA] mpls lsr-id 1.1.1.1

[DeviceA] mpls te

[DeviceA-te] quit

[DeviceA] interface hundredgige 1/0/1

[DeviceA-HundredGigE1/0/1] mpls enable

[DeviceA-HundredGigE1/0/1] quit

[DeviceA] interface hundredgige 1/0/2

[DeviceA-HundredGigE1/0/2] mpls enable

[DeviceA-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceA] isis 1

[DeviceA-isis-1] segment-routing global-block 16000 16999

[DeviceA-isis-1] address-family ipv4

[DeviceA-isis-1-ipv4] segment-routing mpls

[DeviceA-isis-1-ipv4] quit

[DeviceA-isis-1] quit

# 配置前綴SID索引。

[DeviceA] interface loopback 1

[DeviceA-LoopBack1] isis prefix-sid index 10

[DeviceA-LoopBack1] quit

# 配置SID列表。

[DeviceA] segment-routing

[DeviceA-segment-routing] traffic-engineering

[DeviceA-sr-te] segment-list s1

[DeviceA-sr-te-sl-s1] index 10 mpls label 16020

[DeviceA-sr-te-sl-s1] index 20 mpls label 17030

[DeviceA-sr-te-sl-s1] index 30 mpls label 18040

[DeviceA-sr-te-sl-s1] quit

# 創建SR-MPLS TE Policy,並配置SR-MPLS TE Policy屬性。

[DeviceA-sr-te] policy p1

[DeviceA-sr-te-policy-p1] binding-sid mpls 15000

[DeviceA-sr-te-policy-p1] color 10 end-point ipv4 4.4.4.4

[DeviceA-sr-te-policy-p1] candidate-paths

[DeviceA-sr-te-policy-p1-path] preference 10

[DeviceA-sr-te-policy-p1-path-pref-10] explicit segment-list s1

[DeviceA-sr-te-policy-p1-path-pref-10] quit

[DeviceA-sr-te-policy-p1-path] quit

[DeviceA-sr-te-policy-p1] quit

[DeviceA-sr-te] quit

[DeviceA-segment-routing] quit

(3)     配置Device B

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceB> system-view

[DeviceB] isis 1

[DeviceB-isis-1] network-entity 00.0000.0000.0002.00

[DeviceB-isis-1] cost-style wide

[DeviceB-isis-1] quit

[DeviceB] interface hundredgige 1/0/1

[DeviceB-HundredGigE1/0/1] isis enable 1

[DeviceB-HundredGigE1/0/1] quit

[DeviceB] interface hundredgige 1/0/2

[DeviceB-HundredGigE1/0/2] isis enable 1

[DeviceB-HundredGigE1/0/2] quit

[DeviceB] interface loopback 1

[DeviceB-LoopBack1] isis enable 1

[DeviceB-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceB] mpls lsr-id 2.2.2.2

[DeviceB] mpls te

[DeviceB-te] quit

[DeviceB] interface hundredgige 1/0/1

[DeviceB-HundredGigE1/0/1] mpls enable

[DeviceB-HundredGigE1/0/1] quit

[DeviceB] interface hundredgige 1/0/2

[DeviceB-HundredGigE1/0/2] mpls enable

[DeviceB-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceB] isis 1

[DeviceB-isis-1] segment-routing global-block 17000 17999

[DeviceB-isis-1] address-family ipv4

[DeviceB-isis-1-ipv4] segment-routing mpls

[DeviceB-isis-1-ipv4] quit

[DeviceB-isis-1] quit

# 配置前綴SID索引。

[DeviceB] interface loopback 1

[DeviceB-LoopBack1] isis prefix-sid index 20

[DeviceB-LoopBack1] quit

(4)     配置Device C

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceC> system-view

[DeviceC] isis 1

[DeviceC-isis-1] network-entity 00.0000.0000.0003.00

[DeviceC-isis-1] cost-style wide

[DeviceC-isis-1] quit

[DeviceC] interface hundredgige 1/0/1

[DeviceC-HundredGigE1/0/1] isis enable 1

[DeviceC-HundredGigE1/0/1] quit

[DeviceC] interface hundredgige 1/0/2

[DeviceC-HundredGigE1/0/2] isis enable 1

[DeviceC-HundredGigE1/0/2] quit

[DeviceC] interface loopback 1

[DeviceC-LoopBack1] isis enable 1

[DeviceC-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceC] mpls lsr-id 3.3.3.3

[DeviceC] mpls te

[DeviceC-te] quit

[DeviceC] interface hundredgige 1/0/1

[DeviceC-HundredGigE1/0/1] mpls enable

[DeviceC-HundredGigE1/0/1] quit

[DeviceC] interface hundredgige 1/0/2

[DeviceC-HundredGigE1/0/2] mpls enable

[DeviceC-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceC] isis 1

[DeviceC-isis-1] segment-routing global-block 18000 18999

[DeviceC-isis-1] address-family ipv4

[DeviceC-isis-1-ipv4] segment-routing mpls

[DeviceC-isis-1-ipv4] quit

[DeviceC-isis-1] quit

# 配置前綴SID索引。

[DeviceC] interface loopback 1

[DeviceC-LoopBack1] isis prefix-sid index 30

[DeviceC-LoopBack1] quit

(5)     配置Device D

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceD> system-view

[DeviceD] isis 1

[DeviceD-isis-1] network-entity 00.0000.0000.0004.00

[DeviceD-isis-1] cost-style wide

[DeviceD-isis-1] quit

[DeviceD] interface hundredgige 1/0/1

[DeviceD-HundredGigE1/0/1] isis enable 1

[DeviceD-HundredGigE1/0/1] quit

[DeviceD] interface hundredgige 1/0/2

[DeviceD-HundredGigE1/0/2] isis enable 1

[DeviceD-HundredGigE1/0/2] quit

[DeviceD] interface loopback 1

[DeviceD-LoopBack1] isis enable 1

[DeviceD-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceD] mpls lsr-id 4.4.4.4

[DeviceD] mpls te

[DeviceD-te] quit

[DeviceD] interface hundredgige 1/0/1

[DeviceD-HundredGigE1/0/1] mpls enable

[DeviceD-HundredGigE1/0/1] quit

[DeviceD] interface hundredgige 1/0/2

[DeviceD-HundredGigE1/0/2] mpls enable

[DeviceD-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceD] isis 1

[DeviceD-isis-1] segment-routing global-block 19000 19999

[DeviceD-isis-1] address-family ipv4

[DeviceD-isis-1-ipv4] segment-routing mpls

[DeviceD-isis-1-ipv4] quit

[DeviceD-isis-1] quit

# 配置前綴SID索引。

[DeviceD] interface loopback 1

[DeviceD-LoopBack1] isis prefix-sid index 40

[DeviceD-LoopBack1] quit

5. 驗證配置

# 在Device A上查看SR-MPLS TE Policy的配置情況,可以看到SR-MPLS TE Policy處於激活狀態,設備可以通過SR-MPLS TE Policy轉發流量。

[DeviceA] display segment-routing te policy

Name/ID: p1/0

 Color: 10

 Endpoint: 4.4.4.4

 BgpName: <none>

 BSID:

  Mode: Explict             Type: Type_1              Request state: Succeeded

  Current BSID: 15000       Explicit BSID: 15000      Dynamic BSID: -

 Reference counts: 4

 Flags: A/BS/NC

 Status: Up

 Forwarding status: Active

 Up time: 2020-10-25 11:16:15

 Down time: 2020-10-25 11:16:00

 Hot-standby: Not configured

 SBFD: Not configured

 BFD echo: Not configured

 PolicyNid: 20971521

 Service-class: -

 Candidate paths state: Configured

 Candidate paths statistics:

  CLI paths: 1          BGP paths: 0          PCEP paths: 0

 Candidate paths:

  Preference : 10

   CPathName: <none>

   Instance ID: 0          ASN: 0          Node Address: 0.0.0.0

   Peer address:  0.0.0.0

   Optimal: Y              Flags: V/A

   Explict SID list:

    ID: 1                     Name: s1

    Weight: 1                 Nid: 24117250

    State: Up                 State(-): -

# 在Device A上查看SR-MPLS TE Policy的轉發信息,可以看到通過SR-MPLS TE Policy轉發流量時報文封裝的標簽棧為17030和18040。

[DeviceA] display segment-routing te forwarding verbose

Total Forwarding entries: 1

 

Policy name/ID: p1/0

 Binding SID: 15000

 Policy NID: 20971521

 Forwarding status: Active

 Main path:

   SegList Name/ID: 1/3

     SegList NID: 24117250

     Weight: 1

     Forwarding status: Active

     Outgoing NID: 23068673

       OutLabels: 3

       Interface: HGE1/0/1

       NextHop: 12.0.0.2

         Path ID: 0

         Label stack: {17030, 18040}

# 在Device A上查看MPLS標簽轉發路徑信息,可以看到SR-MPLS TE Policy對應的轉發路徑信息。

[DeviceA] display mpls lsp

FEC                         Proto       In/Out Label    Out Inter/NHLFE/LSINDEX

12.0.0.2                    Local       -/-             HGE1/0/1

14.0.0.4                    Local       -/-             HGE1/0/2

1.1.1.1/32                  ISIS        16010/-         -

2.2.2.2/32                  ISIS        16020/3         HGE1/0/1

2.2.2.2/32                  ISIS        -/3             HGE1/0/1

3.3.3.3/32                  ISIS        16030/17030     HGE1/0/1

3.3.3.3/32                  ISIS        -/17030         HGE1/0/1

3.3.3.3/32                  ISIS        16030/19030     HGE1/0/2

3.3.3.3/32                  ISIS        -/19030         HGE1/0/2

4.4.4.4/32                  ISIS        16040/3         HGE1/0/2

4.4.4.4/32                  ISIS        -/3             HGE1/0/2

4.4.4.4/32/23068673         SRPolicy    -/17030         HGE1/0/1

                                        18040

24117250                    SRPolicy    -/-             LSINDEX23068673

4.4.4.4/10                  SRPolicy    15000/-         NHLFE24117250

1.17.2  SR-MPLS TE Policy通過BGP引入配置舉例

1. 組網需求

通過在BGP網絡中部署SR-MPLS TE Policy,實現根據用戶需求製定合理的轉發路徑。如圖1-9所示,用戶需要流量分別經過Device A、Device B、Device C、Device D轉發。通過部署以下功能可以實現該需求:

·     Device A~Device D設備之間運行IS-IS實現三層互通。

·     Device A~Device D設備之間部署SR-MPLS,建立SRLSP。

·     在Device B上配置SR-MPLS TE Policy,將BGP IPv4 SR Policy路由發布給Device A。Device A根據BGP IPv4 SR Policy路由生成對應的SR-MPLS TE Policy。SR-MPLS TE Policy限定用戶流量的轉發路徑為Device A->Device B->Device C->Device D。

2. 組網圖

圖1-9 SR-MPLS TE Policy通過BGP引入的配置組網圖

設備

接口

IP地址

設備

接口

IP地址

Device A

Loop1

1.1.1.1/32

Device B

Loop1

2.2.2.2/32

 

HGE1/0/1

12.0.0.1/24

 

HGE1/0/1

12.0.0.2/24

 

HGE1/0/2

14.0.0.1/24

 

HGE1/0/2

23.0.0.2/24

Device C

Loop1

3.3.3.3/32

Device D

Loop1

4.4.4.4/32

 

HGE1/0/1

34.0.0.3/24

 

HGE1/0/1

34.0.0.4/24

 

HGE1/0/2

23.0.0.3/24

 

HGE1/0/2

14.0.0.4/24

 

3. 配置準備

缺省情況下,本設備的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

4. 配置步驟

(1)     請按照圖1-9配置各接口的IP地址和子網掩碼,具體配置過程略

(2)     配置Device A

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceA> system-view

[DeviceA] isis 1

[DeviceA-isis-1] network-entity 00.0000.0000.0001.00

[DeviceA-isis-1] cost-style wide

[DeviceA-isis-1] quit

[DeviceA] interface hundredgige 1/0/1

[DeviceA-HundredGigE1/0/1] isis enable 1

[DeviceA-HundredGigE1/0/1] quit

[DeviceA] interface hundredgige 1/0/2

[DeviceA-HundredGigE1/0/2] isis enable 1

[DeviceA-HundredGigE1/0/2] quit

[DeviceA] interface loopback 1

[DeviceA-LoopBack1] isis enable 1

[DeviceA-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceA] mpls lsr-id 1.1.1.1

[DeviceA] mpls te

[DeviceA-te] quit

[DeviceA] interface hundredgige 1/0/1

[DeviceA-HundredGigE1/0/1] mpls enable

[DeviceA-HundredGigE1/0/1] quit

[DeviceA] interface hundredgige 1/0/2

[DeviceA-HundredGigE1/0/2] mpls enable

[DeviceA-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceA] isis 1

[DeviceA-isis-1] segment-routing global-block 16000 20000

[DeviceA-isis-1] address-family ipv4

[DeviceA-isis-1-ipv4] segment-routing mpls

[DeviceA-isis-1-ipv4] segment-routing adjacency enable

[DeviceA-isis-1-ipv4] quit

[DeviceA-isis-1] quit

# 配置前綴SID索引。

[DeviceA] interface loopback 1

[DeviceA-LoopBack1] isis prefix-sid index 10

[DeviceA-LoopBack1] quit

# 配置BGP。

[DeviceA] bgp 100

[DeviceA-bgp-default] peer 2.2.2.2 as-number 100

[DeviceA-bgp-default] peer 2.2.2.2 connect-interface LoopBack1

[DeviceA-bgp-default] address-family ipv4 unicast

[DeviceA-bgp-default-ipv4] peer 2.2.2.2 enable

[DeviceA-bgp-default-ipv4] quit

[DeviceA-bgp-default] address-family ipv4 sr-policy

[DeviceA-bgp-default-sr-policy-ipv4] peer 2.2.2.2 enable

[DeviceA-bgp-default-sr-policy-ipv4] import-route sr-policy

[DeviceA-bgp-default-sr-policy-ipv4] quit

[DeviceA-bgp-default] quit

# 配置SR-TE。

[DeviceA] segment-routing

[DeviceA-segment-routing] traffic-engineering

[DeviceA-sr-te] quit

(3)     配置Device B

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceB> system-view

[DeviceB] isis 1

[DeviceB-isis-1] network-entity 00.0000.0000.0002.00

[DeviceB-isis-1] cost-style wide

[DeviceB-isis-1] quit

[DeviceB] interface hundredgige 1/0/1

[DeviceB-HundredGigE1/0/1] isis enable 1

[DeviceB-HundredGigE1/0/1] quit

[DeviceB] interface hundredgige 1/0/2

[DeviceB-HundredGigE1/0/2] isis enable 1

[DeviceB-HundredGigE1/0/2] quit

[DeviceB] interface loopback 1

[DeviceB-LoopBack1] isis enable 1

[DeviceB-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceB] mpls lsr-id 2.2.2.2

[DeviceB] mpls te

[DeviceB-te] quit

[DeviceB] interface hundredgige 1/0/1

[DeviceB-HundredGigE1/0/1] mpls enable

[DeviceB-HundredGigE1/0/1] quit

[DeviceB] interface hundredgige 1/0/2

[DeviceB-HundredGigE1/0/2] mpls enable

[DeviceB-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceB] isis 1

[DeviceB-isis-1] segment-routing global-block 16000 20000

[DeviceB-isis-1] address-family ipv4

[DeviceB-isis-1-ipv4] segment-routing mpls

[DeviceB-isis-1-ipv4] quit

[DeviceB-isis-1] quit

# 配置前綴SID索引。

[DeviceB] interface loopback 1

[DeviceB-LoopBack1] isis prefix-sid index 20

[DeviceB-LoopBack1] quit

# 配置BGP。

[DeviceB] bgp 100

[DeviceB-bgp-default] peer 1.1.1.1 as-number 100

[DeviceB-bgp-default] peer 1.1.1.1 connect-interface LoopBack1

[DeviceB-bgp-default] address-family ipv4 unicast

[DeviceB-bgp-default-ipv4] peer 1.1.1.1 enable

[DeviceB-bgp-default-ipv4] quit

[DeviceB-bgp-default] address-family ipv4 sr-policy

[DeviceB-bgp-default-sr-policy-ipv4] peer 1.1.1.1 enable

[DeviceB-bgp-default-sr-policy-ipv4] import-route sr-policy

[DeviceB-bgp-default-sr-policy-ipv4] quit

[DeviceB-bgp-default] quit

# 配置SID列表。

[DeviceB] segment-routing

[DeviceB-segment-routing] traffic-engineering

[DeviceB-sr-te] segment-list s1

[DeviceB-sr-te-sl-s1] index 10 mpls label 16020

[DeviceB-sr-te-sl-s1] index 20 mpls label 16030

[DeviceB-sr-te-sl-s1] index 30 mpls label 16040

[DeviceB-sr-te-sl-s1] quit

# 創建SR-MPLS TE Policy,並配置SR-MPLS TE Policy屬性。

[DeviceB-sr-te] policy p1

[DeviceB-sr-te-policy-p1] binding-sid mpls 15000

[DeviceB-sr-te-policy-p1] color 10 end-point ipv4 4.4.4.4

[DeviceB-sr-te-policy-p1] candidate-paths

[DeviceB-sr-te-policy-p1-path] preference 10

[DeviceB-sr-te-policy-p1-path-pref-10] explicit segment-list s1

[DeviceB-sr-te-policy-p1-path-pref-10] quit

[DeviceB-sr-te-policy-p1-path] quit

[DeviceB-sr-te-policy-p1] quit

[DeviceB-sr-te] quit

[DeviceB-segment-routing] quit

(4)     配置Device C

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceC> system-view

[DeviceC] isis 1

[DeviceC-isis-1] network-entity 00.0000.0000.0003.00

[DeviceC-isis-1] cost-style wide

[DeviceC-isis-1] quit

[DeviceC] interface hundredgige 1/0/1

[DeviceC-HundredGigE1/0/1] isis enable 1

[DeviceC-HundredGigE1/0/1] quit

[DeviceC] interface hundredgige 1/0/2

[DeviceC-HundredGigE1/0/2] isis enable 1

[DeviceC-HundredGigE1/0/2] quit

[DeviceC] interface loopback 1

[DeviceC-LoopBack1] isis enable 1

[DeviceC-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceC] mpls lsr-id 3.3.3.3

[DeviceC] mpls te

[DeviceC-te] quit

[DeviceC] interface hundredgige 1/0/1

[DeviceC-HundredGigE1/0/1] mpls enable

[DeviceC-HundredGigE1/0/1] quit

[DeviceC] interface hundredgige 1/0/2

[DeviceC-HundredGigE1/0/2] mpls enable

[DeviceC-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceC] isis 1

[DeviceC-isis-1] segment-routing global-block 16000 20000

[DeviceC-isis-1] address-family ipv4

[DeviceC-isis-1-ipv4] segment-routing mpls

[DeviceC-isis-1-ipv4] quit

[DeviceC-isis-1] quit

# 配置前綴SID索引。

[DeviceC] interface loopback 1

[DeviceC-LoopBack1] isis prefix-sid index 30

[DeviceC-LoopBack1] quit

(5)     配置Device D

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<DeviceD> system-view

[DeviceD] isis 1

[DeviceD-isis-1] network-entity 00.0000.0000.0004.00

[DeviceD-isis-1] cost-style wide

[DeviceD-isis-1] quit

[DeviceD] interface hundredgige 1/0/1

[DeviceD-HundredGigE1/0/1] isis enable 1

[DeviceD-HundredGigE1/0/1] quit

[DeviceD] interface hundredgige 1/0/2

[DeviceD-HundredGigE1/0/2] isis enable 1

[DeviceD-HundredGigE1/0/2] quit

[DeviceD] interface loopback 1

[DeviceD-LoopBack1] isis enable 1

[DeviceD-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[DeviceD] mpls lsr-id 4.4.4.4

[DeviceD] mpls te

[DeviceD-te] quit

[DeviceD] interface hundredgige 1/0/1

[DeviceD-HundredGigE1/0/1] mpls enable

[DeviceD-HundredGigE1/0/1] quit

[DeviceD] interface hundredgige 1/0/2

[DeviceD-HundredGigE1/0/2] mpls enable

[DeviceD-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[DeviceD] isis 1

[DeviceD-isis-1] segment-routing global-block 16000 20000

[DeviceD-isis-1] address-family ipv4

[DeviceD-isis-1-ipv4] segment-routing mpls

[DeviceD-isis-1-ipv4] quit

[DeviceD-isis-1] quit

# 配置前綴SID索引。

[DeviceD] interface loopback 1

[DeviceD-LoopBack1] isis prefix-sid index 40

[DeviceD-LoopBack1] quit

5. 驗證配置

# 在Device A上查看SR-MPLS TE Policy的配置情況,可以看到通過BGP引入的SR-MPLS TE Policy處於激活狀態,設備可以通過SR-MPLS TE Policy轉發流量。

[DeviceA] display segment-routing te policy

 

Name/ID: p1/0

 Color: 10

 Endpoint: 4.4.4.4

 BgpName: p1

 BSID:

  Mode: Explicit             Type: Type_1              Request state: Succeeded

  Current BSID: 15000        Explicit BSID: 15000      Dynamic BSID: -

 Reference counts: 4

 Flags: A/BS/NC

 Status: Up

 Forwarding status: Active

 Up time: 2020-10-25 11:16:15

 Down time: 2020-10-25 11:16:00

 Hot-standby: Not configured

 SBFD: Not configured

 BFD echo: Not configured

 PolicyNid: 20971521

 Service-class: -

 Candidate paths state: Configured

 Candidate paths statistics:

  CLI paths: 0          BGP paths: 1          PCEP paths: 0

 Candidate paths:

  Preference : 10

   CPathName: p1

   ProtoOrigin: BGP        Discriminator: 10

   Instance ID: 0          Node address: 2.2.2.2

   Originator:  100, 2.2.2.2

   Optimal: Y              Flags: V/A/BN

   Explicit SID list:

    ID: 1                     Name:

    Weight: 1                 Nid: 24117249

    State: Up                 State(-): -

1.17.3  SR-MPLS TE Policy基於Color引流配置舉例

1. 組網需求

圖1-10所示,VPN用戶間需要通過專線互訪,可以在公網部署SR-MPLS TE Policy,基於Color引流方式將私網流量引入指定SR-MPLS TE Policy隧道轉發。

2. 組網圖

圖1-10 SR-MPLS TE Policy基於Color引流配置組網圖

設備

接口

IP地址

設備

接口

IP地址

CE 1

HGE1/0/1

10.1.1.1/24

CE 2

HGE1/0/1

10.2.1.1/24

PE 1

Loop1

1.1.1.1/32

PE 2

Loop1

4.4.4.4/32

 

HGE1/0/1

10.1.1.2/24

 

HGE1/0/1

10.2.1.2/24

 

HGE1/0/2

12.0.0.1/24

 

HGE1/0/2

34.0.0.4/24

 

HGE1/0/3

14.0.0.1/24

 

HGE1/0/3

14.0.0.4/24

P 1

Loop1

3.3.3.3/32

P 2

Loop1

2.2.2.2/32

 

HGE1/0/1

12.0.0.2/24

 

HGE1/0/1

34.0.0.3/24

 

HGE1/0/2

23.0.0.2/24

 

HGE1/0/2

23.0.0.3/24

 

3. 配置準備

缺省情況下,本設備的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

4. 配置步驟

(1)     請按照圖1-10配置各接口的IP地址和子網掩碼,具體配置過程略

(2)     配置CE 1

[CE1] bgp 65410

[CE1-bgp-default] peer 10.1.1.2 as-number 100

[CE1-bgp-default] address-family ipv4 unicast

[CE1-bgp-default-ipv4] import-route direct

[CE1-bgp-default-ipv4] peer 10.1.1.2 enable

(3)     配置PE 1

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<PE1> system-view

[PE1] isis 1

[PE1-isis-1] network-entity 00.0000.0000.0001.00

[PE1-isis-1] cost-style wide

[PE1-isis-1] quit

[PE1] interface hundredgige 1/0/2

[PE1-HundredGigE1/0/2] isis enable 1

[PE1-HundredGigE1/0/2] quit

[PE1] interface hundredgige 1/0/3

[PE1-HundredGigE1/0/3] isis enable 1

[PE1-HundredGigE1/0/3] quit

[PE1] interface loopback 1

[PE1-LoopBack1] isis enable 1

[PE1-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[PE1] mpls lsr-id 1.1.1.1

[PE1] mpls te

[PE1-te] quit

[PE1] interface hundredgige 1/0/2

[PE1-HundredGigE1/0/2] mpls enable

[PE1-HundredGigE1/0/2] quit

[PE1] interface hundredgige 1/0/3

[PE1-HundredGigE1/0/3] mpls enable

[PE1-HundredGigE1/0/3] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[PE1] isis 1

[PE1-isis-1] segment-routing global-block 16000 16999

[PE1-isis-1] address-family ipv4

[PE1-isis-1-ipv4] segment-routing mpls

[PE1-isis-1-ipv4] quit

[PE1-isis-1] quit

# 配置前綴SID索引。

[PE1] interface loopback 1

[PE1-LoopBack1] isis prefix-sid index 10

[PE1-LoopBack1] quit

# 配置SID列表。

[PE1] segment-routing

[PE1-segment-routing] traffic-engineering

[PE1-sr-te] segment-list s1

[PE1-sr-te-sl-s1] index 10 mpls label 16020

[PE1-sr-te-sl-s1] index 20 mpls label 17030

[PE1-sr-te-sl-s1] index 30 mpls label 18040

[PE1-sr-te-sl-s1] quit

# 創建SR-MPLS TE Policy,並配置SR-MPLS TE Policy屬性。

[PE1-sr-te] policy p1

[PE1-sr-te-policy-p1] binding-sid mpls 15000

[PE1-sr-te-policy-p1] color 10 end-point ipv4 4.4.4.4

[PE1-sr-te-policy-p1] candidate-paths

[PE1-sr-te-policy-p1-path] preference 10

[PE1-sr-te-policy-p1-path-pref-10] explicit segment-list s1

[PE1-sr-te-policy-p1-path-pref-10] quit

[PE1-sr-te-policy-p1-path] quit

[PE1-sr-te-policy-p1] quit

[PE1-sr-te] quit

[PE1-segment-routing] quit

# 創建隧道策略,采用SR-MPLS TE Policy隧道承載私網流量。

[PE1] tunnel-policy p1

[PE1-tunnel-policy-1] select-seq sr-policy load-balance-number 1

[PE1-tunnel-policy-1] quit

# 創建VPN實例,引用隧道策略。

[PE1] ip vpn-instance vpna

[PE1-vpn-instance-vpna] route-distinguisher 100:1

[PE1-vpn-instance-vpna] vpn-target 111:1

[PE1-vpn-instance-vpna] address-family ipv4

[PE1-vpn-ipv4-vpna] route-distinguisher 100:1

[PE1-vpn-ipv4-vpna] tnl-policy p1

# 配置CE接入PE。

[PE1] interface hundredgige 1/0/1

[PE1-HundredGigE1/0/1] ip binding vpn-instance vpna

[PE1-HundredGigE1/0/1] ip address 10.1.1.2 255.255.255.0

# 配置路由策略

[PE1] route-policy p1 permit node 1

[PE1-route-policy-p1-1] apply extcommunity color 00:10

[PE1-route-policy-p1-1] quit

# 配置BGP

[PE1] bgp 100

[PE1-bgp-default] peer 4.4.4.4 as-number 100

[PE1-bgp-default] peer 4.4.4.4 connect-interface LoopBack1

[PE1-bgp-default] address-family vpnv4

[PE1-bgp-default-vpnv4] peer 4.4.4.4 enable

[PE1-bgp-default-vpnv4] peer 4.4.4.4 route-policy p1 export

[PE1-bgp-default-vpnv4] quit

[PE1-bgp-default] address-family ipv4 sr-policy

[PE1-bgp-default-sr-policy-ipv4] import-route sr-policy

[PE1-bgp-default-sr-policy-ipv4] peer 4.4.4.4 enable

[PE1-bgp-default-sr-policy-ipv4] quit

[PE1-bgp-default] ip vpn-instance vpna

[PE1-bgp-default-vpna] peer 10.1.1.1 as-number 65410

[PE1-bgp-default-vpna] address-family ipv4 unicast

[PE1-bgp-default-ipv4-vpna] peer 10.1.1.1 enable

[PE1-bgp-default-ipv4-vpna] quit

[PE1-bgp-default-vpna] quit

[PE1-bgp-default] quit

(4)     配置P 1

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<P1> system-view

[P1] isis 1

[P1-isis-1] network-entity 00.0000.0000.0002.00

[P1-isis-1] cost-style wide

[P1-isis-1] quit

[P1] interface hundredgige 1/0/1

[P1-HundredGigE1/0/1] isis enable 1

[P1-HundredGigE1/0/1] quit

[P1] interface hundredgige 1/0/2

[P1-HundredGigE1/0/2] isis enable 1

[P1-HundredGigE1/0/2] quit

[P1] interface loopback 1

[P1-LoopBack1] isis enable 1

[P1-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[P1] mpls lsr-id 2.2.2.2

[P1] mpls te

[P1-te] quit

[P1] interface hundredgige 1/0/1

[P1-HundredGigE1/0/1] mpls enable

[P1-HundredGigE1/0/1] quit

[P1] interface hundredgige 1/0/2

[P1-HundredGigE1/0/2] mpls enable

[P1-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[P1] isis 1

[P1-isis-1] segment-routing global-block 17000 17999

[P1-isis-1] address-family ipv4

[P1-isis-1-ipv4] segment-routing mpls

[P1-isis-1-ipv4] quit

[P1-isis-1] quit

# 配置前綴SID索引。

[P1] interface loopback 1

[P1-LoopBack1] isis prefix-sid index 20

[P1-LoopBack1] quit

(5)     配置P 2

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<P2> system-view

[P2] isis 1

[P2-isis-1] network-entity 00.0000.0000.0003.00

[P2-isis-1] cost-style wide

[P2-isis-1] quit

[P2] interface hundredgige 1/0/1

[P2-HundredGigE1/0/1] isis enable 1

[P2-HundredGigE1/0/1] quit

[P2] interface hundredgige 1/0/2

[P2-HundredGigE1/0/2] isis enable 1

[P2-HundredGigE1/0/2] quit

[P2] interface loopback 1

[P2-LoopBack1] isis enable 1

[P2-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[P2] mpls lsr-id 3.3.3.3

[P2] mpls te

[P2-te] quit

[P2] interface hundredgige 1/0/1

[P2-HundredGigE1/0/1] mpls enable

[P2-HundredGigE1/0/1] quit

[P2] interface hundredgige 1/0/2

[P2-HundredGigE1/0/2] mpls enable

[P2-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[P2] isis 1

[P2-isis-1] segment-routing global-block 18000 18999

[P2-isis-1] address-family ipv4

[P2-isis-1-ipv4] segment-routing mpls

[P2-isis-1-ipv4] quit

[P2-isis-1] quit

# 配置前綴SID索引。

[P2] interface loopback 1

[P2-LoopBack1] isis prefix-sid index 30

[P2-LoopBack1] quit

(6)     配置PE 2

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<PE2> system-view

[PE2] isis 1

[PE2-isis-1] network-entity 00.0000.0000.0004.00

[PE2-isis-1] cost-style wide

[PE2-isis-1] quit

[PE2] interface hundredgige 1/0/2

[PE2-HundredGigE1/0/2] isis enable 1

[PE2-HundredGigE1/0/2] quit

[PE2] interface hundredgige 1/0/3

[PE2-HundredGigE1/0/3] isis enable 1

[PE2-HundredGigE1/0/3] quit

[PE2] interface loopback 1

[PE2-LoopBack1] isis enable 1

[PE2-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[PE2] mpls lsr-id 4.4.4.4

[PE2] mpls te

[PE2-te] quit

[PE2] interface hundredgige 1/0/2

[PE2-HundredGigE1/0/2] mpls enable

[PE2-HundredGigE1/0/2] quit

[PE2] interface hundredgige 1/0/3

[PE2-HundredGigE1/0/3] mpls enable

[PE2-HundredGigE1/0/3] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[PE2] isis 1

[PE2-isis-1] segment-routing global-block 19000 19999

[PE2-isis-1] address-family ipv4

[PE2-isis-1-ipv4] segment-routing mpls

[PE2-isis-1-ipv4] quit

[PE2-isis-1] quit

# 配置前綴SID索引。

[PE2] interface loopback 1

[PE2-LoopBack1] isis prefix-sid index 40

[PE2-LoopBack1] quit

# 創建VPN實例,將CE接入PE。

[PE2] ip vpn-instance vpna

[PE2-vpn-instance-vpna] route-distinguisher 200:1

[PE2-vpn-instance-vpna] vpn-target 111:1

[PE2-vpn-instance-vpna] quit

[PE2-vpn-ipv4-vpna] quit

[PE2] interface hundredgige 1/0/1

[PE2-HundredGigE1/0/1] ip binding vpn-instance vpna

[PE2-HundredGigE1/0/1] ip address 10.2.1.2 255.255.255.0

[PE2-HundredGigE1/0/1] quit

# 配置路由策略。

[PE2] route-policy 1 permit node 1

[PE2-route-policy-p1-1] apply extcommunity color 00:10 additive

[PE2-route-policy-p1-1] quit

# 配置BGP

[PE2] bgp 100

[PE2-bgp-default] peer 1.1.1.1 as-number 100

[PE2-bgp-default] peer 1.1.1.1 connect-interface LoopBack1

[PE2-bgp-default] address-family vpnv4

[PE2-bgp-default-vpnv4] peer 1.1.1.1 enable

[PE2-bgp-default-vpnv4] peer 1.1.1.1 route-policy 1 export

[PE2-bgp-default-vpnv4] quit

[PE2-bgp-default] ip vpn-instance vpna

[PE2-bgp-default-vpna] peer 10.2.1.1 as-number 65410

[PE2-bgp-default-vpna] address-family ipv4 unicast

[PE2-bgp-default-ipv4-vpna] peer 10.2.1.1 enable

[PE2-bgp-default-ipv4-vpna] quit

[PE2-bgp-default-vpna] quit

[PE2-bgp-default] quit

(7)     配置CE 2

[CE2] bgp 65420

[CE2-bgp-default] peer 10.2.1.2 as-number 100

[CE2-bgp-default] address-family ipv4 unicast

[CE2-bgp-default-ipv4] import-route direct

[CE2-bgp-default-ipv4] peer 10.2.1.2 enable

5. 驗證配置

# 在PE 1上查看去往CE 2的路由情況,可以看到路由迭代到隧道,實現Color引流。

[PE1]display  bgp routing-table  vpnv4  10.2.1.0 24

 

 BGP local router ID: 1.1.1.1

 Local AS number: 100

 

 

 Route distinguisher: 100:1(vpna)

 Total number of routes: 1

 Paths:   1 available, 1 best

 

 BGP routing table information of 10.2.1.0/24:

 From            : 4.4.4.4 (4.4.4.4)

 Rely nexthop    : 14.0.0.4

 Original nexthop: 4.4.4.4

 Out interface   : HundredGigE1/0/3

 Route age       : 00h49m49s

 OutLabel        : 1151

 Ext-Community   : <RT: 111:1>, <CO-Flag:Color(00:10)>

 RxPathID        : 0x0

 TxPathID        : 0x0

 AS-path         : 65420

 Origin          : igp

 Attribute value : MED 0, localpref 100, pref-val 0

 State           : valid, internal, best, remoteredist

 IP precedence   : N/A

 QoS local ID    : N/A

 Traffic index   : N/A

 Tunnel policy   : p1

 Rely tunnel IDs : 20971521

# 在PE 1上查看FIB表,10.2.1.0/24路由迭代到SR-MPLS TE Policy隧道。

[PE1]display   fib  vpn-instance vpna

 

Route destination count: 13

Directly-connected host count: 1

 

Flag:

  U:Usable   G:Gateway   H:Host   B:Blackhole   D:Dynamic   S:Static

  R:Relay     F:FRR

 

Destination/Mask   Nexthop         Flag     OutInterface/Token       Label

0.0.0.0/32         127.0.0.1       UH       InLoop0                  Null

10.1.1.0/24        10.1.1.2        U        HGE1/0/1                 Null

10.1.1.0/32        10.1.1.2        UBH      HGE1/0/1                 Null

10.1.1.1/32        10.1.1.1        UH       HGE1/0/1                 Null

10.1.1.2/32        127.0.0.1       UH       InLoop0                  Null

10.1.1.255/32      10.1.1.2        UBH      HGE1/0/1                 Null

10.2.1.0/24        4.4.4.4         UGR      20971521                 1151

127.0.0.0/8        127.0.0.1       U        InLoop0                  Null

127.0.0.0/32       127.0.0.1       UH       InLoop0                  Null

127.0.0.1/32       127.0.0.1       UH       InLoop0                  Null

127.255.255.255/32 127.0.0.1       UH       InLoop0                  Null

255.255.255.255/32 127.0.0.1       UH       InLoop0                  Null

1.17.4  SR-MPLS TE Policy基於DSCP引流的配置舉例

1. 組網需求

圖1-11所示,VPN用戶間特定報文需要通過專線互訪,可以在公網部署SR-MPLS TE Policy,基於DSCP引流方式將指定私網報文引入指定SR-MPLS TE Policy隧道轉發。

2. 組網圖

圖1-11 SR-MPLS TE Policy基於DSCP引流配置組網圖

 

設備

接口

IP地址

設備

接口

IP地址

CE 1

HGE1/0/1

10.1.1.1/24

CE2

HGE1/0/1

10.2.1.1/24

PE 1

Loop1

1.1.1.1/32

PE2

Loop1

4.4.4.4/32

 

HGE1/0/1

10.1.1.2/24

 

HGE1/0/1

10.2.1.2/24

 

HGE1/0/2

12.0.0.1/24

 

HGE1/0/2

34.0.0.4/24

 

HGE1/0/3

14.0.0.1/24

 

HGE1/0/3

14.0.0.4/24

P1

Loop1

2.2.2.2/32

P 2

Loop1

3.3.3.3/32

 

HGE1/0/1

12.0.0.2/24

 

HGE1/0/1

34.0.0.3/24

 

HGE1/0/2

23.0.0.2/24

 

HGE1/0/2

23.0.0.3/24

 

3. 配置準備

缺省情況下,本設備的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

4. 配置步驟

(1)     請按照圖1-11配置各接口的IP地址和子網掩碼,具體配置過程略

(2)     配置CE 1

[CE1] bgp 65410

[CE1-bgp-default] peer 10.1.1.2 as-number 100

[CE1-bgp-default] address-family ipv4 unicast

[CE1-bgp-default-ipv4] import-route direct

[CE1-bgp-default-ipv4] peer 10.1.1.2 enable

(3)     配置PE 1

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<PE1> system-view

[PE1] isis 1

[PE1-isis-1] network-entity 00.0000.0000.0001.00

[PE1-isis-1] cost-style wide

[PE1-isis-1] quit

[PE1] interface hundredgige 1/0/2

[PE1-HundredGigE1/0/2] isis enable 1

[PE1-HundredGigE1/0/2] quit

[PE1] interface hundredgige 1/0/3

[PE1-HundredGigE1/0/3] isis enable 1

[PE1-HundredGigE1/0/3] quit

[PE1] interface loopback 1

[PE1-LoopBack1] isis enable 1

[PE1-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[PE1] mpls lsr-id 1.1.1.1

[PE1] mpls te

[PE1-te] quit

[PE1] interface hundredgige 1/0/2

[PE1-HundredGigE1/0/2] mpls enable

[PE1-HundredGigE1/0/2] quit

[PE1] interface hundredgige 1/0/3

[PE1-HundredGigE1/0/3] mpls enable

[PE1-HundredGigE1/0/3] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[PE1] isis 1

[PE1-isis-1] segment-routing global-block 16000 16999

[PE1-isis-1] address-family ipv4

[PE1-isis-1-ipv4] segment-routing mpls

[PE1-isis-1-ipv4] quit

[PE1-isis-1] quit

# 配置前綴SID索引。

[PE1] interface loopback 1

[PE1-LoopBack1] isis prefix-sid index 10

[PE1-LoopBack1] quit

# 配置SID列表。

[PE1] segment-routing

[PE1-segment-routing] traffic-engineering

[PE1-sr-te] segment-list s1

[PE1-sr-te-sl-s1] index 10 mpls label 16020

[PE1-sr-te-sl-s1] index 20 mpls label 17030

[PE1-sr-te-sl-s1] index 30 mpls label 18040

[PE1-sr-te-sl-s1] quit

# 創建SR-MPLS TE Policy,並配置SR-MPLS TE Policy屬性。

[PE1-sr-te] policy p1

[PE1-sr-te-policy-p1] binding-sid mpls 15000

[PE1-sr-te-policy-p1] color 10 end-point ipv4 4.4.4.4

[PE1-sr-te-policy-p1] candidate-paths

[PE1-sr-te-policy-p1-path] preference 10

[PE1-sr-te-policy-p1-path-pref-10] explicit segment-list s1

[PE1-sr-te-policy-p1-path-pref-10] quit

[PE1-sr-te-policy-p1-path] quit

[PE1-sr-te-policy-p1] quit

[PE1-sr-te] quit

[PE1-segment-routing] quit

# 創建SR-MPLS TE Policy組,並配置Color和DSCP映射關係。

[PE1-sr-te] policy-group 1

[PE1-sr-te-policy-group-1] end-point ipv4 4.4.4.4

[PE1-sr-te-policy-group-1] color 10 match dscp ipv4 10

[PE1-sr-te-policy-group-1] quit

[PE1-sr-te] quit

[PE1-segment-routing] quit

# 創建隧道策略,並配置綁定隧道,綁定SR-MPLS TE Policy組隧道。

[PE1] tunnel-policy 1

[PE1-tunnel-policy-1] binding-destination 4.4.4.4 sr-policy group 1

[PE1-tunnel-policy-1] quit

# 創建VPN實例,配置CE接入PE。

[PE1] ip vpn-instance vpna

[PE1-vpn-instance-vpna] route-distinguisher 100:1

[PE1-vpn-instance-vpna] vpn-target 111:1

[PE1-vpn-instance-vpna] quit

[PE1-vpn-ipv4-vpna] quit

[PE1] interface hundredgige 1/0/1

[PE1-HundredGigE1/0/1] ip binding vpn-instance vpna

[PE1-HundredGigE1/0/1] ip address 10.1.1.2 255.255.255.0

# 配置隧道迭代器

[PE1] tunnel-selector 1 permit node 1

[PE1-tunnel-selector-1-1] apply tunnel-policy 1

[PE1-tunnel-selector-1-1] quit

#配置BGP

[PE1] bgp 100

[PE1-bgp-default] peer 4.4.4.4 as-number 100

[PE1-bgp-default] peer 4.4.4.4 connect-interface LoopBack1

[PE1-bgp-default] address-family vpnv4

[PE1-bgp-default-vpnv4] apply tunnel-selector 1

[PE1-bgp-default-vpnv4] peer 4.4.4.4 enable

[PE1-bgp-default-vpnv4] quit

[PE1-bgp-default] address-family ipv4 sr-policy

[PE1-bgp-default-sr-policy-ipv4] import-route sr-policy

[PE1-bgp-default-sr-policy-ipv4] peer 4.4.4.4 enable

[PE1-bgp-default-sr-policy-ipv4] quit

[PE1-bgp-default] ip vpn-instance vpna

[PE1-bgp-default-vpna] peer 10.1.1.1 as-number 65410

[PE1-bgp-default-vpna] address-family ipv4 unicast

[PE1-bgp-default-ipv4-vpna] peer 10.1.1.1 enable

[PE1-bgp-default-ipv4-vpna] quit

[PE1-bgp-default-vpna] quit

[PE1-bgp-default] quit

(4)     配置P 1

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<P1> system-view

[P1] isis 1

[P1-isis-1] network-entity 00.0000.0000.0002.00

[P1-isis-1] cost-style wide

[P1-isis-1] quit

[P1] interface hundredgige 1/0/1

[P1-HundredGigE1/0/1] isis enable 1

[P1-HundredGigE1/0/1] quit

[P1] interface hundredgige 1/0/2

[P1-HundredGigE1/0/2] isis enable 1

[P1-HundredGigE1/0/2] quit

[P1] interface loopback 1

[P1-LoopBack1] isis enable 1

[P1-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[P1] mpls lsr-id 2.2.2.2

[P1] mpls te

[P1-te] quit

[P1] interface hundredgige 1/0/1

[P1-HundredGigE1/0/1] mpls enable

[P1-HundredGigE1/0/1] quit

[P1] interface hundredgige 1/0/2

[P1-HundredGigE1/0/2] mpls enable

[P1-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[P1] isis 1

[P1-isis-1] segment-routing global-block 17000 17999

[P1-isis-1] address-family ipv4

[P1-isis-1-ipv4] segment-routing mpls

[P1-isis-1-ipv4] quit

[P1-isis-1] quit

# 配置前綴SID索引。

[P1] interface loopback 1

[P1-LoopBack1] isis prefix-sid index 20

[P1-LoopBack1] quit

(5)     配置P 2

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<P2> system-view

[P2] isis 1

[P2-isis-1] network-entity 00.0000.0000.0003.00

[P2-isis-1] cost-style wide

[P2-isis-1] quit

[P2] interface hundredgige 1/0/1

[P2-HundredGigE1/0/1] isis enable 1

[P2-HundredGigE1/0/1] quit

[P2] interface hundredgige 1/0/2

[P2-HundredGigE1/0/2] isis enable 1

[P2-HundredGigE1/0/2] quit

[P2] interface loopback 1

[P2-LoopBack1] isis enable 1

[P2-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[P2] mpls lsr-id 3.3.3.3

[P2] mpls te

[P2-te] quit

[P2] interface hundredgige 1/0/1

[P2-HundredGigE1/0/1] mpls enable

[P2-HundredGigE1/0/1] quit

[P2] interface hundredgige 1/0/2

[P2-HundredGigE1/0/2] mpls enable

[P2-HundredGigE1/0/2] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[P2] isis 1

[P2-isis-1] segment-routing global-block 18000 18999

[P2-isis-1] address-family ipv4

[P2-isis-1-ipv4] segment-routing mpls

[P2-isis-1-ipv4] quit

[P2-isis-1] quit

# 配置前綴SID索引。

[P2] interface loopback 1

[P2-LoopBack1] isis prefix-sid index 30

[P2-LoopBack1] quit

(6)     配置PE 2

# 配置IS-IS協議實現網絡層互通,開銷值類型為wide。

<PE2> system-view

[PE2] isis 1

[PE2-isis-1] network-entity 00.0000.0000.0004.00

[PE2-isis-1] cost-style wide

[PE2-isis-1] quit

[PE2] interface hundredgige 1/0/2

[PE2-HundredGigE1/0/2] isis enable 1

[PE2-HundredGigE1/0/2] quit

[PE2] interface hundredgige 1/0/3

[PE2-HundredGigE1/0/3] isis enable 1

[PE2-HundredGigE1/0/3] quit

[PE2] interface loopback 1

[PE2-LoopBack1] isis enable 1

[PE2-LoopBack1] quit

# 配置節點的MPLS LSR ID、開啟MPLS能力和MPLS TE能力。

[PE2] mpls lsr-id 4.4.4.4

[PE2] mpls te

[PE2-te] quit

[PE2] interface hundredgige 1/0/2

[PE2-HundredGigE1/0/2] mpls enable

[PE2-HundredGigE1/0/2] quit

[PE2] interface hundredgige 1/0/3

[PE2-HundredGigE1/0/3] mpls enable

[PE2-HundredGigE1/0/3] quit

# 配置IS-IS SR的SRGB,同時在IS-IS IPv4單播地址族視圖下開啟SR-MPLS功能。

[PE2] isis 1

[PE2-isis-1] segment-routing global-block 19000 19999

[PE2-isis-1] address-family ipv4

[PE2-isis-1-ipv4] segment-routing mpls

[PE2-isis-1-ipv4] quit

[PE2-isis-1] quit

# 配置前綴SID索引。

[PE2] interface loopback 1

[PE2-LoopBack1] isis prefix-sid index 40

[PE2-LoopBack1] quit

# 創建VPN實例,配置CE接入PE。

[PE2] ip vpn-instance vpna

[PE2-vpn-instance-vpna] route-distinguisher 200:1

[PE2-vpn-instance-vpna] vpn-target 111:1

[PE2-vpn-instance-vpna] quit

[PE2-vpn-ipv4-vpna] quit

[PE2] interface hundredgige 1/0/1

[PE2-HundredGigE1/0/1] ip binding vpn-instance vpna

[PE2-HundredGigE1/0/1] ip address 10.2.1.2 255.255.255.0

# 配置BGP

[PE2] bgp 100

[PE2-bgp-default] peer 1.1.1.1 as-number 100

[PE2-bgp-default] peer 1.1.1.1 connect-interface LoopBack1

[PE2-bgp-default] address-family vpnv4

[PE2-bgp-default-vpnv4] peer 1.1.1.1 enable

[PE2-bgp-default-vpnv4] quit

[PE2-bgp-default] address-family ipv4 sr-policy

[PE2-bgp-default-sr-policy-ipv4] import-route sr-policy

[PE2-bgp-default-sr-policy-ipv4] peer 1.1.1.1 enable

[PE2-bgp-default-sr-policy-ipv4] quit

[PE2-bgp-default] ip vpn-instance vpna

[PE2-bgp-default-vpna] peer 10.2.1.1 as-number 65410

[PE2-bgp-default-vpna] address-family ipv4 unicast

[PE2-bgp-default-ipv4-vpna] peer 10.2.1.1 enable

[PE2-bgp-default-ipv4-vpna] quit

[PE2-bgp-default-vpna] quit

[PE2-bgp-default] quit

(7)     配置CE 2

[CE2] bgp 65420

[CE2-bgp-default] peer 10.2.1.2 as-number 100

[CE2-bgp-default] address-family ipv4 unicast

[CE2-bgp-default-ipv4] import-route direct

[CE2-bgp-default-ipv4] peer 10.2.1.2 enable

5. 驗證配置

# 在PE 1上查看去往CE 2的路由情況,可以看到路由迭代到隧道,實現DSCP引流。

[PE1] display ip routing-table vpn-instance vpna 10.2.1.0 verbose

 

Summary count : 1

 

 Destination: 10.2.1.0/24

    Protocol: BGP instance default

  Process ID: 0

   SubProtID: 0x1                       Age: 00h01m08s

  FlushedAge: 00h01m19s

        Cost: 0                  Preference: 255

       IpPre: N/A                QosLocalID: N/A

         Tag: 0                       State: Active Adv

   OrigTblID: 0x0                   OrigVrf: default-vrf

     TableID: 0x102                  OrigAs: 65420

       NibID: 0x16000002             LastAs: 65420

      AttrID: 0x4                  Neighbor: 4.4.4.4

       Flags: 0x110060          OrigNextHop: 4.4.4.4

       Label: 1151              RealNextHop: 14.0.0.4

     BkLabel: NULL                BkNextHop: N/A

     SRLabel: NULL                Interface: HundredGigE1/0/3

   BkSRLabel: NULL              BkInterface: N/A

   Tunnel ID: 0x1800001         IPInterface: HundredGigE1/0/3

 BkTunnel ID: Invalid         BkIPInterface: N/A

     InLabel: 0              ColorInterface: N/A

    SIDIndex: 0            BkColorInterface: N/A

    FtnIndex: 0x0           TunnelInterface: N/A

TrafficIndex: N/A         BkTunnelInterface: N/A

   Connector: N/A                    PathID: 0x0

      UserID: 0x0                SRTunnelID: Invalid

    SID Type: N/A                       NID: Invalid

    FlushNID: 0x1800001               BkNID: Invalid

  BkFlushNID: Invalid             StatFlags: 0x0

         SID: N/A

       BkSID: N/A

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們