02-靜態LSP配置
本章節下載: 02-靜態LSP配置 (207.30 KB)
目 錄
不依靠標簽分發協議,而是在報文經過的每一跳設備上(包括Ingress、Transit和Egress)分別手工指定入標簽、出標簽等信息,建立標簽轉發表項,采用這種方式建立的LSP(Label Switched Path,標簽交換路徑),稱為靜態LSP。
建立靜態LSP消耗的資源比較少,但靜態建立的LSP不能根據網絡拓撲變化動態調整。因此,靜態LSP適用於拓撲結構簡單並且穩定的小型網絡。
配置Ingress、Transit、Egress時,需要遵循以下原則:相鄰兩個LSR(Label Switching Router,標簽交換路由器)之間,上遊LSR的出標簽值和下遊LSR的入標簽值必須相同。
LSP是一條單向路徑,在數據傳輸的兩個方向上需要分別配置一條靜態LSP。
僅高級模式和專家模式支持靜態LSP功能。有關設備的工作模式的詳細介紹,請參見“基礎配置指導”中的“設備管理”。
隧道報文不支持MPLS轉發。
在配置靜態LSP之前,需完成以下任務:
· 確定靜態LSP的Ingress節點、Transit節點和Egress節點。
· 在參與MPLS轉發的設備接口上使能MPLS功能,配置方法請參見“MPLS配置指導”中的“MPLS基本配置”。
· 在Ingress節點上建立靜態LSP時,需確保該節點上存在FEC目的地址對應的路由。
Ingress節點根據報文的目的IP地址劃分FEC(Forwarding Equivalence Class,轉發等價類),為報文添加該FEC對應的出標簽,並將報文轉發給指定的下一跳,或通過出接口轉發該報文。因此,在Ingress上需要指定目的網段對應的出標簽、LSP的下一跳或到達下一跳的出接口。
配置靜態LSP的Ingress節點時,如果指定下一跳,則需要保證節點上存在該下一跳地址對應的激活路由。
(1) 進入係統視圖。
system-view
(2) 配置靜態LSP的Ingress節點。
static-lsp ingress lsp-name destination ip-address { mask | mask-length } { nexthop next-hop-ip-address | outgoing-interface interface-type interface-number } out-label out-label
Transit節點接收到帶有標簽的報文後,根據報文中攜帶的標簽值,查找標簽轉發表項,將報文中的標簽替換為該標簽對應的出標簽,並將報文轉發給指定的下一跳,或通過出接口轉發該報文。因此,Transit上需要指定入標簽對應的出標簽、LSP的下一跳或到達下一跳的出接口。
配置靜態LSP的Transit節點時,如果指定下一跳,則需要保證節點上存在該下一跳地址對應的激活路由。
(1) 進入係統視圖。
system-view
(2) 配置靜態LSP的Transit節點。
static-lsp transit lsp-name in-label in-label { nexthop next-hop-ip-address | outgoing-interface interface-type interface-number } out-label out-label
如果沒有在倒數第二跳彈出標簽,則Egress節點上需要指定入標簽值。Egress節點接收到帶有指定入標簽值的報文後,彈出該標簽,並對報文進行下一層轉發處理。
如果靜態LSP的倒數第二跳節點上配置的出標簽為0或3,則不需要在Egress節點上進行配置。
如果報文到達目的地址需要分別經過靜態LSP和LDP LSP的轉發,且靜態LSP的Egress和LDP LSP的Ingress為同一台設備,則可以通過配置靜態LSP和LDP LSP關聯簡化報文處理流程:在靜態LSP的Egress上除指定入標簽值外,同時指定報文的目的IP地址。Egress接收到帶有指定入標簽值的報文後,會將報文中的標簽替換為目的IP地址對應LDP LSP的出標簽,並將報文轉發給LDP LSP的下一跳。
配置靜態LSP的Egress節點時,如果指定報文的目的IP地址,需確保該節點上存在目的地址對應的路由。
(1) 進入係統視圖。
system-view
(2) 配置靜態LSP的Egress節點。
static-lsp egress lsp-name in-label in-label [ destination ip-address { mask | mask-length } ]
在完成上述配置後,在任意視圖下執行display命令可以顯示配置後靜態LSP的運行情況,用戶可以通過查看顯示信息驗證配置的效果。
表1-1 靜態LSP顯示和維護
操作 |
命令 |
顯示靜態LSP的信息 |
display mpls static-lsp [ lsp-name lsp-name | openflow ] |
· Switch A、Switch B和Switch C均支持MPLS。
· 在Switch A和Switch C之間建立靜態LSP,使11.1.1.0/24和21.1.1.0/24這兩個網段中互訪的報文能夠通過MPLS進行傳輸。
圖1-1 靜態建立LSP組網圖
(1) 創建VLAN,配置各接口的IP地址
按照圖1-1創建VLAN,並配置各接口的IP地址和掩碼,包括Loopback接口,具體配置過程略。
(2) 在Ingress上配置到達FEC目的地址的靜態路由
# 在Switch A上配置到達21.1.1.0/24網段的靜態路由。
<SwitchA> system-view
[SwitchA] ip route-static 21.1.1.0 24 10.1.1.2
# 在Switch C上配置到達11.1.1.0/24網段的靜態路由。
<SwitchC> system-view
[SwitchC] ip route-static 11.1.1.0 255.255.255.0 20.1.1.1
(3) 使能MPLS功能
# 配置Switch A。
[SwitchA] mpls lsr-id 1.1.1.9
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] mpls enable
[SwitchA-Vlan-interface2] quit
# 配置Switch B。
[SwitchB] mpls lsr-id 2.2.2.9
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] mpls enable
[SwitchB-Vlan-interface2] quit
[SwitchB] interface vlan-interface 3
[SwitchB-Vlan-interface3] mpls enable
[SwitchB-Vlan-interface3] quit
# 配置Switch C。
[SwitchC] mpls lsr-id 3.3.3.9
[SwitchC] interface vlan-interface 3
[SwitchC-Vlan-interface3] mpls enable
[SwitchC-Vlan-interface3] quit
(4) 創建從Switch A到Switch C的靜態LSP
# 配置Ingress Switch A。
[SwitchA] static-lsp ingress AtoC destination 21.1.1.0 24 nexthop 10.1.1.2 out-label 30
# 配置Transit Switch B
[SwitchB] static-lsp transit AtoC in-label 30 nexthop 20.1.1.2 out-label 50
# 配置Egress Switch C。
[SwitchC] static-lsp egress AtoC in-label 50
(5) 創建從Switch C到Switch A的靜態LSP
# 配置Ingress Switch C。
[SwitchC] static-lsp ingress CtoA destination 11.1.1.0 24 nexthop 20.1.1.1 out-label 40
# 配置Transit Switch B。
[SwitchB] static-lsp transit CtoA in-label 40 nexthop 10.1.1.1 out-label 70
# 配置Egress Switch A。
[SwitchA] static-lsp egress CtoA in-label 70
# 配置完成後,可以在各交換機上通過display mpls static-lsp命令查看靜態LSP的信息。以Switch A的顯示信息為例。
[SwitchA] display mpls static-lsp
Total: 2
Name FEC In/Out Label Nexthop/Out Interface State
AtoC 21.1.1.0/24 NULL/30 10.1.1.2 Up
CtoA -/- 70/NULL - Up
# 在Switch A上檢測Switch A到Switch C靜態LSP的可達性。
[SwitchA] ping mpls -a 11.1.1.1 ipv4 21.1.1.0 24
MPLS ping FEC 21.1.1.0/24 with 100 bytes of data:
100 bytes from 20.1.1.2: Sequence=1 time=4 ms
100 bytes from 20.1.1.2: Sequence=2 time=1 ms
100 bytes from 20.1.1.2: Sequence=3 time=1 ms
100 bytes from 20.1.1.2: Sequence=4 time=1 ms
100 bytes from 20.1.1.2: Sequence=5 time=1 ms
--- Ping statistics for FEC 21.1.1.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 1/1/4 ms
# 在Switch C上檢測Switch C到Switch A靜態LSP的可達性。
[SwitchC] ping mpls -a 21.1.1.1 ipv4 11.1.1.0 24
MPLS ping FEC 11.1.1.0/24 with 100 bytes of data:
100 bytes from 10.1.1.1: Sequence=1 time=5 ms
100 bytes from 10.1.1.1: Sequence=2 time=1 ms
100 bytes from 10.1.1.1: Sequence=3 time=1 ms
100 bytes from 10.1.1.1: Sequence=4 time=1 ms
100 bytes from 10.1.1.1: Sequence=5 time=1 ms
--- Ping statistics for FEC 11.1.1.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 1/1/5 ms
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!