




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
CCNP第二十一讲-MPLS VPNVPN的分类:Overlay VPN:运营商端设备对于客户端来说是透明的,不负责、不介入路由的传递,不存储私网路由,主要在客户端配置,费用低。点到点VPN:运营商端路由器参与私网传递。主要在运营商端进行配置。Mpls vpn比覆盖性vpn更安全,费用较高。MPLS VRF:(Virtual Routing Forwarding)一个VRF就是一个mpls vpn 的进程或者实例,一台PE,为一个公司提供MPLS VPN,就要为该公司同一个本地唯一的VRF进程。PE路由器上每一个VPN用户都有有一个VRF。区分不同的VRF,为每个VRF启用不同的名称,VRF的名称对于PE路由器只具有本地意义。PE路由器除了维护全局 IP 路由表之外,还为每个VRF维护一张独立的IP 路由表,这张路由表称为VRF路由表。PE创建了一个VRF进程,一定要将其和某个连接CE接口关联,用来存储该公传递过来的私网路由。VRF的名称对于PE路由器只具有本地意义。如何让来自不同公司的内网路由在ISP内网区分?RD(Router Distinguishers)路由区分器64bit,只具有本地意义,X:Y, RD的功能并不是VPN标示符,因为在一些复杂的VPN环境中,可能一个VPN存在多个 RD。RD的最重要的两个功能: 1. 与32bits 的Ipv4前缀一起构成96bits 的VPNv4前缀; 2. 如果不同的VPN客户,存在相同的IP v4地址空间,那么可以通过设置不同的RD值从而保证前缀的唯一性为不同的公司定义不同RD值VPNv4路由:P路由器不参与VPNv4路由传递,R2如何把VPNv4路由传递到R3?使用BGPv4加。R3收到VPNv4路由加入到那张路由表,因为R3的接受接口没有跟任何VRF接口关联。RT:R3通过RT指导该如何把VPNv4路由加入到哪一张表。RT(Router Target)Route Targets 这玩意就是用来区分VPN customer的。是BGP community 的扩展属性,在VRF中进行配置。它跟在VPNv4前缀后面被一起传递。一条路由可以附加多个RT值.RT定义了两个操作:Export :导出,Import 导入Export RTs 通过在vrf 中定义export RT 值,将使得输出的VPNv4路由携带上该RT 值一起传递 以BGP扩展community 的方式。注意这些VPNv4路由,是由VPN客户的 IPv4 路由导入 VRF后,加上 VRF中配置的RD值所形成的。Import RTs PE会从其他 MP-BGP对等体的PE那收到VPNv4的前缀,这些前缀都是携带RT值的。默认情况下,PE是不会将这些VPNv4路由以IPv4的形式装载到VRF路由表里,除非在本地的VRF中,配置import RTs ,那么如果import RTs 与收到的 VPNv4前缀中的RT匹配的话,这些VPNv4前缀才会被以IPv4的形式装载到相应的VRF路由表里,相当于在这里 RT起到一个前缀过滤或者识别的作用,这个功能在许多场景中非常有用。 VPNv4路由可能携带不止一个RT 值,只要有一个匹配import RT 即可导入到VRF 路由表。RT具有全局意义,RT既要导入又要导出。无论对报文打几层标签,只会处理最外层标签。实验目的:公司A总部的私网路由能通过ISP访问公司A分支的私网。让两个网段看起来像在一个网段内。公司B总部和分支能通过ISP互相访问。1. 首先配置R1、R2、R3、R4、R5、R6接口IP,确保直连接口可以ping通。R1(config)#int loopback 0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config)#int fa0/0R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config)#no shutdownR1(config)#int fa1/0R1(config-if)#ip address 13.1.1.1 255.255.255.0R1(config)#no shutdownR2(config)#int loopback 0R2(config-if)#ip address 2.2.2.2 255.255.255.0R2(config)#int fa0/0R2(config-if)#ip address 12.1.1.2 255.255.255.0R2(config-if)#no shutdownR3(config)#int loopback 0R3(config-if)#ip address 3.3.3.3 255.255.255.0R3(config)#int fa0/0R3(config-if)#ip address 13.1.1.3 255.255.255.0R3(config-if)#no shutdownR4(config)#int loopback 0R4(config-if)#ip address 4.4.4.4 255.255.255.0R4(config)#int s0/0R4(config-if)#ip address 24.1.1.4 255.255.255.0R4(config-if)#no shutdownR5(config)#int loopback 0R5(config-if)#ip address 5.5.5.5 255.255.255.0R5(config)#int s0/0R5(config-if)#ip address 35.1.1.5 255.255.255.0R5(config-if)#no shutdownR6(config)#int loopback 0R6(config-if)#ip address 6.6.6.6 255.255.255.0R6(config)#int s0/0R6(config-if)#ip address 26.2.2.6 255.255.255.0R6(config-if)#no shutdownR7(config)#int loopback 0R7(config-if)#ip address 7.7.7.7 255.255.255.0R7(config)#int s0/0R7(config-if)#ip address 37.1.1.7 255.255.255.0R7(config-if)#noshutdown2. 配置MPLS BACKBONE的IGP路由器,本实验采用rip(一般ISP使用IS-IS)在R1、R2、R3之间运行RIPR1(config)#router ripR1(config-router)#version 2R1(config-router)#no auto-summaryR1(config-router)#network 1.0.0.0R1(config-router)#network 12.0.0.0R1(config-router)#network 13.0.0.0R2(config)#router ripR2(config-rouetr)#version 2R2(config-router)#no auto-summaryR2(config-router)#network 2.0.0.0R2(config-router)#network 12.0.0.0R3(config)#router ripR3(config-router)#version 2R3(config-router)#no auto-summaryR3(config-router)#network 3.0.0.0R3(config-router)#network 13.0.0.03. 查看MPLS骨干网路由表,确认IGP是否正常工作R2#show ip route rip 1.0.0.0/24 is subnetted, 1 subnetsR 1.1.1.0 120/1 via 12.1.1.1, 00:00:06, FastEthernet0/0 3.0.0.0/24 is subnetted, 1 subnetsR 3.3.3.0 120/2 via 12.1.1.1, 00:00:06, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnetsR 13.1.1.0 120/1 via 12.1.1.1, 00:00:06, FastEthernet0/0R2#4. 配置PE路由器(R2、R3)的MPLSR2(config)#int fa0/0R2(config-if)#mpls ipR3(config)#int fa0/0R3(config-if)#mpls ip选择使用环回口作为LSR的router-idR1(config)#mpls ldp router-id loopback 0 forceR2(config)#mpls ldp router-id loopback 0 forceR3(config)#mpls ldp router-id loopback 0 force5配置骨干路由器P(R1)的MPLS在ISP内网路由器启用CEFR1(config)#ip cefR2(config)#ip cefR3(config)#ip cef接口开启标签交换功能R1(config)#int fa0/0R1(config-if)#mpls ipR1(config)#int fa1/0R1(config-if)#mpls ip6在任意一台MPLS骨干路由器查看FLIB(标签转发表),确认MPLS正常工作R2#show mpls forwarding-tableLocal Outgoing Prefix Bytes tag Outgoing Next Hoptag tag or VC or Tunnel Id switched interface16 Pop tag 1.1.1.0/24 0 Fa0/0 12.1.1.117 17 3.3.3.0/24 0 Fa0/0 12.1.1.118 Pop tag 13.1.1.0/24 0 Fa0/0 12.1.1.1R2#查看FIB表R2#show ip cefPrefix Next Hop Interface0.0.0.0/0 drop Null0 (default route handler entry)0.0.0.0/32 receive1.1.1.0/24 12.1.1.1 FastEthernet0/02.2.2.0/24 attached Loopback02.2.2.0/32 receive2.2.2.2/32 receive2.2.2.255/32 receive3.3.3.0/24 12.1.1.1 FastEthernet0/012.1.1.0/24 attached FastEthernet0/012.1.1.0/32 receive12.1.1.1/32 12.1.1.1 FastEthernet0/012.1.1.2/32 receive12.1.1.255/32 receive13.1.1.0/24 12.1.1.1 FastEthernet0/0224.0.0.0/4 drop224.0.0.0/24 receive255.255.255.255/32 receiveR2#查看mpls邻居信息R1#show mpls ldp neighbor Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0 TCP connection: 2.2.2.2.39042 - 1.1.1.1.646 State: Oper; Msgs sent/rcvd: 98/98; Downstream Up time: 01:19:47 LDP discovery sources: FastEthernet0/0, Src IP addr: 12.1.1.2 Addresses bound to peer LDP Ident: 12.1.1.2 2.2.2.2 Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 1.1.1.1:0 TCP connection: 3.3.3.3.16193 - 1.1.1.1.646 State: Oper; Msgs sent/rcvd: 99/98; Downstream Up time: 01:19:28 LDP discovery sources: FastEthernet1/0, Src IP addr: 13.1.1.3 Addresses bound to peer LDP Ident: 13.1.1.3 3.3.3.3R1#R2#show mpls ldp binding tib entry: 1.1.1.0/24, rev 2 local binding: tag: 16 remote binding: tsr: 1.1.1.1:0, tag: imp-null tib entry: 2.2.2.0/24, rev 4 local binding: tag: imp-null remote binding: tsr: 1.1.1.1:0, tag: 16 tib entry: 3.3.3.0/24, rev 6 local binding: tag: 17 remote binding: tsr: 1.1.1.1:0, tag: 17 tib entry: 12.1.1.0/24, rev 8 local binding: tag: imp-null remote binding: tsr: 1.1.1.1:0, tag: imp-null tib entry: 13.1.1.0/24, rev 10 local binding: tag: 18 remote binding: tsr: 1.1.1.1:0, tag: imp-null7. 配置VRFR2(config)#ip vrf AR2(config-vrf)#rd 10:10R2(config-vrf)#route-target 10:10R2(config)#int s1/0R2(config-if)#ip vrf forwarding A /将vrf与接口关联起来R2(config-if)#ip address 24.1.1.2 255.255.255.0R2(config-if)#no shutdown注意L配置vrf与接口关联,会使接口原来配置的IP地址丢失,重新配置一次就好R3(config)#ip vrf AR3(config-vrf)#rd 10 :10R3(config-vrf)#route-target 10:10R3(config)#int s1/0R3(config-if)#ip vrf forwarding AR3(config-if)#ip address 35.1.1.3 255.255.255.0R3(config-if)#no shutdownR2#Show ip vrfR2#show ip vrf Name Default RD Interfaces A 10:10 Se1/0 B 20:20 Se1/1R2#8. 在两台PE路由器上配置BGP配置BGP协议是为了启用MP-BGP,用于在PE路由器之间交换VPN路由。由于BGP创建邻居时,不要求对等体物理直连,因此BGP使用tcp179端口进行邻居的会话R2(config)#router bgp 1R2(config-router)#no auto-summaryR2(config-router)#no synchronizationR2(config-router)#no bgp default ipv4-unicastR2(config-router)#bgp router-id 2.2.2.2R2(config-router)#neighbor 3.3.3.3 remote-as 1R2(config-router)#neighbor 3.3.3.3 update-source loopback 0R2(config-router)#neighbor 3.3.3.3 next-hop-selfR3(config)#router bgp 1R3(config-router)#no auto-summaryR3(config-router)#no synchronizationR3(config-router)#no bgp default ipv4-unicastR3(config-router)#bgp router-id 3.3.3.3R3(config-router)#neighbor 2.2.2.2 remote-as 1R3(config-router)#neighbor 2.2.2.2 update-source loopback 09. 激活两台PE路由器MP-BGP协议,其目的是用于交换不同VPN CE上的路由R2(config)#router bgp1R2(config-router)#address-family vpnv4/要启用MP-BGP协议,必须在VPNV4的地址簇夏激活R2(config-router-af)#neighbor 3.3.3.3 activate /用于激活MP-BGP邻居的路由交换R2(config-router-af)#neighbor 3.3.3.3 send-community both /启用两种BGP交换R2(config-router-af)#no auto-summaryR3(config)#router bgp 1R3(config-router)#address-family vpnv4R3(config-router-af)#neighbor 2.2.2.2 activateR3(config-router-af)#neighbor 2.2.2.2 send-community bothR3(config-router-af)#no auto-summary启用扩展共用体交换的目的是,为了MP-BGP携带RD和起源场点属性。11. 查看R2或者R5的MP-BGP协议状态,发现现在并没有相关路由R2#show ip bgp all summaryFor address family: VPNv4 UnicastBGP router identifier 2.2.2.2, local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd3.3.3.3 4 1 6 6 1 0 0 00:02:44 0R2#配置PE和CE之间的路由选择协议和MP-BGP与RIP之间的路由重分发.配置R2、R4之间R2(config)#ip route vrf A 4.4.4.0 255.255.255.0 s1/0 24.1.1.4R2(config)#router bgp 1R2(config-router)#address-famiy ipv4 vrf AR2(config-router-af)#redistribute static 10R4(config)#ip route 5.5.5.0 s0/0 24.1.1.2配置R3、R5之间R3(config)#router ripR3(config-router)#version 2R3(config-router)#no auto-summaryR3(config-router)#address-family ipv4 vrf A/启用IPv4地址家族,配置rip与vrf转发表之间的关系。R3(config-router-af)#network 35.0.0.0R5(config)#router ripR5(config-router)#version 2R5(config-router)#no auto-summaryR5(config-router)#network 5.0.0.0R5(config-router)#network 35.0.0.0重分发R3(config)#router ripR3(config-router)#address-family ipv4 vrf AR3(config-router-af)#redistribute bgp 1 metric transparent /重分发的BGP路由度量值不变即保留bgp原始的度量值。R3(config)#router bgp 1R3(config-router)#address-family ipv4 vrf AR3(config-router-af)#redistribute rip metric 10R3查看VRF表R3#show ip route vrf ARouting Table: ACodes: 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 routeGateway of last resort is not set 35.0.0.0/24 is subnetted, 1 subnetsC 35.1.1.0 is directly connected, Serial1/0 4.0.0.0/24 is subnetted, 1 subnetsB 4.4.4.0 200/10 via 2.2.2.2, 00:25:12查看R5的路由表R5#sh ip routeCodes: 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 routeGateway of last resort is not set 35.0.0.0/24 is subnetted, 1 subnetsC 35.1.1.0 is directly connected, Serial0/0 4.0.0.0/24 is subnetted, 1 subnetsR 4.4.4.0 120/10 via 35.1.1.3, 00:00:05, Serial0/0 5.0.0.0/24 is subnetted, 1 subnetsC 5.5.5.0 is directly connected, Loopback0R5#查看R4的路由表R4#show ip routeCodes: 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 routeGateway of last resort is not set 4.0.0.0/24 is subnetted, 1 subnetsC 4.4.4.0 is directly connected, Loopback0 5.0.0.0/24 is subnetted, 1 subnetsS 5.5.5.0 1/0 via 24.1.1.2, Serial0/0 24.0.0.0/24 is subnetted, 1 subnetsC 24.1.1.0 is directly connected, Serial0/0R4#配置R2、R6和R3、R7R2(config)#ip vrf BR2(config-vrf)#rd 20:20R2(config-vrf)#route-target 20:20R2(config)#int s1/1R2(config-if)#ip vrf forwarding BR2(config-if)#ip address 26.1.1.2 255.255.255.0R2(config-if)#no shutdownR3(config)#ip vrf BR3(config-vrf)#rd 20:20R3(config-vrf)#route-target 20:20R3(config)#int s1/1R3(config-if)#ip vrf forwarding BR3(config-if)#ip address 37.1.1.3 255.255.255.0R3(config-if)#no shutdown配置PE和CE之间的路由选择协议和MP-BGP与RIP之间的路由重分发.配置R6、R2R2(config)#router eigrp 90R2(config-router)#no auto-summaryR2(config-router)#address-family ipv4 vrf BR2(config-router-af)#network 26.1.1.2 0.0.0.0R2(config-router-af)#sutononmous system 90R6(config)#router eigrp 90R6(config-router)#no auto-summaryR6(config-router)#network 6.6.6.6 0.0.0.0R6(config-router)#26.1.1.6 0.0.0.0重分发:R2(config)#router eigrp 90R2(config-router)#address-family ipv4 vrf BR2(config-router)#redistribute bgp 1 metric 10000 100 255 1 1500R2(config)#router bgp 1R2(config-router)#address-family ipv4 vrf BR2(config-router-af)#redistribute eigrp 90 metric 10配置R3、R7R3(config)#router ospf 110 vrf BR3(config-router)#router-id 3.3.3.3R3(config-router)#network 37.1.1.3 0.0.0.0 area 0R7(config)#router ospf 110R7(config-router)#router-id 7.7.7.7R7(config-router)#network 7.7.7.7 0.0.0.0 area 0R7(config-router)#network 37.1.1.7 0.0.0.0 area 0重分发R3(config)#router ospf 110 vrf BR3(config-router)#redistribute bgp 1 subnetsR3(config)#router bgp 1R3(config-router)#address-family ipv4
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 鹿邑烧烤活动方案
- 集体活动喂香蕉活动方案
- 航空物流考试题及答案
- 韩国国旗考试题及答案
- 骨科高级考试题及答案
- 幼儿园教学教案设计:报纸时装周环保材料立体裁剪
- 产品质量跟进保障承诺书9篇范文
- 企业品牌推广及形象宣传材料制作标准模板
- 服装手绘考试题及答案
- 法语口语表达与交际技巧教学教案
- 军训遇雨活动方案
- 残值评估与定价模型-洞察阐释
- 意式轻奢软装设计
- 2025-2030年中国宠物服务行业市场深度调研及投资前景与投资策略研究报告
- 胖东来考勤管理制度
- 地质灾害风险评估与防治
- 物理实验安全培训
- 小区物业管家管理制度
- 第三届全国技能大赛竞赛-无人机驾驶(植保)选拔赛备考试题库(附答案)
- 《烹饪营养与安全》考试复习题库(含答案)
- 加快建设教育强国-2025年上半年形势与政策
评论
0/150
提交评论