10-基於MPLS的靜態SR配置
本章節下載: 10-基於MPLS的靜態SR配置 (223.16 KB)
SR(Segment Routing,段路由)采用源路徑選擇機製,預先在源節點封裝好路徑所有經過節點的SID(Segment Identifier,段標識),當報文經過SR節點時,該節點根據報文的SID對報文進行處理。SID可以有本地意義,也可以是整網有意義的標識。由於采用源路徑選擇機製,源節點可以根據需要選擇任意可達的路徑或目的節點,除源節點外,其它節點無需維護路徑狀態。
SR的段類型有如下兩種:
· Prefix Segment:前綴類型的段,按目的地址前綴建立轉發表項,源節點按目的地址最短路徑轉發報文,其它節點按前綴分配SID。
· Adjacency Segment:鄰接表類型的段,所有節點按鏈路為不同鄰居分配SID,源節點按需選擇所需要經過節點,預先封裝好路徑所有經過節點的SID。
基於MPLS的SR(Segment Routing with MPLS,MPLS段路由)是指在MPLS網絡中使用SR時,將標簽作為SID對報文進行轉發。
通常情況下,MPLS TE隧道由一條或一組CRLSP構成,SRLSP(Segment Routing Label Switched Paths,基於段路由的LSP)是一種特殊的CRLSP,基於SR建立。
頭節點上MPLS TE隧道由MPLS TE模式的Tunnel接口標識。當流量的出接口為Tunnel接口時,該流量將通過構成MPLS TE隧道的SRLSP來轉發。
目前僅支持通過靜態Adjacency方式建立SRLSP,不依靠標簽分發協議,而是在報文經過的每一跳設備上分別手工指定入標簽、出標簽等信息。如圖1-1所示,報文轉發過程如下:
(1) 在頭節點Device A封裝好所有經過節點鄰接路徑的標簽棧Out label(201,202,203)。
(2) 中間節點Device B鄰接路徑標簽In label為201,刪除標簽棧最外層標簽(201)後,發送給下一個中間節點Device C繼續轉發。
(3) 報文到達尾節點Device E後,Device E收到是一個IP報文,按IP轉發即可。
圖1-1 靜態SRLSP轉發過程示意圖(Adjacency方式)
與segment routing相關的協議規範有:
· draft-ietf-spring-segment-routing-mpls-00
· draft-ietf-spring-segment-routing-02
基於MPLS的靜態SR的配置主要包括以下幾步:
(1) 在MPLS TE隧道經過的各個節點和接口上開啟MPLS TE能力,配置方法請參見“MPLS配置指導”中的“MPLS TE”。
(2) 在MPLS TE隧道的Ingress節點上創建Tunnel接口,指定隧道的目的端地址(即Egress的地址),配置方法請參見“MPLS配置指導”中的“MPLS TE”。
(3) 在MPLS TE隧道的Ingress節點上配置靜態SRLSP。
(4) 在MPLS TE隧道的Ingress節點上配置Tunnel接口引用已經創建的靜態SRLSP。
(5) 在MPLS TE隧道的Ingress節點上配置靜態路由或策略路由,將流量引入MPLS TE隧道,配置方法請參見“MPLS配置指導”中的“MPLS TE”。
(6) 在MPLS TE隧道經過的各個Transit節點上配置靜態SRLSP的鄰接路徑信息。
(7) 配置Egress節點的入標簽,配置方法請參見“MPLS配置指導”中的“靜態CRLSP”。
表1-1 靜態SR-MPLS配置任務簡介
配置任務 |
說明 |
詳細配置 |
配置靜態SRLSP |
必選 僅Ingress節點需要完成本配置 |
|
配置MPLS TE隧道采用靜態SRLSP |
必選 僅Ingress節點需要完成本配置 |
|
配置靜態SRLSP的鄰接路徑信息 |
必選 僅Transit節點需要完成本配置 |
在配置靜態MPLS SRLSP之前,需完成以下任務:
· 確定靜態LSP的Ingress節點、Transit節點和Egress節點。
· 規劃每個Transit節點到下一跳的鄰接路徑的入標簽值。需要注意的是,靜態SRLSP與靜態LSP、靜態CRLSP使用相同的標簽空間,在同一台設備上靜態SRLSP、靜態CRLSP和靜態LSP的入標簽不能相同。
· 在參與MPLS轉發的設備接口上使能MPLS功能,配置方法請參見“MPLS配置指導”中的“MPLS基本配置”。
隻有在Ingress節點創建MPLS TE隧道模式的Tunnel接口,並在該接口下引用靜態SRLSP後,該靜態SRLSP才能用來轉發MPLS TE流量。MPLS TE的詳細介紹,請參見“MPLS配置指導”中的“MPLS TE”。
表1-2 建立靜態SRLSP
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置靜態SRLSP |
static-sr-mpls lsp lsp-name out-label out-label-value&<1-7> |
缺省情況下,不存在靜態SRLSP |
MPLS TE隧道采用靜態SRLSP的配置過程非常簡單,隻需要在Ingress節點上指定MPLS TE隧道采用靜態方式建立、並配置MPLS TE隧道引用已建立的靜態SRLSP即可。
表1-3 配置MPLS TE隧道采用靜態SRLSP
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入模式為MPLS TE隧道的Tunnel接口視圖 |
interface tunnel tunnel-number [ mode mpls-te ] |
- |
配置使用靜態SRLSP建立MPLS TE隧道 |
mpls te signaling static |
缺省情況下,MPLS TE使用RSVP-TE信令協議建立隧道 |
指定隧道引用的靜態SRLSP |
mpls te static-sr-lsp lsp-name |
缺省情況下,隧道沒有引用任何靜態SRLSP |
與一般的靜態CRLSP不同,多條靜態SRLSP如果存在公共路徑,公共路徑節點的鄰接路徑信息一致,不需要進行多次配置。
表1-4 建立靜態SRLSP
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置靜態SRLSP的鄰接路徑信息 |
static-sr-mpls adjacency adjacency-path-name in-label label-value { nexthop ip-address | outgoing-interface interface-type interface-number } |
缺省情況下,不存在鄰接路徑 指定的下一跳地址不能是本地設備上的公網IP地址 |
在完成上述配置後,在任意視圖下執行display命令可以顯示配置後靜態SRLSP的運行情況,用戶可以通過查看顯示信息驗證配置的效果。
表1-5 靜態SRLSP顯示和維護
操作 |
命令 |
顯示靜態SRLSP信息 |
display mpls static-sr-lsp [ lsp lsp-name | adjacency adjacency-path-name ] |
· 設備Switch A、Switch B、Switch C、Switch E和Switch F運行IS-IS。
· 使用靜態SRLSP建立一條Switch A到Switch D的MPLS TE隧道,實現兩個IP網絡通過MPLS TE隧道傳輸數據流量。
· 使用靜態SRLSP建立另外一條Switch E到Switch F的MPLS TE隧道,實現兩個IP網絡通過MPLS TE隧道傳輸數據流量。
圖1-2 靜態SRLSP配置組網圖
設備 |
接口 |
IP地址 |
設備 |
接口 |
IP地址 |
Switch A |
Loop0 |
1.1.1.9/32 |
Switch B |
Loop0 |
2.2.2.9/32 |
|
Vlan-int10 |
100.1.1.1/24 |
|
Vlan-int10 |
10.1.1.2/24 |
|
Vlan-int20 |
10.1.1.1/24 |
|
Vlan-int20 |
20.1.1.1/24 |
|
|
|
|
Vlan-int30 |
40.1.1.1/24 |
Switch C |
Loop0 |
3.3.3.9/32 |
Switch D |
Loop0 |
4.4.4.9/32 |
|
Vlan-int10 |
30.1.1.1/24 |
|
Vlan-int10 |
100.1.2.1/24 |
|
Vlan-int20 |
20.1.1.2/24 |
|
Vlan-int20 |
30.1.1.2/24 |
|
Vlan-int30 |
50.1.1.1/24 |
|
|
|
Switch E |
Loop0 |
5.5.5.9/32 |
Switch F |
Loop0 |
6.6.6.9/32 |
|
Vlan-int10 |
200.1.1.1/24 |
|
Vlan-int10 |
200.1.2.1/24 |
|
Vlan-int20 |
40.1.1.2/24 |
|
Vlan-int20 |
50.1.1.2/24 |
(1) 配置各接口的IP地址
按照圖1-2配置各接口的IP地址和掩碼,具體配置過程略。
(2) 配置IS-IS協議發布接口所在網段的路由,包括Loopback接口,具體配置過程略。
配置完成後,在各設備上執行display ip routing-table命令,可以看到相互之間都學到了到對方的路由,包括Loopback接口對應的主機路由。
(3) 配置LSR ID、開啟MPLS能力和MPLS TE能力
# 配置Switch A。
[SwitchA] mpls lsr-id 1.1.1.9
[SwitchA] mpls te
[SwitchA-te] quit
[SwitchA] interface vlan-interface 20
[SwitchA-Vlan-interface20] mpls enable
[SwitchA-Vlan-interface20] mpls te enable
[SwitchA-Vlan-interface20] quit
# 配置Switch B。
[SwitchB] mpls lsr-id 2.2.2.9
[SwitchB] mpls te
[SwitchB-te] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] mpls enable
[SwitchB-Vlan-interface10] mpls te enable
[SwitchB-Vlan-interface10] quit
[SwitchB] interface vlan-interface 20
[SwitchB-Vlan-interface20] mpls enable
[SwitchB-Vlan-interface20] mpls te enable
[SwitchB-Vlan-interface20] quit
[SwitchB] interface vlan-interface 30
[SwitchB-Vlan-interface30] mpls enable
[SwitchB-Vlan-interface30] mpls te enable
[SwitchB-Vlan-interface30] quit
# 配置Switch C。
[SwitchC] mpls lsr-id 3.3.3.9
[SwitchC] mpls te
[SwitchC-te] quit
[SwitchC] interface vlan-interface 10
[SwitchC-Vlan-interface10] mpls enable
[SwitchC-Vlan-interface10] mpls te enable
[SwitchC-Vlan-interface10] quit
[SwitchC] interface vlan-interface 20
[SwitchC-Vlan-interface20] mpls enable
[SwitchC-Vlan-interface20] mpls te enable
[SwitchC-Vlan-interface20] quit
[SwitchC] interface vlan-interface 30
[SwitchC-Vlan-interface30] mpls enable
[SwitchC-Vlan-interface30] mpls te enable
[SwitchC-Vlan-interface30] quit
# 配置Switch D。
[SwitchD] mpls lsr-id 4.4.4.9
[SwitchD] mpls te
[SwitchD-te] quit
[SwitchD] interface vlan-interface 20
[SwitchD-Vlan-interface20] mpls enable
[SwitchD-Vlan-interface20] mpls te enable
[SwitchD-Vlan-interface20] quit
# 配置Switch E。
[SwitchE] mpls lsr-id 5.5.5.9
[SwitchE] mpls te
[SwitchE-te] quit
[SwitchE] interface vlan-interface 20
[SwitchE-Vlan-interface20] mpls enable
[SwitchE-Vlan-interface20] mpls te enable
[SwitchE-Vlan-interface20] quit
# 配置Switch F。
[SwitchF] mpls lsr-id 6.6.6.9
[SwitchF] mpls te
[SwitchF-te] quit
[SwitchF] interface vlan-interface 20
[SwitchF-Vlan-interface20] mpls enable
[SwitchF-Vlan-interface20] mpls te enable
[SwitchF-Vlan-interface20] quit
(4) 配置MPLS TE隧道
# 在Switch A上配置到Switch D的MPLS TE隧道Tunnel0:目的地址為Switch D的LSR ID(4.4.4.9);采用靜態SRLSP建立MPLS TE隧道。
[SwitchA] interface tunnel 0 mode mpls-te
[SwitchA-Tunnel0] ip address 6.1.1.1 255.255.255.0
[SwitchA-Tunnel0] destination 4.4.4.9
[SwitchA-Tunnel0] mpls te signaling static
[SwitchA-Tunnel0] quit
# 在Switch E上配置到Switch F的MPLS TE隧道Tunnel0:目的地址為Switch F的LSR ID(6.6.6.9);采用靜態SRLSP建立MPLS TE隧道。
[SwitchE] interface tunnel 0 mode mpls-te
[SwitchE-Tunnel0] ip address 7.1.1.1 255.255.255.0
[SwitchE-Tunnel0] destination 6.6.6.9
[SwitchE-Tunnel0] mpls te signaling static
[SwitchE-Tunnel0] quit
(5) 創建靜態SRLSP
# 配置Switch A為靜態SRLSP的Ingress節點,出標簽棧為[20,30]。
[SwitchA] static-sr-mpls lsp static-sr-lsp-1 out-label 20 30
# 配置Switch E為靜態SRLSP的Ingress節點,出標簽棧為[20,40]。
[SwitchE] static-sr-mpls lsp static-sr-lsp-2 out-label 20 40
# 在Switch A上配置隧道Tunnel0引用名稱為static-sr-lsp-1的靜態SRLSP。
[SwitchA] interface Tunnel0
[SwitchA-Tunnel0] mpls te static-sr-mpls static-sr-lsp-1
[SwitchA-Tunnel0] quit
# 在Switch E上配置隧道Tunnel0引用名稱為static-sr-lsp-2的靜態SRLSP。
[SwitchE] interface Tunnel0
[SwitchE-Tunnel0] mpls te static-sr-mpls static-sr-lsp-2
[SwitchE-Tunnel0] quit
# 配置Switch B為靜態SRLSP的Transit節點,為下一跳地址20.1.1.2綁定標簽20。
[SwitchB] static-sr-mpls adjacency adjacency-1 in-label 20 nexthop 20.1.1.2
# 配置Switch C為靜態SRLSP的Transit節點,為下一跳地址30.1.1.2和50.1.1.2分別綁定標簽30、40。
[SwitchC] static-sr-mpls adjacency adjacency-1 in-label 30 nexthop 30.1.1.2
[SwitchC] static-sr-mpls adjacency adjacency-2 in-label 40 nexthop 50.1.1.2
# 配置Switch D為靜態SRLSP的Egress節點,入標簽為30。
[SwitchD] static-cr-lsp egress static-cr-lsp-1 in-label 30
# 配置Switch F為靜態SRLSP的Egress節點,入標簽為40。
[SwitchF] static-cr-lsp egress static-cr-lsp-1 in-label 40
(6) 配置靜態路由使流量沿MPLS TE隧道轉發
# 在Switch A上配置靜態路由,使得到達網絡100.1.2.0/24的流量通過MPLS TE隧道接口Tunnel0轉發。
[SwitchA] ip route-static 100.1.2.0 24 tunnel 0 preference 1
# 在Switch E上配置靜態路由,使得到達網絡200.1.2.0/24的流量通過MPLS TE隧道接口Tunnel0轉發。
[SwitchE] ip route-static 200.1.2.0 24 tunnel 0 preference 1
# 在Switch A上執行display mpls te tunnel-interface命令,可以看到MPLS TE隧道的建立情況。
[SwitchA] display mpls te tunnel-interface
Tunnel Name : Tunnel 0
Tunnel State : Up (Main CRLSP up)
Tunnel Attributes :
LSP ID : 1 Tunnel ID : 0
Admin State : Normal
Ingress LSR ID : 1.1.1.9 Egress LSR ID : 4.4.4.9
Signaling : Static Static CRLSP Name : -
Static SRLSP Name : static-sr-lsp-1/-
Resv Style : -
Tunnel mode : -
Reverse-LSP name : -
Reverse-LSP LSR ID : - Reverse-LSP Tunnel ID: -
Class Type : - Tunnel Bandwidth : -
Reserved Bandwidth : -
Setup Priority : 0 Holding Priority : 0
Affinity Attr/Mask : -/-
Explicit Path : -
Backup Explicit Path : -
Metric Type : TE
Record Route : - Record Label : -
FRR Flag : - Bandwidth Protection : -
Backup Bandwidth Flag: - Backup Bandwidth Type: -
Backup Bandwidth : -
Bypass Tunnel : - Auto Created : -
Route Pinning : -
Retry Limit : 3 Retry Interval : 2 sec
Reoptimization : - Reoptimization Freq : -
Backup Type : - Backup LSP ID : -
Auto Bandwidth : - Auto Bandwidth Freq : -
Min Bandwidth : - Max Bandwidth : -
Collected Bandwidth : -
# 在Switch E上執行display mpls te tunnel-interface命令,可以看到MPLS TE隧道的建立情況。
[SwitchE] display mpls te tunnel-interface
Tunnel Name : Tunnel 0
Tunnel State : Up (Main CRLSP up)
Tunnel Attributes :
LSP ID : 1 Tunnel ID : 0
Admin State : Normal
Ingress LSR ID : 5.5.5.9 Egress LSR ID : 6.6.6.9
Signaling : Static Static CRLSP Name : -
Static SRLSP Name : static-sr-lsp-2/-
Resv Style : -
Tunnel mode : -
Reverse-LSP name : -
Reverse-LSP LSR ID : - Reverse-LSP Tunnel ID: -
Class Type : - Tunnel Bandwidth : -
Reserved Bandwidth : -
Setup Priority : 0 Holding Priority : 0
Affinity Attr/Mask : -/-
Explicit Path : -
Backup Explicit Path : -
Metric Type : TE
Record Route : - Record Label : -
FRR Flag : - Bandwidth Protection : -
Backup Bandwidth Flag: - Backup Bandwidth Type: -
Backup Bandwidth : -
Bypass Tunnel : - Auto Created : -
Route Pinning : -
Retry Limit : 3 Retry Interval : 2 sec
Reoptimization : - Reoptimization Freq : -
Backup Type : - Backup LSP ID : -
Auto Bandwidth : - Auto Bandwidth Freq : -
Min Bandwidth : - Max Bandwidth : -
Collected Bandwidth : -
# 在各設備上執行display mpls lsp或display mpls static-cr-lsp命令,可以看到靜態CRLSP的建立情況。
[SwitchA] display mpls lsp
FEC Proto In/Out Label Interface/Out NHLFE
1.1.1.1/0/1 StaticCR -/20 Vlan20
30
[SwitchB] display mpls lsp
FEC Proto In/Out Label Interface/Out NHLFE
- StaticCR 20/- Vlan20
[SwitchC] display mpls lsp
FEC Proto In/Out Label Interface/Out NHLFE
- StaticCR 30/- Vlan10
- StaticCR 40/- Vlan30
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!