本文出自51CTO组网频道 搜索 查看更多路由文章
很多朋友在学习MPLS/VPN,我根据CISCO 文档写了本篇中文版的MPLS VPN 配置。
本篇的目的是为了让大家抛开复杂的MPLS/VPN 的原理,快速的掌握MPLS/VPN 的基本配置,这个配置可以完成大多数实际网络的需求。
以后我还将继续推出高级MPLS/VPN 配置和CCIE SP 等其它专题。
感谢:CISCO Documentation Online
感谢:我的朋友Vivy!
雪山飞鹄2005 年1 月
MSN: Mr_Flying@hotmail.com
介绍
MPLS 准许多个Site 通过Service Provider 的网络透明互联。一个ISP 的网络可以支持多个不同的IP VPN,每个VPN对客户来说,是个单独的私有网络,和其它的客户都是独立的。在一个VPN里面,每个site 可以发送IP 包给同一个VPN 里的其它Site。换句话来说,MPLS/VPN对于客户来说,相当于一个透明的三层传输网络,以前可以通过租用Leased Line 互联,现在可以租用MPLS/VPN 链路互联。
每个VPN和一个或多个VRF(VPN Routing or forwarding instance)关联。一个VRF 包括一个路由表、一个CEF 表和一组使用这个转发表的接口。
路由器为每个VRF维护着独立的路由表和CEF 表。这可以防止信息被发送到VPN 之外,并且每个VPN 可以使用重叠的IP 地址。
路由器通过MP-BGP的扩展community 标签来分发VPN 路由信息
实验环境
本例在下面的软件和硬件环境下实现:
P 和PE路由器
· Cisco IOS. Release 12.2(6h),支持MPLS VPN feature.
· P 路由器:Cisco 7200 系列路由器.
· PE 路由器:Cisco 2691, 或者3640 系列路由器.
C 和CE 路由器
· 任何可以和PE 交换路由信息的路由器都可以作为C 和CE 路由器.
缩写约定
· P - Provider's core router.
· PE - Provider's edge router.
· CE - Customer's edge router.
· C - Customer's router.
我们将用下面的拓扑图进行举例说明:
#p#
配置
网络拓扑图
本文档使用下面的拓扑图,网络中有3 台P 路由器、2 台PE 路由器(Pescara 和Pesaro),2 个
VPN 客户分别是Customer_A 和Customer_B:
配置过程
启用ip cef
使用下面的过程启用ip cef.,为了提高性能,可以在支持的路由器上使用ip cef distributed命令。
当在接口上配置了MPLS 后(在接口上配置 tag-switching ip).,还要在PE 上完成下面的步骤:
1. 在路由器上为每个相连的VPN创建一个VRF,使用命令 ip vrf
配置ip vrf 的时候:
o 为每个VPN指定正确的RD.这是为了扩展IP 地址之用,以便你可以识别IP 地址属于哪个VPN.
o 配置MP-BGP的扩展communities 的import 和export 值. 这是用于过滤import 和export 过程的.
route-target [export|import|both]
2. 在VPN 各自的接口下使用ip vrf forwarding 命令,别忘了还需要配置IP 地址
3. 配置PE-CE 间使用的路由协议,可是使用静态路由或者动态路由(RIP、OSPF、BGP).
配置MP-BGP
在PE 路由器之间配置MP-BGP.有几种办法来配置BGP,例如路由反射器或者联盟.我们这儿使用直连的邻居进行举例.
1. 声明彼此的邻居
2. 为这台PE 上的每个VPN配置address-family ipv4 vrf 如果需要的话,完成下面的步骤
o 重分布静态、RIP、或者OSPF 路由
o 重分布直连的路由
o Activate 和CE 路由器间的BGP 邻居
3. 进入address-family vpnv4 模式,完成下面的配置:
o Activate the neighbors. Activate 邻居
o 指定必须使用扩展community,这是必须的.
#p#
配置
本例中的5 台路由器配置如下:
Pescara
Current configuration:
!
version 12.2
!
hostname Pescara
!
ip cef
!
!--- Customer_A 的配置.
ip vrf Customer_A
!---启用Customer_A 的VPN 路由和转发表 (VRF).
rd 100:110
!--- Route distinguisher creates routing and forwarding
!--- tables for a VRF.
route-target export 100:1000
!--- Creates lists of import and export route-target extended
!--- communities for the specified VRF.
route-target import 100:1000
!
!--- Customer_B 配置.
ip vrf Customer_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
interface Loopback0
ip address 10.10.10.4 255.255.255.255
ip router isis
!--- Customer_A 的配置.
interface Loopback101
ip vrf forwarding Customer_A
!---将一个接口或者自接口和一个VRF 实例关联起来.
ip address 200.0.4.1 255.255.255.0
!--- Loopback101 和 102 使用相同的IP 地址 200.0.4.1.这是准许的,因为它们属于2 个不用
客户的VRF
no ip directed-broadcast
!
!--- Customer_B 的配置.
interface Loopback102
ip vrf forwarding Customer_B
ip address 200.0.4.1 255.255.255.0
!--- Loopback101 和 102 使用相同的IP 地址 200.0.4.1.这是准许的,因为它们属于2 个不用
客户的VRF
no ip directed-broadcast
!
interface Serial2/0
no ip address
no ip directed-broadcast
encapsulation frame-relay
no fair-queue
!
interface Serial2/0.1 point-to-point
description link to Pauillac
bandwidth 512
ip address 10.1.1.14 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 401
!
router isis
net 49.0001.0000.0000.0004.00
is-type level-1
!
router bgp 100
bgp log-neighbor-changes
!--- 启用BGP 邻居关系中断的记录.
neighbor 10.10.10.6 remote-as 100
neighbor 10.10.10.6 update-source Loopback0
!--- 配置BGP 邻居.
!
!--- Customer A and B commands.
address-family vpnv4
!--- 进入address-family vpnv4 配置模式,配置和PE/P 路由器间的MP-BGP 路由会话。
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community both
!--- Sends the community attribute to a BGP neighbor.
exit-address-family
!
!--- Customer B commands.
address-family ipv4 vrf Customer_B
!--- 进入address-family ipv4 的配置模式下,配置和CE 间的路由会话,
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A commands.
address-family ipv4 vrf Customer_A
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
ip classless
!
end
#p#
Pesaro
Current configuration:
!
version 12.1
!
hostname Pesaro
!
!--- Customer A commands.
ip vrf Customer_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
!--- Customer B commands.
ip vrf Customer_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
ip cef
!
interface Loopback0
ip address 10.10.10.6 255.255.255.255
ip router isis
!--- Customer A commands.
interface Loopback101
ip vrf forwarding Customer_A
ip address 200.0.6.1 255.255.255.0
!
!--- Customer B commands.
interface Loopback102
ip vrf forwarding Customer_B
ip address 200.0.6.1 255.255.255.0
!
!--- Customer A commands.
interface Loopback111
ip vrf forwarding Customer_A
ip address 200.1.6.1 255.255.255.0
!
interface Serial0/0
no ip address
encapsulation frame-relay
no ip mroute-cache
random-detect
!
interface Serial0/0.1 point-to-point
description link to Pomerol
bandwidth 512
ip address 10.1.1.22 255.255.255.252
ip router isis
tag-switching ip
frame-relay interface-dlci 603
!
router isis
net 49.0001.0000.0000.0006.00
is-type level-1
!
router bgp 100
neighbor 10.10.10.4 remote-as 100
neighbor 10.10.10.4 update-source Loopback0
!
!--- Customer B commands.
address-family ipv4 vrf Customer_B
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A commands.
address-family ipv4 vrf Customer_A
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A and B commands.
address-family vpnv4
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community both
exit-address-family
!
ip classless
!
end
Pomerol
Current configuration:
!
version 12.0
!
hostname Pomerol
!
ip cef
!
interface Loopback0
ip address 10.10.10.3 255.255.255.255
ip router isis
!
interface Serial0/1
no ip address
no ip directed-broadcast
encapsulation frame-relay
random-detect
!
interface Serial0/1.1 point-to-point
description link to Pauillac
ip address 10.1.1.6 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching mtu 1520
tag-switching ip
frame-relay interface-dlci 301
!
interface Serial0/1.2 point-to-point
description link to Pulligny
ip address 10.1.1.9 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 303
!
interface Serial0/1.3 point-to-point
description link to Pesaro
ip address 10.1.1.21 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 306
!
router isis
net 49.0001.0000.0000.0003.00
is-type level-1
!
ip classless
!
end 更多请看Cisco与华为技术网(Vlan9.com)VPN技术、MPLS路由协议专题、SSL VPN详细知识介绍专题专题,或进入论坛讨论。
很多朋友在学习MPLS/VPN,我根据CISCO 文档写了本篇中文版的MPLS VPN 配置。
以后我还将继续推出高级MPLS/VPN 配置和CCIE SP 等其它专题。
感谢:CISCO Documentation Online
感谢:我的朋友Vivy!
雪山飞鹄2005 年1 月
MSN: Mr_Flying@hotmail.com
介绍
MPLS 准许多个Site 通过Service Provider 的网络透明互联。一个ISP 的网络可以支持多个不同的IP VPN,每个VPN对客户来说,是个单独的私有网络,和其它的客户都是独立的。在一个VPN里面,每个site 可以发送IP 包给同一个VPN 里的其它Site。换句话来说,MPLS/VPN对于客户来说,相当于一个透明的三层传输网络,以前可以通过租用Leased Line 互联,现在可以租用MPLS/VPN 链路互联。
每个VPN和一个或多个VRF(VPN Routing or forwarding instance)关联。一个VRF 包括一个路由表、一个CEF 表和一组使用这个转发表的接口。
路由器为每个VRF维护着独立的路由表和CEF 表。这可以防止信息被发送到VPN 之外,并且每个VPN 可以使用重叠的IP 地址。
路由器通过MP-BGP的扩展community 标签来分发VPN 路由信息
实验环境
本例在下面的软件和硬件环境下实现:
P 和PE路由器
· Cisco IOS. Release 12.2(6h),支持MPLS VPN feature.
· P 路由器:Cisco 7200 系列路由器.
· PE 路由器:Cisco 2691, 或者3640 系列路由器.
C 和CE 路由器
· 任何可以和PE 交换路由信息的路由器都可以作为C 和CE 路由器.
缩写约定
· P - Provider's core router.
· PE - Provider's edge router.
· CE - Customer's edge router.
· C - Customer's router.
我们将用下面的拓扑图进行举例说明:
#p#
配置
网络拓扑图
本文档使用下面的拓扑图,网络中有3 台P 路由器、2 台PE 路由器(Pescara 和Pesaro),2 个
VPN 客户分别是Customer_A 和Customer_B:
配置过程
启用ip cef
使用下面的过程启用ip cef.,为了提高性能,可以在支持的路由器上使用ip cef distributed命令。
当在接口上配置了MPLS 后(在接口上配置 tag-switching ip).,还要在PE 上完成下面的步骤:
1. 在路由器上为每个相连的VPN创建一个VRF,使用命令 ip vrf
配置ip vrf 的时候:
o 为每个VPN指定正确的RD.这是为了扩展IP 地址之用,以便你可以识别IP 地址属于哪个VPN.
o 配置MP-BGP的扩展communities 的import 和export 值. 这是用于过滤import 和export 过程的.
route-target [export|import|both]
2. 在VPN 各自的接口下使用ip vrf forwarding 命令,别忘了还需要配置IP 地址
3. 配置PE-CE 间使用的路由协议,可是使用静态路由或者动态路由(RIP、OSPF、BGP).
配置MP-BGP
在PE 路由器之间配置MP-BGP.有几种办法来配置BGP,例如路由反射器或者联盟.我们这儿使用直连的邻居进行举例.
1. 声明彼此的邻居
2. 为这台PE 上的每个VPN配置address-family ipv4 vrf 如果需要的话,完成下面的步骤
o 重分布静态、RIP、或者OSPF 路由
o 重分布直连的路由
o Activate 和CE 路由器间的BGP 邻居
3. 进入address-family vpnv4 模式,完成下面的配置:
o Activate the neighbors. Activate 邻居
o 指定必须使用扩展community,这是必须的.
#p#
配置
本例中的5 台路由器配置如下:
Pescara
Current configuration:
!
version 12.2
!
hostname Pescara
!
ip cef
!
!--- Customer_A 的配置.
ip vrf Customer_A
!---启用Customer_A 的VPN 路由和转发表 (VRF).
rd 100:110
!--- Route distinguisher creates routing and forwarding
!--- tables for a VRF.
route-target export 100:1000
!--- Creates lists of import and export route-target extended
!--- communities for the specified VRF.
route-target import 100:1000
!
!--- Customer_B 配置.
ip vrf Customer_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
interface Loopback0
ip address 10.10.10.4 255.255.255.255
ip router isis
!--- Customer_A 的配置.
interface Loopback101
ip vrf forwarding Customer_A
!---将一个接口或者自接口和一个VRF 实例关联起来.
ip address 200.0.4.1 255.255.255.0
!--- Loopback101 和 102 使用相同的IP 地址 200.0.4.1.这是准许的,因为它们属于2 个不用
客户的VRF
no ip directed-broadcast
!
!--- Customer_B 的配置.
interface Loopback102
ip vrf forwarding Customer_B
ip address 200.0.4.1 255.255.255.0
!--- Loopback101 和 102 使用相同的IP 地址 200.0.4.1.这是准许的,因为它们属于2 个不用
客户的VRF
no ip directed-broadcast
!
interface Serial2/0
no ip address
no ip directed-broadcast
encapsulation frame-relay
no fair-queue
!
interface Serial2/0.1 point-to-point
description link to Pauillac
bandwidth 512
ip address 10.1.1.14 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 401
!
router isis
net 49.0001.0000.0000.0004.00
is-type level-1
!
router bgp 100
bgp log-neighbor-changes
!--- 启用BGP 邻居关系中断的记录.
neighbor 10.10.10.6 remote-as 100
neighbor 10.10.10.6 update-source Loopback0
!--- 配置BGP 邻居.
!
!--- Customer A and B commands.
address-family vpnv4
!--- 进入address-family vpnv4 配置模式,配置和PE/P 路由器间的MP-BGP 路由会话。
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community both
!--- Sends the community attribute to a BGP neighbor.
exit-address-family
!
!--- Customer B commands.
address-family ipv4 vrf Customer_B
!--- 进入address-family ipv4 的配置模式下,配置和CE 间的路由会话,
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A commands.
address-family ipv4 vrf Customer_A
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
ip classless
!
end
#p#
Pesaro
Current configuration:
!
version 12.1
!
hostname Pesaro
!
!--- Customer A commands.
ip vrf Customer_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
!--- Customer B commands.
ip vrf Customer_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
ip cef
!
interface Loopback0
ip address 10.10.10.6 255.255.255.255
ip router isis
!--- Customer A commands.
interface Loopback101
ip vrf forwarding Customer_A
ip address 200.0.6.1 255.255.255.0
!
!--- Customer B commands.
interface Loopback102
ip vrf forwarding Customer_B
ip address 200.0.6.1 255.255.255.0
!
!--- Customer A commands.
interface Loopback111
ip vrf forwarding Customer_A
ip address 200.1.6.1 255.255.255.0
!
interface Serial0/0
no ip address
encapsulation frame-relay
no ip mroute-cache
random-detect
!
interface Serial0/0.1 point-to-point
description link to Pomerol
bandwidth 512
ip address 10.1.1.22 255.255.255.252
ip router isis
tag-switching ip
frame-relay interface-dlci 603
!
router isis
net 49.0001.0000.0000.0006.00
is-type level-1
!
router bgp 100
neighbor 10.10.10.4 remote-as 100
neighbor 10.10.10.4 update-source Loopback0
!
!--- Customer B commands.
address-family ipv4 vrf Customer_B
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A commands.
address-family ipv4 vrf Customer_A
redistribute connected
no auto-summary
no synchronization
exit-address-family
!
!--- Customer A and B commands.
address-family vpnv4
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community both
exit-address-family
!
ip classless
!
end
Pomerol
Current configuration:
!
version 12.0
!
hostname Pomerol
!
ip cef
!
interface Loopback0
ip address 10.10.10.3 255.255.255.255
ip router isis
!
interface Serial0/1
no ip address
no ip directed-broadcast
encapsulation frame-relay
random-detect
!
interface Serial0/1.1 point-to-point
description link to Pauillac
ip address 10.1.1.6 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching mtu 1520
tag-switching ip
frame-relay interface-dlci 301
!
interface Serial0/1.2 point-to-point
description link to Pulligny
ip address 10.1.1.9 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 303
!
interface Serial0/1.3 point-to-point
description link to Pesaro
ip address 10.1.1.21 255.255.255.252
no ip directed-broadcast
ip router isis
tag-switching ip
frame-relay interface-dlci 306
!
router isis
net 49.0001.0000.0000.0003.00
is-type level-1
!
ip classless
!
end 更多请看Cisco与华为技术网(Vlan9.com)VPN技术、MPLS路由协议专题、SSL VPN详细知识介绍专题专题,或进入论坛讨论。
相关专题
- VPN技术 (1104篇文章)
- MPLS路由协议专题 (552篇文章)
- SSL VPN详细知识介绍专题 (1104篇文章)
- MPLS VPN (150篇文章)
- MPLS协议 (400篇文章)
论坛精华
阅读排行榜
- 重新认识MPLS VPN (7次浏览)
- 走出VPN客户端地址分配的误区 (6次浏览)
- ISA Server实验环境搭建与企业VPN配置 (1次浏览)
最新技术文档
- ISA Server实验环境搭建与企业VPN配置 04-19
- 走出VPN客户端地址分配的误区 04-14
- 重新认识MPLS VPN 04-11
- 侠诺SSL VPN到底有多实用? 04-09
- MPLS VPN 的基本配置 1 04-07
- MPLS VPN 的基本配置 2 04-07
- MPLS VPN技术及其在中国的应用和未来 04-07
- 组播是如何在MPLS VPN网络中实现的 04-07
- 清华大学SSL VPN项目案例剖析 03-28
- 浅谈如何在VPN中使用网络加密 03-24
热门关键字导读
