此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍如何配置基本的多协议标签交换(MPLS)VPN核心网络。
本文档没有任何特定的要求。
本文档中的信息基于以下软件和硬件版本:
Cisco IOS®软件版本,包括MPLS VPN功能。
7200 系列或更高版本的任何 Cisco 路由器均支持 P 功能。
Cisco 2600 以及任何 3600 系列或更高版本的路由器均支持 PE 功能。
您可以使用能与其 PE 路由器交换路由信息的任何路由器。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
要实现 MPLS 功能,您必须有一台 Cisco 2600 或更高版本的路由器。要选择所需带MPLS功能的思科IOS,请使用软件研究工具。还要检查在路由器上运行 MPLS 功能所需的其他 RAM 和闪存。可以使用 WIC-1T、WIC-2T 和串行接口。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
这些字母代表所使用的不同类型的路由器和交换机:
P — 提供商核心路由器。
-
PE —供应商边缘路由器.
-
CE —边缘路由器. Customer
-
C —路由器. Customer
注意:PE路由器是提供商网络的最后一跳,这些是直接连接到CE路由器的设备,它们不知道MPLS功能,如下图所示。
下图显示了一个典型配置,说明前面介绍的约定。
背景信息
本文档提供了当边界网关协议(BGP)存在于思科客户端站点时的多协议标签交换(MPLS)VPN的示例配置。
当与MPLS一起使用时,VPN功能允许多个站点通过服务提供商网络透明地互连。一个服务提供商网络可以支持多个不同的 IP VPN。其中每一个 VPN 均向其用户显示为与所有其他网络分离的专用网络。在一个 VPN 内,每个站点都可以向该 VPN 的其他任何站点发送 IP 数据包。
每个VPN与一个或多个虚拟路由和转发(VRF)实例相关联。一个 VRF 由一个 IP 路由表、一个派生的 Cisco 快速转发 (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路由器之间使用直接邻居更具可扩展性:
-
为此PE路由器上的每个VPN输入命令 address-family ipv4 vrf <VRF name>。然后,根据需要执行一个或多个后续步骤:
-
如果使用BGP与CE交换路由信息,请配置并激活CE路由器的BGP邻居。
-
如果使用不同的动态路由协议与CE交换路由信息,请重新分发路由协议。
注意:根据您使用的PE-CE路由协议,您可以在PE和CE设备之间配置任何动态路由协议(EIGRP、OSPF或BGP)。如果BGP是用于在PE和CE之间交换路由信息的协议,则不需要配置协议之间的重分发。
2.进入模
address-family vpnv4 式,然后完成以下步骤:
-
激活邻居,需要在每个PE路由器和路由反射器之间建立VPNv4邻居会话。
-
指定必须使用扩展团体。这是强制性的。
配置
本文档使用以下配置设置MPLS VPN网络示例:
佩斯卡拉 |
---|
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 |
佩萨罗 |
---|
hostname Pesaro ! ip cef |
波梅罗尔 |
---|
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 |
普利尼 |
---|
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 |
波亚克 |
---|
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。这是因为远程PE对于两个思科客户端(CE_B2和CE_A3)具有相同的网络,这在典型的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
当您在两个站点之间运行traceroute时,在本示例中为Client_A的两个站点(CE-A1到CE-A3),可能会看到MPLS网络使用的标签堆栈(如果通过mpls ip propagate-ttl配置为这样做)。
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 |
初始版本 |