本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
此文件說明如何設定基本的多重通訊協定標籤交換 (MPLS) VPN 核心網路。
本文件沒有特定需求。
本文中的資訊係根據以下軟體和硬體版本:
包含 MPLS VPN 功能的 Cisco IOS® 軟體版本。
7200 或以上系列的任何思科路由器都支援 P 功能。
思科 2600、以及任何 3600 或以上系列的路由器都支援 PE 功能。
您可以使用能夠與其 PE 路由器交換路由資訊的任何路由器。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
為了實作 MPLS 功能,您必須有思科 2600 或以上系列的路由器。若要選取具備 MPLS 功能的必要 Cisco IOS,請使用軟體研究工具。也請檢查在路由器中執行 MPLS 功能所必須的額外 RAM 和快閃記憶體。可以使用 WIC-1T、WIC-2T 和序列介面。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
這些字母代表所用的不同類型路由器和交換器:
P — 提供商核心路由器。
-
PE — 提供商邊緣路由器。
-
CE — 邊 Customer 緣路由器。
-
C — Customer 路由器。
附註:PE 路由器是提供者網路中的最後一個躍點,且它們是直接連接到 CE 路由器的裝置,這些 CE 路由器並不瞭解 MPLS 功能,如下一張圖表所示。
此圖表顯示一般組態設定,示範先前已概述過的慣例。
背景資訊
此文件提供在思科用戶端網站上有邊界閘道通訊協定 (BGP) 時,多重通訊協定標籤交換 (MPLS) VPN 的範例組態設定。
與 MLPS 搭配使用時,VPN 功能可讓數個網站透過服務提供者網路,透明地互相連線。一個服務提供者網路可以支援數個不同 IP VPN。每個 VPN 皆對使用者顯示為私有網路,藉此與其他所有網路區隔。在一個 VPN 中,每個網站可以傳送 IP 封包到相同 VPN 中的任何其他網站。
每個 VPN 與一個或多個虛擬路由和轉送 (VRF) 執行個體相關聯。一個 VRF 的組成包含 IP 路由表、衍生的 Cisco Express Forwarding (CEF) 表,以及使用此轉送表的一系列介面。 路由器為每個 VRF 維持各別的路由資訊庫 (RIB) 和 CEF 表。因此,資訊不會傳送到 VPN 以外,且允許數個 VPN 使用相同的子網路而不會導致 IP 位址重複的問題。 使用多重通訊協定 BGP (MP-BGP) 的路由器透過 MP-BGP 延伸社群分發 VPN 路由資訊。
組態
本節提供組態設定範例,以及這些範例的實作方式。
網路圖表
此文件使用以下網路設定:
組態設定程序
MPLS 組態設定
1.驗證在需要
ip cef MPLS的路由器上是否已啟用。為了提高效能,請使用
ip cef distributed (如果可用)。
2. 在服務提供者核心上設定 IGP,可使用建議選項中的開放最短路徑優先 (OSPF) 或中間系統到中間系統 (IS-IS) 通訊協定,並通告來自每個 P 和 PE 路由器的 Loopback0。
3.服務提供商核心路由器在其環回之間完全可達到L3後,在P路由器和PE路由器之間的每個L3介面上配置命令
mpls ip 。
註:直接連線到CE路由器的PE路由器介面不需要命令配置
mpls ip。
設定MPLS後,在PE上完成這些步驟(在介面
mpls ip 上配置)。
-
為使用命令連線的每個VPN建立一 vrf definition <VRF name> VRF。額外步驟:
指定用於該 VPN 的路由識別碼。命令 rd <VPN route distinguisher> 用於擴展IP地址,以便您可以確定它屬於哪個VPN。
vrf definition Client_A
rd 100:110
為 MP-BGP 延伸社群設定匯入與匯出內容。這些指令用於使用指令過濾匯入和匯出流程 route-target {import|export|both} <target VPN extended community> ,如下圖所示:
vrf definition Client_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
address-family ipv4
exit-address-family
- 在 PE 路由器上,新增將 CE 連接到對應 VRF 的介面。使用命令配置各個介面的轉發詳細
vrf forwarding ,並設定IP地址。
Pescara#show run interface GigabitEthernet0/1 Building configuration... Current configuration : 138 bytes ! interface GigabitEthernet0/1 vrf forwarding Client_A ip address 10.0.4.2 255.255.255.0 duplex auto speed auto media-type rj45 end
設定 MP-BGP
有數種方式可以設定 BGP,例如,您可以將 PE 路由器設定為 BGP 芳鄰,或使用路由反射器 (RR) 或聯盟方法。下一個範例中使用了路由反射器,相較於在 PE 路由器之間直接使用芳鄰,此方法更具擴充性:
-
輸入此 address-family ipv4 vrf <VRF name>PE路由器上存在的每個VPN的命令。接下來,視需要繼續執行下列一個或多個步驟:
-
如果您使用 BGP 來和 CE 交換路由資訊,請透過 CE 路由器設定並啟用 BGP 芳鄰。
-
如果您使用不同的動態路由通訊協定來和 CE 交換路由資訊,請重新分發路由通訊協定。
備註:根據您使用的 PE-CE 路由通訊協定,您可以在 PE 和 CE 之間設定任何動態路由通訊協定(EIGRP、OSPF 或 BGP)。如果使用 BGP 通訊協定在 PE 和 CE 之間交換路由資訊,則不需要在通訊協定之間設定重新分發。
2.進入模
address-family vpnv4 式,然後完成以下步驟:
-
啟用芳鄰,且需要在每個 PE 路由器和路由反射器之間建立 VPNv4 芳鄰工作階段。
-
指定必須使用延伸社群。這是必要措施。
組態
本文件使用這些組態設定來設定 MPLS VPN 網路範例:
Pescara |
---|
hostname Pescara ! ip cef ! !--- VPN Client_A commands. vrf definition Client_A rd 100:110 route-target export 100:1000 route-target import 100:1000 |
Pesaro |
---|
hostname Pesaro ! ip cef |
Pomerol |
---|
hostname Pomerol ! ip cef ! interface Loopback0 ip address 10.10.10.3 255.255.255.255 ip router isis ! interface GigabitEthernet0/0 description link to Pesaro ip address 10.1.1.21 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/1 description link to Pauillac ip address 10.1.1.6 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/2 description link to Pulligny ip address 10.1.1.9 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! router isis net 49.0001.0000.0000.0003.00 is-type level-2-only metric-style wide passive-interface Loopback0 ! end |
Pulligny |
---|
hostname Pulligny ! ip cef ! interface Loopback0 ip address 10.10.10.2 255.255.255.255 ip router isis ! interface GigabitEthernet0/0 description link to Pauillac ip address 10.1.1.2 255.255.255.252ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/1 description link to Pomerol ip address 10.1.1.10 255.255.255.252ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/3 no ip address shutdown duplex auto speed auto media-type rj45 ! router isis net 49.0001.0000.0000.0002.00 is-type level-2-only metric-style wide passive-interface Loopback0 ! router bgp 65000 bgp log-neighbor-changes neighbor 10.10.10.4 remote-as 65000 neighbor 10.10.10.4 update-source Loopback0 neighbor 10.10.10.6 remote-as 65000 neighbor 10.10.10.6 update-source Loopback0 ! address-family vpnv4 neighbor 10.10.10.4 activate neighbor 10.10.10.4 send-community both neighbor 10.10.10.4 route-reflector-client neighbor 10.10.10.6 activate neighbor 10.10.10.6 send-community both neighbor 10.10.10.6 route-reflector-client exit-address-family ! ! end |
Pauillac |
---|
hostname pauillac ! ip cef ! interface Loopback0 ip address 10.10.10.1 255.255.255.255 ip router isis ! interface GigabitEthernet0/0 description link to Pescara ip address 10.1.1.13 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/1 description link to Pulligny ip address 10.1.1.5 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! interface GigabitEthernet0/2 description link to Pomerol ip address 10.1.1.1 255.255.255.252 ip router isis duplex auto speed auto media-type rj45 mpls ip ! router isis net 49.0001.0000.0000.0001.00 is-type level-2-only metric-style wide passive-interface Loopback0 ! end |
CE-A1 | CE-A3 |
hostname CE-A1 ! ip cef ! interface GigabitEthernet0/0 ip address 10.0.4.1 255.255.255.0 duplex auto speed auto media-type rj45 ! router bgp 65002 bgp log-neighbor-changes redistribute connected neighbor 10.0.4.2 remote-as 65000 ! end |
hostname CE-A3 ! ip cef ! interface GigabitEthernet0/0 ip address 10.0.6.1 255.255.255.0 duplex auto speed auto media-type rj45 ! router bgp 65004 bgp log-neighbor-changes redistribute connected neighbor 10.0.6.2 remote-as 65000 ! end |
驗證
本節提供的資訊可讓您用於確認組態是否正常運作:
PE 到 CE 驗證命令
- show ip vrf — 驗證存在正確的 VRF。
- show ip vrf interfaces — 驗證已啟用的介面。
- show ip route vrf <VRF name> — 驗證 PE 路由器上的路由資訊。
- traceroute vrf <VRF name> <IP address> — 驗證 PE 路由器上的路由資訊。
- show ip cef vrf <VRF name> <IP address> detail — 驗證 PE 路由器上的路由資訊。
MPLS LDP 驗證命令
- show mpls interfaces
- show mpls forwarding-table
- show mpls ldp bindings
- show mpls ldp neighbor
PE 到 PE/RR 驗證命令
- show bgp vpnv4 unicast all summary
- show bgp vpnv4 unicast all neighbor <neighbor IP address> advertised-routes - 驗證已傳送 VPNv4 首碼
- show bgp vpnv4 unicast all neighbor <neighbor IP address> routes - 驗證已收到 VPNv4 首碼
這是 show ip vrf 命令的範例命令輸出。
Pescara#show ip vrf
Name Default RD Interfaces
Client_A 100:110 Gi0/1
Client_B 100:120 Gi0/2
下一個是 show ip vrf interfaces 命令的範例命令輸出。
Pesaro#show ip vrf interfaces
Interface IP-Address VRF Protocol
Gi0/2 10.1.6.2 Client_A up
Gi0/3 10.0.6.2 Client_A up
Gi0/1 10.0.6.2 Client_B up
在下一個範例中,show ip route vrf 命令在兩個輸出中都顯示相同的首碼 10.0.6.0/24。這是因為兩個思科用戶端,CE_B2 和 CE_A3,在遠端 PE 為相同的網路,這是一般 MPLS VPN 解決方案所允許的。
Pescara#show ip route vrf Client_A
Routing Table: Client_A
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.0.4.0/24 is directly connected, GigabitEthernet0/1
L 10.0.4.2/32 is directly connected, GigabitEthernet0/1
B 10.0.6.0/24 [200/0] via 10.10.10.6, 11:11:11
B 10.1.6.0/24 [200/0] via 10.10.10.6, 11:24:16
Pescara#
Pescara#show ip route vrf Client_B
Routing Table: Client_B
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.0.4.0/24 is directly connected, GigabitEthernet0/2
L 10.0.4.2/32 is directly connected, GigabitEthernet0/2
B 10.0.6.0/24 [200/0] via 10.10.10.6, 11:26:05
當您在兩個網站之間執行路徑追蹤時,可能會看到 MPLS 網路使用的標籤堆疊(如果 mpls ip propagate-ttl 如此設定),在這個範例中是 Client_A 的兩個網站(CE-A1 至 CE-A3)。
CE-A1#show ip route 10.0.6.1
Routing entry for 10.0.6.0/24
Known via "bgp 65002", distance 20, metric 0
Tag 65000, type external
Last update from 10.0.4.2 11:16:14 ago
Routing Descriptor Blocks:
* 10.0.4.2, from 10.0.4.2, 11:16:14 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 65000
MPLS label: none
CE-A1#
CE-A1#ping 10.0.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/8/9 ms
CE-A1#
CE-A1#traceroute 10.0.6.1 probe 1 numeric
Type escape sequence to abort.
Tracing the route to 10.0.6.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.0.4.2 2 msec
2 10.1.1.13 [MPLS: Labels 20/26 Exp 0] 8 msec
3 10.1.1.6 [MPLS: Labels 21/26 Exp 0] 17 msec
4 10.0.6.2 [AS 65004] 11 msec
5 10.0.6.1 [AS 65004] 8 msec
註:是
Exp 0 一個用於服務品質(QoS)的實驗欄位。
下一個輸出顯示 RR 和一些服務提供者核心網路中的 P 路由器之間建立了 IS-IS 和 LDP 相鄰。
Pulligny#show isis neighbors
Tag null:
System Id Type Interface IP Address State Holdtime Circuit Id
Pauillac L2 Gi0/0 10.1.1.1 UP 25 Pulligny.01
Pomerol L2 Gi0/1 10.1.1.9 UP 23 Pulligny.02
Pulligny#
Pulligny#show mpls ldp neighbor
Peer LDP Ident: 10.10.10.1:0; Local LDP Ident 10.10.10.2:0
TCP connection: 10.10.10.1.646 - 10.10.10.2.46298
State: Oper; Msgs sent/rcvd: 924/921; Downstream
Up time: 13:16:03
LDP discovery sources:
GigabitEthernet0/0, Src IP addr: 10.1.1.1
Addresses bound to peer LDP Ident:
10.1.1.13 10.1.1.5 10.1.1.1 10.10.10.1
Peer LDP Ident: 10.10.10.3:0; Local LDP Ident 10.10.10.2:0
TCP connection: 10.10.10.3.14116 - 10.10.10.2.646
State: Oper; Msgs sent/rcvd: 920/916; Downstream
Up time: 13:13:09
LDP discovery sources:
GigabitEthernet0/1, Src IP addr: 10.1.1.9
Addresses bound to peer LDP Ident:
10.1.1.6 10.1.1.9 10.10.10.3 10.1.1.21
相關資訊
修訂 | 發佈日期 | 意見 |
---|---|---|
2.0 |
19-Oct-2022 |
重新認證 |
1.0 |
10-Dec-2001 |
初始版本 |