25-MPLS基礎典型配置舉例
本章節下載: 25-MPLS基礎典型配置舉例 (231.57 KB)
資料版本:6W100-20190628
Copyright © 2019 bobty下载软件 版權所有,保留一切權利。
非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。
除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。
本文檔中的信息可能變動,恕不另行通知。
目 錄
本文檔介紹通過靜態方式和LDP(Label Distribution Protocol,標簽分發協議)方式建立LSP的基本過程。
建立靜態LSP需要用戶在報文轉發路徑中的各個LSR上手工配置為FEC分配的標簽。通過靜態方式建立LSP消耗的資源比較少,但靜態建立的LSP不能根據網絡拓撲變化動態調整。因此,靜態LSP適用於拓撲結構簡單並且穩定的小型網絡。
LDP協議是MPLS的一種信令協議,負責劃分FEC、通告FEC—標簽綁定、建立維護LSP等。通過LDP建立LSP消耗資源比較多,但動態建立的LSP能根據網絡拓撲變化動態調整。因此,LDP方式建立LSP適用於拓撲結構複雜並且不太穩定的大中型網絡。
本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。
本文檔假設您已了解MPLS特性。
如圖1所示,運營商網絡運行MPLS,Switch A和Switch C作為MPLS網絡的邊緣設備,現要求在172.20.2.0/24網段和172.16.2.0/24網段間,通過配置靜態LSP隧道,使這兩個網段中互訪的報文能夠通過LSP在MPLS網絡中進行傳輸。
圖1 配置靜態LSP組網圖
· 為了使設備能夠按正確的路徑轉發MPLS報文,需要在手工配置LSP的標簽時,確保上遊LSR出標簽的值就是下遊LSR入標簽的值。
· LSP是一種單向通道,為了實現數據的雙向正常傳輸,需要在數據傳輸的兩個方向上分別配置一條靜態LSP,並指定各自的入節點、中間節點和出節點。
· 在靜態LSP環境中,隻需要Ingress節點上存在到達FEC目的地址的路由即可,Transit和Egress節點上無需存在到達FEC目的地址的路由,因此本例中使用簡單的靜態路由即可完成路由配置。
本舉例是在S6890-CMW710-R2712版本上進行配置和驗證的。
· 通過靜態路由配置路由信息時,如果靜態路由指定的是出接口,則靜態LSP必須指定相同的出接口;如果靜態路由指定的是下一跳,則靜態LSP必須指定相同的下一跳。
· 配置Ingress和Transit時,本地的公網地址不能被指定為下一跳。
· 由於MPLS功能會在原有報文上封裝一層或多層標簽,因此建議用戶在使能某VLAN接口的MPLS功能後,將該VLAN內端口的jumboframe幀功能開啟,並根據實際應用和標簽嵌套層數配置相應的幀長,避免某些報文因超長而被丟棄。
· 缺省情況下,S6890係列交換機的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。
(1) 配置各接口的IP地址
按照圖1配置各接口的IP地址和掩碼,包括LoopBack接口,具體配置過程略。
(2) 配置靜態路由,使兩條LSP的Ingress節點上存在到達FEC目的地址的路由。
# 配置Switch A。
<SwitchA> system-view
[SwitchA] ip route-static 172.16.2.1 24 10.0.3.2
# 配置Switch C。
<SwitchC> system-view
[SwitchC] ip route-static 172.20.2.1 24 10.0.6.1
# 配置完成後,在Ingress設備上執行display ip routing-table命令,可以看到靜態路由已生效。以Switch A為例:
[SwitchA] display ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
172.16.2.1/24 Static 60 0 10.0.3.2 Vlan3
10.0.3.0/24 Direct 0 0 10.0.3.1 Vlan3
10.0.3.0/32 Direct 0 0 10.0.3.1 Vlan3
10.0.3.1/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.9/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
(3) 使能MPLS功能
# 配置Switch A。
[SwitchA] mpls lsr-id 1.1.1.9
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] mpls enable
[SwitchA-Vlan-interface3] quit
# 配置Switch B。
[SwitchB] mpls lsr-id 2.2.2.9
[SwitchB] interface vlan-interface 3
[SwitchB-Vlan-interface3] mpls enable
[SwitchB-Vlan-interface3] quit
[SwitchB] interface vlan-interface 6
[SwitchB-Vlan-interface6] mpls enable
[SwitchB-Vlan-interface6] quit
# 配置Switch C。
[SwitchC] mpls lsr-id 3.3.3.9
[SwitchC] interface vlan-interface 6
[SwitchC-Vlan-interface6] mpls enable
[SwitchC-Vlan-interface6] quit
(4) 創建從Switch A到Switch C的靜態LSP
# 為Ingress節點Switch A配置一條到目的地址172.16.2.1/24的靜態LSP,LSP的名稱為AtoC,下一跳地址為10.0.3.2,出標簽為30。
[SwitchA] static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30
# 為Transit節點Switch B配置一條名為AtoC的靜態LSP,入標簽為30,下一跳地址為10.0.6.2,出標簽為50。
[SwitchB] static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50
# 為Egress節點 Switch C上配置一條名為AtoC的靜態LSP,入標簽為50。
[SwitchC] static-lsp egress AtoC in-label 50
(5) 創建從Switch C到Switch A的靜態LSP
# 為Ingress節點Switch C配置一條到目的地址172.20.2.1/24的靜態LSP,LSP的名稱為CtoA,下一跳地址為10.0.6.1,出標簽為40。
[SwitchC] static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40
# 為Transit節點Switch B配置一條名為CtoA的靜態LSP,入標簽為40,下一跳地址為10.0.3.1,出標簽為70。
[SwitchB] static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70
# 為Egress節點 Switch A配置一條名為CtoA的靜態LSP,入標簽為70。
[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 172.16.2.1/24 NULL/30 10.0.3.2 Up
CtoA -/- 70/NULL - Up
# 在Switch A上檢測Switch A到Switch C靜態LSP的可達性。
[SwitchA] ping mpls -a 172.20.2.1 ipv4 172.16.2.0 24
MPLS ping FEC 172.16.2.0/24 with 100 bytes of data:
100 bytes from 10.0.6.2: Sequence=1 time=3 ms
100 bytes from 10.0.6.2: Sequence=2 time=2 ms
100 bytes from 10.0.6.2: Sequence=3 time=2 ms
100 bytes from 10.0.6.2: Sequence=4 time=2 ms
100 bytes from 10.0.6.2: Sequence=5 time=27 ms
--- Ping statistics for FEC 172.16.2.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/7/27 ms
# 在Switch C上檢測Switch C到Switch A靜態LSP的可達性。
[SwitchC] ping mpls -a 172.16.2.1 ipv4 172.20.2.0 24
MPLS ping FEC 172.20.2.0/24 with 100 bytes of data:
100 bytes from 10.0.3.2: Sequence=1 time=3 ms
100 bytes from 10.0.3.2: Sequence=2 time=2 ms
100 bytes from 10.0.3.2: Sequence=3 time=2 ms
100 bytes from 10.0.3.2: Sequence=4 time=2 ms
100 bytes from 10.0.3.2: Sequence=5 time=27 ms
--- Ping statistics for FEC 172.20.2.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/7/27 ms
· Switch A
#
mpls lsr-id 1.1.1.9
#
vlan 3
#
vlan 10
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
interface Vlan-interface3
ip address 10.0.3.1 255.255.255.0
mpls enable
#
interface Vlan-interface10
ip address 172.20.2.1 255.255.255.0
#
ip route-static 172.16.2.1 255.255.255.0 10.0.3.2
#
static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30
static-lsp egress CtoA in-label 70
#
· Switch B
#
mpls lsr-id 2.2.2.9
#
vlan 3
#
vlan 6
#
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
#
interface Vlan-interface3
ip address 10.0.3.2 255.255.255.0
mpls enable
#
interface Vlan-interface6
ip address 10.0.6.1 255.255.255.0
mpls enable
#
static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50
static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70
#
· Switch C
#
mpls lsr-id 3.3.3.9
#
vlan 6
#
vlan 10
#
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
#
interface Vlan-interface6
ip address 10.0.6.2 255.255.255.0
mpls enable
#
interface Vlan-interface10
ip address 172.16.2.1 255.255.255.0
#
ip route-static 172.20.2.1 255.255.255.0 10.0.6.2
#
static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40
static-lsp egress AtoC in-label 50
#
如圖2所示,在運營商網絡的MPLS區域中,PE 1和PE 2之間有兩條路由可達,現要求:
· 在MPLS網絡中配置LDP協議,動態建立LSP,使192.168.10.0/24網段與192.168.20.0/24網段之間轉發的報文沿建立的LSP轉發。
· 缺省情況下,報文通過LSP 1路徑傳輸;當P 1故障時,報文通過LSP 2路徑傳輸。
· 所有設備上隻允許目的地址為1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表項觸發LDP建立LSP,其他路由表項不能觸發LDP建立LSP,以避免建立的LSP數量過多,影響設備性能。
圖2 動態LSP配置組網圖
· 為了通過LDP動態創建LSP,需要配置路由協議,使得各設備間路由可達,本例中使用OSPF路由協議。
· 為了實現缺省情況下報文通過LSP 1路徑傳輸,並且當P 1故障時,報文通過LSP 2路徑傳輸,需要配置192.168.10.0/24和192.168.20.0/24之間的主路由為LSP 1,備份路由為LSP 2(本例通過配置OSPF路由協議來實現:使能OSPF協議後,會自動計算出LSP 1路徑的開銷小於LSP 2,所以走LSP 1)。
· 為了隻允許目的地址為1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表項觸發LDP建立LSP,需要配置LSP觸發策略。
本舉例是在S6890-CMW710-R2712版本上進行配置和驗證的。
缺省情況下,S6890係列交換機的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。
進行下麵配置之前,需要先關閉STP功能,或為每個VLAN映射一個MSTP實例。
(1) 配置各接口的IP地址
按照圖2配置各接口的IP地址和掩碼,包括LoopBack接口,具體配置過程略。
(2) 配置OSPF,以保證各交換機之間路由可達
# 配置PE 1。
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.168.10.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 配置P 1。
[P1] ospf
[P1-ospf-1] area 0
[P1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255
[P1-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255
[P1-ospf-1-area-0.0.0.0] quit
[P1-ospf-1] quit
# 配置P 2。
[P2] ospf
[P2-ospf-1] area 0
[P2-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[P2-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255
[P2-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255
[P2-ospf-1-area-0.0.0.0] quit
[P2-ospf-1] quit
# 配置P 3。
[P3] ospf
[P3-ospf-1] area 0
[P3-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0
[P3-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255
[P3-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255
[P3-ospf-1-area-0.0.0.0] quit
[P3-ospf-1] quit
# 配置PE 2。
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 192.168.20.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# 配置完成後,在各交換機上執行display ospf routing命令,可以看到相互之間都學到了到對方的路由。以PE 1為例:
[PE1] display ospf routing
OSPF Process 1 with Router ID 1.1.1.1
Routing Table
Topology base (MTID 0)
Routing for network
Destination Cost Type NextHop AdvRouter Area
45.45.45.0/24 2 Transit 14.14.14.4 5.5.5.5 0.0.0.0
35.35.35.0/24 3 Transit 14.14.14.4 5.5.5.5 0.0.0.0
35.35.35.0/24 3 Transit 12.12.12.2 5.5.5.5 0.0.0.0
192.168.10.0/24 1 Stub 192.168.10.1 1.1.1.1 0.0.0.0
5.5.5.5/32 2 Stub 14.14.14.4 5.5.5.5 0.0.0.0
14.14.14.0/24 1 Transit 14.14.14.1 4.4.4.4 0.0.0.0
23.23.23.0/24 2 Transit 12.12.12.2 3.3.3.3 0.0.0.0
4.4.4.4/32 1 Stub 14.14.14.4 4.4.4.4 0.0.0.0
3.3.3.3/32 2 Stub 12.12.12.2 3.3.3.3 0.0.0.0
12.12.12.0/24 1 Transit 12.12.12.1 2.2.2.2 0.0.0.0
2.2.2.2/32 1 Stub 12.12.12.2 2.2.2.2 0.0.0.0
1.1.1.1/32 0 Stub 1.1.1.1 1.1.1.1 0.0.0.0
192.168.20.0/24 3 Stub 12.12.12.2 3.3.3.3 0.0.0.0
PE 1和P 1、P 2,P 2、P 3和PE 2之間應建立起OSPF鄰居關係,執行display ospf peer verbose命令可以看到鄰居達到FULL狀態。以PE 1為例:
[PE1] display ospf peer verbose
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 14.14.14.1(Vlan-interface14)'s neighbors
Router ID: 4.4.4.4 Address: 14.14.14.4 GR state: Normal
State: Full Mode: Nbr is master Priority: 1
DR: 14.14.14.4 BDR: 14.14.14.1 MTU: 0
Options is 0x42 (-|O|-|-|-|-|E|-)
Dead timer due in 40 sec
Neighbor is up for 00:03:30
Authentication Sequence: [ 0 ]
Neighbor state change count: 6
BFD status: Disabled
Neighbors
Area 0.0.0.0 interface 12.12.12.1(Vlan-interface12)'s neighbors
Router ID: 2.2.2.2 Address: 12.12.12.2 GR state: Normal
State: Full Mode: Nbr is master Priority: 1
DR: 12.12.12.2 BDR: 12.12.12.1 MTU: 0
Options is 0x42 (-|O|-|-|-|-|E|-)
Dead timer due in 36 sec
Neighbor is up for 00:03:24
Authentication Sequence: [ 0 ]
Neighbor state change count: 6
BFD status: Disabled
Last Neighbor Down Event:
Router ID: 4.4.4.4
Local Address: 14.14.14.1
Remote Address: 14.14.14.4
Time: May 14 09:07:19 2014
Reason: Reset ospf command was performed
(3) 配置MPLS基本能力,並使能LDP
# 配置PE 1。
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls ldp
[PE1-ldp] quit
[PE1] interface vlan-interface 12
[PE1-Vlan-interface12] mpls enable
[PE1-Vlan-interface12] mpls ldp enable
[PE1-Vlan-interface12] quit
[PE1] interface vlan-interface 14
[PE1-Vlan-interface14] mpls enable
[PE1-Vlan-interface14] mpls ldp enable
[PE1-Vlan-interface14] quit
# 配置P 1。
[P1] mpls lsr-id 2.2.2.2
[P1] mpls ldp
[P1-ldp] quit
[P1] interface vlan-interface 12
[P1-Vlan-interface12] mpls enable
[P1-Vlan-interface12] mpls ldp enable
[P1-Vlan-interface12] quit
[P1] interface vlan-interface 23
[P1-Vlan-interface23] mpls enable
[P1-Vlan-interface23] mpls ldp enable
[P1-Vlan-interface23] quit
# 配置P 2。
[P2] mpls lsr-id 4.4.4.4
[P2] mpls ldp
[P2-ldp] quit
[P2] interface vlan-interface 14
[P2-Vlan-interface14] mpls enable
[P2-Vlan-interface14] mpls ldp enable
[P2-Vlan-interface14] quit
[P2] interface vlan-interface 45
[P2-Vlan-interface45] mpls enable
[P2-Vlan-interface45] mpls ldp enable
[P2-Vlan-interface45] quit
# 配置P 3。
[P3] mpls lsr-id 5.5.5.5
[P3] mpls ldp
[P3-ldp] quit
[P3] interface vlan-interface 45
[P3-Vlan-interface45] mpls enable
[P3-Vlan-interface45] mpls ldp enable
[P3-Vlan-interface45] quit
[P3] interface vlan-interface 35
[P3-Vlan-interface35] mpls enable
[P3-Vlan-interface35] mpls ldp enable
[P3-Vlan-interface35] quit
# 配置PE 2。
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls ldp
[PE2-ldp] quit
[PE2] interface vlan-interface 23
[PE2-Vlan-interface23] mpls enable
[PE2-Vlan-interface23] mpls ldp enable
[PE2-Vlan-interface23] quit
[PE2] interface vlan-interface 35
[PE2-Vlan-interface35] mpls enable
[PE2-Vlan-interface35] mpls ldp enable
[PE2-Vlan-interface35] quit
完成上述配置後,PE 1和P 1、P 2,P 2、P 3和PE 2之間的本地LDP會話建立成功。
在各設備上執行display mpls ldp peer命令,可以看到LDP的對等體情況,Operational表示成功建立會話。以PE 1為例:
[PE1 display mpls ldp peer
Total number of peers: 2
Peer LDP ID State Role GR MD5 KA Sent/Rcvd
2.2.2.2:0 Operational Passive Off Off 55/55
4.4.4.4:0 Operational Passive Off Off 6/6
(4) 配置LSP的觸發策略,為目的地址為1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表項建立LSP。
# 在PE 1上創建IP地址前綴列表PE1,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。
[PE1] ip prefix-list PE1 index 10 permit 1.1.1.1 32
[PE1] ip prefix-list PE1 index 20 permit 2.2.2.2 32
[PE1] ip prefix-list PE1 index 30 permit 3.3.3.3 32
[PE1] ip prefix-list PE1 index 40 permit 4.4.4.4 32
[PE1] ip prefix-list PE1 index 50 permit 5.5.5.5 32
[PE1] ip prefix-list PE1 index 60 permit 192.168.10.0 24
[PE1] ip prefix-list PE1 index 70 permit 192.168.20.0 24
[PE1] mpls ldp
[PE1-ldp] lsp-trigger prefix-list PE1
[PE1-ldp] quit
# 在P 1上創建IP地址前綴列表P1,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。
[P1] ip prefix-list P1 index 10 permit 1.1.1.1 32
[P1] ip prefix-list P1 index 20 permit 2.2.2.2 32
[P1] ip prefix-list P1 index 30 permit 3.3.3.3 32
[P1] ip prefix-list P1 index 40 permit 4.4.4.4 32
[P1] ip prefix-list P1 index 50 permit 5.5.5.5 32
[P1] ip prefix-list P1 index 60 permit 192.168.10.0 24
[P1] ip prefix-list P1 index 70 permit 192.168.20.0 24
[P1] mpls ldp
[P1-ldp] lsp-trigger prefix-list P1
[P1-ldp] quit
# 在P 2上創建IP地址前綴列表P2,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。
[P2] ip prefix-list P2 index 10 permit 1.1.1.1 32
[P2] ip prefix-list P2 index 20 permit 2.2.2.2 32
[P2] ip prefix-list P2 index 30 permit 3.3.3.3 32
[P2] ip prefix-list P2 index 40 permit 4.4.4.4 32
[P2] ip prefix-list P2 index 50 permit 5.5.5.5 32
[P2] ip prefix-list P2 index 60 permit 192.168.10.0 24
[P2] ip prefix-list P2 index 70 permit 192.168.20.0 24
[P2] mpls ldp
[P2-ldp] lsp-trigger prefix-list P2
[P2-ldp] quit
# 在P 3上創建IP地址前綴列表P3,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。
[P3] ip prefix-list P3 index 10 permit 1.1.1.1 32
[P3] ip prefix-list P3 index 20 permit 2.2.2.2 32
[P3] ip prefix-list P3 index 30 permit 3.3.3.3 32
[P3] ip prefix-list P3 index 40 permit 4.4.4.4 32
[P3] ip prefix-list P3 index 50 permit 5.5.5.5 32
[P3] ip prefix-list P3 index 60 permit 192.168.10.0 24
[P3] ip prefix-list P3 index 70 permit 192.168.20.0 24
[P3] mpls ldp
[P3-ldp] lsp-trigger prefix-list P3
[P3-ldp] quit
# 在PE 2上創建IP地址前綴列表PE 2,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。
[PE2] ip prefix-list PE2 index 10 permit 1.1.1.1 32
[PE2] ip prefix-list PE2 index 20 permit 2.2.2.2 32
[PE2] ip prefix-list PE2 index 30 permit 3.3.3.3 32
[PE2] ip prefix-list PE2 index 40 permit 4.4.4.4 32
[PE2] ip prefix-list PE2 index 50 permit 5.5.5.5 32
[PE2] ip prefix-list PE2 index 60 permit 192.168.10.0 24
[PE2] ip prefix-list PE2 index 70 permit 192.168.20.0 24
[PE2] mpls ldp
[PE2-ldp] lsp-trigger prefix-list PE2
[PE2-ldp] quit
配置完成後,在PE 1上執行display mpls ldp lsp命令,查看LDP LSP的建立情況,可以看到去往192.168.20.0/24網段的LSP缺省下一跳指向P 1。
[PE1] display mpls ldp lsp
Status Flags: * - stale, L - liberal
Statistics:
FECs: 7 Ingress LSPs: 5 Transit LSPs: 5 Egress LSPs: 2
FEC In/Out Label Nexthop OutInterface
1.1.1.1/32 3/-
-/1151(L)
-/1151(L)
2.2.2.2/32 -/3 12.12.12.2 Vlan12
1151/3 12.12.12.2 Vlan12
-/1150(L)
3.3.3.3/32 -/1150 12.12.12.2 Vlan12
1150/1150 12.12.12.2 Vlan12
-/1148(L)
4.4.4.4/32 -/1149(L)
-/3 14.14.14.4 Vlan14
1149/3 14.14.14.4 Vlan14
5.5.5.5/32 -/1148(L)
-/1149 14.14.14.4 Vlan14
1148/1149 14.14.14.4 Vlan14
192.168.10.0/24 1147/-
192.168.20.0/24 -/1147 12.12.12.2 Vlan12
1146/1147 12.12.12.2 Vlan12
-/1147(L)
# 當P1故障時,在PE1上執行display mpls ldp lsp命令,查看LDP LSP的變化,可以看到去往192.168.20.0/24網段的LSP下一跳指向P2。
[PE1] display mpls ldp lsp
Status Flags: * - stale, L - liberal
Statistics:
FECs: 7 Ingress LSPs: 5 Transit LSPs: 5 Egress LSPs: 2
FEC In/Out Label Nexthop OutInterface
1.1.1.1/32 3/-
-/1150(L)
2.2.2.2/32 -/1149 14.14.14.4 Vlan14
1150/1149 14.14.14.4 Vlan14
3.3.3.3/32 -/1148 14.14.14.4 Vlan14
1147/1148 14.14.14.4 Vlan14
4.4.4.4/32 -/3 14.14.14.4 Vlan14
1149/3 14.14.14.4 Vlan14
5.5.5.5/32 -/1151 14.14.14.4 Vlan14
1148/1151 14.14.14.4 Vlan14
192.168.10.0/24 1151/-
-/1146(L)
192.168.20.0/24 -/1147 14.14.14.4 Vlan14
1146/1147 14.14.14.4 Vlan14
# 使用MPLS ping檢測MPLS LSP的有效性和可達性。
[PE1] ping mpls -a 192.168.10.1 ipv4 192.168.20.0 24
MPLS ping FEC 192.168.20.0/24 with 100 bytes of data:
100 bytes from 23.23.23.3: Sequence=1 time=2 ms
100 bytes from 23.23.23.3: Sequence=2 time=2 ms
100 bytes from 23.23.23.3: Sequence=3 time=2 ms
100 bytes from 23.23.23.3: Sequence=4 time=2 ms
100 bytes from 23.23.23.3: Sequence=5 time=2 ms
--- Ping statistics for FEC 192.168.20.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/2/2 ms
· PE1
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 12.12.12.0 0.0.0.255
network 14.14.14.0 0.0.0.255
network 192.168.10.0 0.0.0.255
#
mpls lsr-id 1.1.1.1
#
vlan 10
#
vlan 12
#
vlan 14
#
mpls ldp
lsp-trigger prefix-list PE1
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Vlan-interface10
ip address 192.168.10.1 255.255.255.0
#
interface Vlan-interface12
ip address 12.12.12.1 255.255.255.0
mpls enable
mpls ldp enable
#
interface Vlan-interface14
ip address 14.14.14.1 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list PE1 index 10 permit 1.1.1.1 32
ip prefix-list PE1 index 20 permit 2.2.2.2 32
ip prefix-list PE1 index 30 permit 3.3.3.3 32
ip prefix-list PE1 index 40 permit 4.4.4.4 32
ip prefix-list PE1 index 50 permit 5.5.5.5 32
ip prefix-list PE1 index 60 permit 192.168.10.0 24
ip prefix-list PE1 index 70 permit 192.168.20.0 24
#
· P 1
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.12.12.0 0.0.0.255
network 23.23.23.0 0.0.0.255
#
mpls lsr-id 2.2.2.2
#
vlan 12
#
vlan 23
#
mpls ldp
lsp-trigger prefix-list P1
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Vlan-interface12
ip address 12.12.12.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Vlan-interface23
ip address 23.23.23.2 255.255.255.0
mpls enable
mpls ldp enable
#
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· P 2
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 14.14.14.0 0.0.0.255
network 45.45.45.0 0.0.0.255
#
mpls lsr-id 4.4.4.4
#
vlan 14
#
vlan 45
#
mpls ldp
lsp-trigger prefix-list P2
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
interface Vlan-interface14
ip address 14.14.14.4 255.255.255.0
mpls enable
mpls ldp enable
#
interface Vlan-interface45
ip address 45.45.45.4 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· P 3
#
ospf 1
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 35.35.35.0 0.0.0.255
network 45.45.45.0 0.0.0.255
#
mpls lsr-id 5.5.5.5
#
vlan 35
#
vlan 45
#
mpls ldp
lsp-trigger prefix-list P1
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Vlan-interface35
ip address 35.35.35.5 255.255.255.0
mpls enable
mpls ldp enable
#
interface Vlan-interface45
ip address 45.45.45.5 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· PE 2
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.23.23.0 0.0.0.255
network 35.35.35.0 0.0.0.255
network 192.168.20.0 0.0.0.255
#
mpls lsr-id 3.3.3.3
#
vlan 20
#
vlan 23
#
vlan 35
#
mpls ldp
lsp-trigger prefix-list PE2
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface Vlan-interface20
ip address 192.168.20.1 255.255.255.0
#
interface Vlan-interface23
ip address 23.23.23.3 255.255.255.0
mpls enable
mpls ldp enable
#
interface Vlan-interface35
ip address 35.35.35.3 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· H3C S6890係列交換機 MPLS配置指導(R27xx)
· H3C S6890係列交換機 MPLS命令參考(R27xx)
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!