05-靜態CRLSP配置
本章節下載: 05-靜態CRLSP配置 (219.01 KB)
靜態CRLSP(Constraint-based Routed Label Switched Paths,基於約束路由的LSP)是指在報文經過的每一跳設備上(包括Ingress、Transit和Egress)分別手工指定入標簽、出標簽、流量所需的帶寬等信息,建立標簽轉發表項和資源預留,從而建立的CRLSP。靜態CRLSP與靜態LSP的區別是:靜態CRLSP需要在每一跳設備上為流量預留一定的帶寬資源,如果設備上的帶寬資源不滿足流量需求,則無法建立靜態CRLSP。
建立靜態CRLSP消耗的資源比較少,但靜態建立的CRLSP不能根據網絡拓撲變化動態調整。因此,靜態CRLSP適用於拓撲結構簡單並且穩定的小型網絡。
建立靜態CRLSP時,靜態CRLSP經過的不同類型的節點上配置內容有所不同:
· Ingress:在Ingress上需要指定CRLSP的出標簽、下一跳或到達下一跳的出接口、流量所需的帶寬。在Ingress上創建MPLS TE隧道模式的Tunnel接口,並在該接口下引用指定的靜態CRLSP後,如果需要通過Tunnel接口轉發報文,則為該報文添加指定靜態CRLSP的出標簽,並將報文轉發給指定的下一跳,或通過出接口轉發該報文。
· Transit:Transit根據報文中攜帶的標簽值,查找標簽轉發表項,用新的標簽替換原有標簽。因此,Transit上需要指定入標簽對應的出標簽、CRLSP的下一跳或到達下一跳的出接口、流量所需的帶寬。Transit接收到帶有標簽的報文後,將報文中的標簽替換為該標簽對應的出標簽,並將報文轉發給指定的下一跳,或通過出接口轉發該報文。
· Egress:如果沒有在倒數第二跳彈出標簽,則Egress負責彈出報文中的標簽,並對報文進行下一層轉發處理。因此,Egress上隻需指定入標簽值。Egress接收到帶有指定入標簽值的報文後,彈出該標簽。
配置Ingress、Transit、Egress時,需要遵循以下原則:相鄰兩個LSR(Label Switching Router,標簽交換路由器)之間,上遊LSR的出標簽值和下遊LSR的入標簽值必須相同。
在配置靜態CRLSP之前,需完成以下任務:
· 確定靜態CRLSP的Ingress節點、Transit節點和Egress節點。
· 在參與MPLS轉發的設備接口上使能MPLS功能,配置方法請參見“MPLS配置指導”中的“MPLS基本配置”。
· 在Ingress、Transit和Egress節點上開啟本節點的MPLS TE能力,並在CRLSP經過的接口上開啟接口的MPLS TE能力,配置方法請參見“MPLS配置指導”中的“MPLS TE”。
· 靜態CRLSP作為一種特殊的靜態LSP,與靜態LSP使用相同的標簽空間,在同一台設備上靜態CRLSP和靜態LSP的入標簽不能相同。
· 隻有在Ingress節點創建MPLS TE隧道模式的Tunnel接口,並在該接口下引用靜態CRLSP後,該靜態CRLSP才能用來轉發MPLS TE流量。MPLS TE的詳細介紹,請參見“MPLS配置指導”中的“MPLS TE”。
表1-1 建立靜態CRLSP
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置靜態CRLSP的Ingress節點 |
static-cr-lsp ingress lsp-name { nexthop ip-address | outgoing-interface interface-type interface-number } out-label out-label-value [ bandwidth [ ct0 | ct1 | ct2 | ct3 ] bandwidth-value ] |
請根據節點在靜態CRLSP上的位置從三者中選擇其一 缺省情況下,不存在靜態CRLSP 配置靜態CRLSP的Ingress節點和Transit節點時,指定的下一跳地址不能是本地設備上的公網IP地址 如果靜態CRLSP的倒數第二跳節點上配置的出標簽為0或3,則不需要在Egress節點上執行本命令 |
配置靜態CRLSP的Transit節點 |
static-cr-lsp transit lsp-name in-label in-label-value { nexthop ip-address | outgoing-interface interface-type interface-number } out-label out-label-value [ bandwidth [ ct0 | ct1 | ct2 | ct3 ] bandwidth-value ] |
|
配置靜態CRLSP的Egress節點 |
static-cr-lsp egress lsp-name in-label in-label-value |
在完成上述配置後,在任意視圖下執行display命令可以顯示配置後靜態CRLSP的運行情況,用戶可以通過查看顯示信息驗證配置的效果。
表1-2 靜態CRLSP顯示和維護
操作 |
命令 |
顯示靜態CRLSP信息 |
display mpls static-cr-lsp [ lsp-name lsp-name ] [ verbose ] |
· 設備Switch A、Switch B和Switch C運行IS-IS;
· 使用靜態CRLSP建立一條Switch A到Switch C的MPLS TE隧道,實現兩個IP網絡通過MPLS TE隧道傳輸數據流量,該隧道需要的帶寬為2000kbps;
· 隧道沿途的鏈路最大帶寬為10000kbps。
圖1-1 靜態CRLSP配置組網圖
(1) 配置各接口的IP地址
按照圖1-1配置各接口的IP地址和掩碼,具體配置過程略。
(2) 配置IS-IS協議發布接口所在網段的路由,包括Loopback接口
# 配置Switch A。
<SwitchA> system-view
[SwitchA] isis 1
[SwitchA-isis-1] network-entity 00.0005.0000.0000.0001.00
[SwitchA-isis-1] quit
[SwitchA] interface vlan-interface 1
[SwitchA-Vlan-interface1] isis enable 1
[SwitchA-Vlan-interface1] quit
[SwitchA] interface loopback 0
[SwitchA-LoopBack0] isis enable 1
[SwitchA-LoopBack0] quit
# 配置Switch B。
<SwitchB> system-view
[SwitchB] isis 1
[SwitchB-isis-1] network-entity 00.0005.0000.0000.0002.00
[SwitchB-isis-1] quit
[SwitchB] interface vlan-interface 1
[SwitchB-Vlan-interface1] isis enable 1
[SwitchB-Vlan-interface1] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] isis enable 1
[SwitchB-Vlan-interface2] quit
[SwitchB] interface loopback 0
[SwitchB-LoopBack0] isis enable 1
[SwitchB-LoopBack0] quit
# 配置Switch C。
<SwitchC> system-view
[SwitchC] isis 1
[SwitchC-isis-1] network-entity 00.0005.0000.0000.0003.00
[SwitchC-isis-1] quit
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] isis enable 1
[SwitchC-Vlan-interface2] quit
[SwitchC] interface loopback 0
[SwitchC-LoopBack0] isis enable 1
[SwitchC-LoopBack0] quit
配置完成後,在各設備上執行display ip routing-table命令,可以看到相互之間都學到了到對方的路由,包括Loopback接口對應的主機路由。
(3) 配置LSR ID、開啟MPLS能力和MPLS TE能力
# 配置Switch A。
[SwitchA] mpls lsr-id 1.1.1.1
[SwitchA] mpls te
[SwitchA-te] quit
[SwitchA] interface vlan-interface 1
[SwitchA-Vlan-interface1] mpls enable
[SwitchA-Vlan-interface1] mpls te enable
[SwitchA-Vlan-interface1] quit
# 配置Switch B。
[SwitchB] mpls lsr-id 2.2.2.2
[SwitchB] mpls te
[SwitchB-te] quit
[SwitchB] interface vlan-interface 1
[SwitchB-Vlan-interface1] mpls enable
[SwitchB-Vlan-interface1] mpls te enable
[SwitchB-Vlan-interface1] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] mpls enable
[SwitchB-Vlan-interface2] mpls te enable
[SwitchB-Vlan-interface2] quit
# 配置Switch C。
[SwitchC] mpls lsr-id 3.3.3.3
[SwitchC] mpls te
[SwitchC-te] quit
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] mpls enable
[SwitchC-Vlan-interface2] mpls te enable
[SwitchC-Vlan-interface2] quit
(4) 配置鏈路的MPLS TE屬性
# 在Switch A上配置鏈路的最大帶寬。
[SwitchA] interface vlan-interface 1
[SwitchA-Vlan-interface1] mpls te max-link-bandwidth 10000
[SwitchA-Vlan-interface1] quit
# 在Switch B上配置鏈路的最大帶寬。
[SwitchB] interface vlan-interface 1
[SwitchB-Vlan-interface1] mpls te max-link-bandwidth 10000
[SwitchB-Vlan-interface1] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] mpls te max-link-bandwidth 10000
[SwitchB-Vlan-interface2] quit
# 在Switch C上配置鏈路的最大帶寬。
[SwitchC] interface vlan-interface 2
[SwitchC-Vlan-interface2] mpls te max-link-bandwidth 10000
[SwitchC-Vlan-interface2] quit
(5) 配置MPLS TE隧道
# 在Switch A上配置MPLS TE隧道Tunnel1:目的地址為Switch C的LSR ID(3.3.3.3);采用靜態CRLSP建立MPLS TE隧道。
[SwitchA] interface tunnel 1 mode mpls-te
[SwitchA-Tunnel1] ip address 6.1.1.1 255.255.255.0
[SwitchA-Tunnel1] destination 3.3.3.3
[SwitchA-Tunnel1] mpls te signaling static
[SwitchA-Tunnel1] quit
(6) 創建靜態CRLSP
# 配置Switch A為靜態CRLSP的Ingress節點,下一跳地址為2.1.1.2,出標簽為20,隧道所需的帶寬為2000kbps。
[SwitchA] static-cr-lsp ingress static-cr-lsp-1 nexthop 2.1.1.2 out-label 20 bandwidth 2000
# 在Switch A上配置隧道Tunnel1引用名稱為static-cr-lsp-1的靜態CRLSP。
[SwitchA] interface tunnel 1
[SwitchA-Tunnel1] mpls te static-cr-lsp static-cr-lsp-1
[SwitchA-Tunnel1] quit
# 配置Switch B為靜態CRLSP的Transit節點,入標簽為20,下一跳地址為3.2.1.2,出標簽為30,隧道所需的帶寬為2000kbps。
[SwitchB] static-cr-lsp transit static-cr-lsp-1 in-label 20 nexthop 3.2.1.2 out-label 30 bandwidth 2000
# 配置Switch C為靜態CRLSP的Egress節點,入標簽為30。
[SwitchC] static-cr-lsp egress static-cr-lsp-1 in-label 30
(7) 配置靜態路由使流量沿MPLS TE隧道轉發
# 在Switch A上配置靜態路由,使得到達網絡100.1.2.0/24的流量通過MPLS TE隧道接口Tunnel1轉發。
[SwitchA] ip route-static 100.1.2.0 24 tunnel 1 preference 1
# 配置完成後,在Switch A上執行display interface tunnel命令,可以看到Tunnel接口的狀態為up。
[SwitchA] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64kbps
Maximum transmission unit: 1496
Internet address: 6.1.1.1/24 (primary)
Tunnel source unknown, destination 3.3.3.3
Tunnel TTL 255
Tunnel protocol/transport CR_LSP
Last clearing of counters: Never
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 在Switch A上執行display mpls te tunnel-interface命令,可以看到MPLS TE隧道的建立情況。
[SwitchA] display mpls te tunnel-interface
Tunnel Name : Tunnel 1
Tunnel State : Up (Main CRLSP up)
Tunnel Attributes :
LSP ID : 1 Tunnel ID : 0
Admin State : Normal
Ingress LSR ID : 1.1.1.1 Egress LSR ID : 3.3.3.3
Signaling : Static Static CRLSP Name : static-cr-lsp-1
Static SRLSP Name : -/-
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 : - Backup Bandwidth Flag: -
Backup Bandwidth Type: - Backup Bandwidth : -
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 : - Service-Class : -
Path Setup Type : -/-
# 在各設備上執行display mpls lsp或display mpls static-cr-lsp命令,可以看到靜態CRLSP的建立情況。
[SwitchA] display mpls lsp
FEC Proto In/Out Label Out Inter/NHLFE/LSINDEX
1.1.1.1/0/1 StaticCR -/20 Vlan1
2.1.1.2 Local -/- Vlan1
[SwitchB] display mpls lsp
FEC Proto In/Out Label Out Inter/NHLFE/LSINDEX
- StaticCR 20/30 Vlan2
3.2.1.2 Local -/- Vlan2
[SwitchC] display mpls lsp
FEC Proto In/Out Label Out Inter/NHLFE/LSINDEX
- StaticCR 30/- -
[SwitchA] display mpls static-cr-lsp
Name LSR Type In/Out Label Out Interface State
static-cr-lsp-1 Ingress Null/20 Vlan1 Up
[SwitchB] display mpls static-cr-lsp
Name LSR Type In/Out Label Out Interface State
static-cr-lsp-1 Transit 20/30 Vlan2 Up
[SwitchC] display mpls static-cr-lsp
Name LSR Type In/Out Label Out Interface State
static-cr-lsp1 Egress 30/Null - Up
# 在Switch A上執行display ip routing-table命令,可以看到路由表中有以Tunnel1為出接口的靜態路由信息。
[SwitchA] display ip routing-table
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.1.1.0/24 Direct 0 0 2.1.1.1 Vlan1
2.1.1.0/32 Direct 0 0 2.1.1.1 Vlan1
2.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.1.1.255/32 Direct 0 0 2.1.1.1 Vlan1
2.2.2.2/32 IS_L1 15 10 2.1.1.2 Vlan1
100.1.2.0/24 Static 1 0 0.0.0.0 Tun1
3.3.3.3/32 IS_L1 15 20 2.1.1.2 Vlan1
6.1.1.0/24 Direct 0 0 6.1.1.1 Tun1
6.1.1.0/32 Direct 0 0 6.1.1.1 Tun1
6.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
6.1.1.255/32 Direct 0 0 6.1.1.1 Tun1
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!