CCNP第二十一讲.docx
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CCNP 第二十一
- 资源描述:
-
CCNP第二十一讲-MPLS VPN VPN的分类: 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 0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int fa0/0 R1(config-if)#ip address 12.1.1.1 255.255.255.0 R1(config)#no shutdown R1(config)#int fa1/0 R1(config-if)#ip address 13.1.1.1 255.255.255.0 R1(config)#no shutdown R2(config)#int loopback 0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int fa0/0 R2(config-if)#ip address 12.1.1.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback 0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int fa0/0 R3(config-if)#ip address 13.1.1.3 255.255.255.0 R3(config-if)#no shutdown R4(config)#int loopback 0 R4(config-if)#ip address 4.4.4.4 255.255.255.0 R4(config)#int s0/0 R4(config-if)#ip address 24.1.1.4 255.255.255.0 R4(config-if)#no shutdown R5(config)#int loopback 0 R5(config-if)#ip address 5.5.5.5 255.255.255.0 R5(config)#int s0/0 R5(config-if)#ip address 35.1.1.5 255.255.255.0 R5(config-if)#no shutdown R6(config)#int loopback 0 R6(config-if)#ip address 6.6.6.6 255.255.255.0 R6(config)#int s0/0 R6(config-if)#ip address 26.2.2.6 255.255.255.0 R6(config-if)#no shutdown R7(config)#int loopback 0 R7(config-if)#ip address 7.7.7.7 255.255.255.0 R7(config)#int s0/0 R7(config-if)#ip address 37.1.1.7 255.255.255.0 R7(config-if)#noshutdown 2. 配置MPLS BACKBONE的IGP路由器,本实验采用rip(一般ISP使用IS-IS) 在R1、R2、R3之间运行RIP R1(config)#router rip R1(config-router)#version 2 R1(config-router)#no auto-summary R1(config-router)#network 1.0.0.0 R1(config-router)#network 12.0.0.0 R1(config-router)#network 13.0.0.0 R2(config)#router rip R2(config-rouetr)#version 2 R2(config-router)#no auto-summary R2(config-router)#network 2.0.0.0 R2(config-router)#network 12.0.0.0 R3(config)#router rip R3(config-router)#version 2 R3(config-router)#no auto-summary R3(config-router)#network 3.0.0.0 R3(config-router)#network 13.0.0.0 3. 查看MPLS骨干网路由表,确认IGP是否正常工作 R2#show ip route rip 1.0.0.0/24 is subnetted, 1 subnets R 1.1.1.0 [120/1] via 12.1.1.1, 00:00:06, FastEthernet0/0 3.0.0.0/24 is subnetted, 1 subnets R 3.3.3.0 [120/2] via 12.1.1.1, 00:00:06, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnets R 13.1.1.0 [120/1] via 12.1.1.1, 00:00:06, FastEthernet0/0 R2# 4. 配置PE路由器(R2、R3)的MPLS R2(config)#int fa0/0 R2(config-if)#mpls ip R3(config)#int fa0/0 R3(config-if)#mpls ip 选择使用环回口作为LSR的router-id R1(config)#mpls ldp router-id loopback 0 force R2(config)#mpls ldp router-id loopback 0 force R3(config)#mpls ldp router-id loopback 0 force 5.配置骨干路由器P(R1)的MPLS 在ISP内网路由器启用CEF R1(config)#ip cef R2(config)#ip cef R3(config)#ip cef 接口开启标签交换功能 R1(config)#int fa0/0 R1(config-if)#mpls ip R1(config)#int fa1/0 R1(config-if)#mpls ip 6.在任意一台MPLS骨干路由器查看FLIB(标签转发表),确认MPLS正常工作 R2#show mpls forwarding-table Local Outgoing Prefix Bytes tag Outgoing Next Hop tag tag or VC or Tunnel Id switched interface 16 Pop tag 1.1.1.0/24 0 Fa0/0 12.1.1.1 17 17 3.3.3.0/24 0 Fa0/0 12.1.1.1 18 Pop tag 13.1.1.0/24 0 Fa0/0 12.1.1.1 R2# 查看FIB表 R2#show ip cef Prefix Next Hop Interface 0.0.0.0/0 drop Null0 (default route handler entry) 0.0.0.0/32 receive 1.1.1.0/24 12.1.1.1 FastEthernet0/0 2.2.2.0/24 attached Loopback0 2.2.2.0/32 receive 2.2.2.2/32 receive 2.2.2.255/32 receive 3.3.3.0/24 12.1.1.1 FastEthernet0/0 12.1.1.0/24 attached FastEthernet0/0 12.1.1.0/32 receive 12.1.1.1/32 12.1.1.1 FastEthernet0/0 12.1.1.2/32 receive 12.1.1.255/32 receive 13.1.1.0/24 12.1.1.1 FastEthernet0/0 224.0.0.0/4 drop 224.0.0.0/24 receive 255.255.255.255/32 receive R2# 查看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.3 R1# 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-null 7. 配置VRF R2(config)#ip vrf A R2(config-vrf)#rd 10:10 R2(config-vrf)#route-target 10:10 R2(config)#int s1/0 R2(config-if)#ip vrf forwarding A //将vrf与接口关联起来 R2(config-if)#ip address 24.1.1.2 255.255.255.0 R2(config-if)#no shutdown 注意L配置vrf与接口关联,会使接口原来配置的IP地址丢失,重新配置一次就好 R3(config)#ip vrf A R3(config-vrf)#rd 10 :10 R3(config-vrf)#route-target 10:10 R3(config)#int s1/0 R3(config-if)#ip vrf forwarding A R3(config-if)#ip address 35.1.1.3 255.255.255.0 R3(config-if)#no shutdown R2#Show ip vrf R2#show ip vrf Name Default RD Interfaces A 10:10 Se1/0 B 20:20 Se1/1 R2# 8. 在两台PE路由器上配置BGP配置BGP协议是为了启用MP-BGP,用于在PE路由器之间交换VPN路由。由于BGP创建邻居时,不要求对等体物理直连,因此BGP使用tcp179端口进行邻居的会话 R2(config)#router bgp 1 R2(config-router)#no auto-summary R2(config-router)#no synchronization R2(config-router)#no bgp default ipv4-unicast R2(config-router)#bgp router-id 2.2.2.2 R2(config-router)#neighbor 3.3.3.3 remote-as 1 R2(config-router)#neighbor 3.3.3.3 update-source loopback 0 R2(config-router)#neighbor 3.3.3.3 next-hop-self R3(config)#router bgp 1 R3(config-router)#no auto-summary R3(config-router)#no synchronization R3(config-router)#no bgp default ipv4-unicast R3(config-router)#bgp router-id 3.3.3.3 R3(config-router)#neighbor 2.2.2.2 remote-as 1 R3(config-router)#neighbor 2.2.2.2 update-source loopback 0 9. 激活两台PE路由器MP-BGP协议,其目的是用于交换不同VPN CE上的路由 R2(config)#router bgp1 R2(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-summary R3(config)#router bgp 1 R3(config-router)#address-family vpnv4 R3(config-router-af)#neighbor 2.2.2.2 activate R3(config-router-af)#neighbor 2.2.2.2 send-community both R3(config-router-af)#no auto-summary 启用扩展共用体交换的目的是,为了MP-BGP携带RD和起源场点属性。 11. 查看R2或者R5的MP-BGP协议状态,发现现在并没有相关路由 R2#show ip bgp all summary For address family: VPNv4 Unicast BGP router identifier 2.2.2.2, local AS number 1 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 3.3.3.3 4 1 6 6 1 0 0 00:02:44 0 R2# 配置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.4 R2(config)#router bgp 1 R2(config-router)#address-famiy ipv4 vrf A R2(config-router-af)#redistribute static 10 R4(config)#ip route 5.5.5.0 s0/0 24.1.1.2 配置R3、R5之间 R3(config)#router rip R3(config-router)#version 2 R3(config-router)#no auto-summary R3(config-router)#address-family ipv4 vrf A //启用IPv4地址家族,配置rip与vrf转发表之间的关系。 R3(config-router-af)#network 35.0.0.0 R5(config)#router rip R5(config-router)#version 2 R5(config-router)#no auto-summary R5(config-router)#network 5.0.0.0 R5(config-router)#network 35.0.0.0 重分发 R3(config)#router rip R3(config-router)#address-family ipv4 vrf A R3(config-router-af)#redistribute bgp 1 metric transparent //重分发的BGP路由度量值不变即保留bgp原始的度量值。 R3(config)#router bgp 1 R3(config-router)#address-family ipv4 vrf A R3(config-router-af)#redistribute rip metric 10 R3查看VRF表 R3#show ip route vrf A Routing Table: A Codes: 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 Gateway of last resort is not set 35.0.0.0/24 is subnetted, 1 subnets C 35.1.1.0 is directly connected, Serial1/0 4.0.0.0/24 is subnetted, 1 subnets B 4.4.4.0 [200/10] via 2.2.2.2, 00:25:12 查看R5的路由表 R5#sh ip route Codes: 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 Gateway of last resort is not set 35.0.0.0/24 is subnetted, 1 subnets C 35.1.1.0 is directly connected, Serial0/0 4.0.0.0/24 is subnetted, 1 subnets R 4.4.4.0 [120/10] via 35.1.1.3, 00:00:05, Serial0/0 5.0.0.0/24 is subnetted, 1 subnets C 5.5.5.0 is directly connected, Loopback0 R5# 查看R4的路由表 R4#show ip route Codes: 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 Gateway of last resort is not set 4.0.0.0/24 is subnetted, 1 subnets C 4.4.4.0 is directly connected, Loopback0 5.0.0.0/24 is subnetted, 1 subnets S 5.5.5.0 [1/0] via 24.1.1.2, Serial0/0 24.0.0.0/24 is subnetted, 1 subnets C 24.1.1.0 is directly connected, Serial0/0 R4# 配置R2、R6和R3、R7 R2(config)#ip vrf B R2(config-vrf)#rd 20:20 R2(config-vrf)#route-target 20:20 R2(config)#int s1/1 R2(config-if)#ip vrf forwarding B R2(config-if)#ip address 26.1.1.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#ip vrf B R3(config-vrf)#rd 20:20 R3(config-vrf)#route-target 20:20 R3(config)#int s1/1 R3(config-if)#ip vrf forwarding B R3(config-if)#ip address 37.1.1.3 255.255.255.0 R3(config-if)#no shutdown 配置PE和CE之间的路由选择协议和MP-BGP与RIP之间的路由重分发. 配置R6、R2 R2(config)#router eigrp 90 R2(config-router)#no auto-summary R2(config-router)#address-family ipv4 vrf B R2(config-router-af)#network 26.1.1.2 0.0.0.0 R2(config-router-af)#sutononmous system 90 R6(config)#router eigrp 90 R6(config-router)#no auto-summary R6(config-router)#network 6.6.6.6 0.0.0.0 R6(config-router)#26.1.1.6 0.0.0.0 重分发: R2(config)#router eigrp 90 R2(config-router)#address-family ipv4 vrf B R2(config-router)#redistribute bgp 1 metric 10000 100 255 1 1500 R2(config)#router bgp 1 R2(config-router)#address-family ipv4 vrf B R2(config-router-af)#redistribute eigrp 90 metric 10 配置R3、R7 R3(config)#router ospf 110 vrf B R3(config-router)#router-id 3.3.3.3 R3(config-router)#network 37.1.1.3 0.0.0.0 area 0 R7(config)#router ospf 110 R7(config-router)#router-id 7.7.7.7 R7(config-router)#network 7.7.7.7 0.0.0.0 area 0 R7(config-router)#network 37.1.1.7 0.0.0.0 area 0 重分发 R3(config)#router ospf 110 vrf B R3(config-router)#redistribute bgp 1 subnets R3(config)#router bgp 1 R3(config-router)#address-family ipv4 vrf B R3(config-router)#redistribute ospf 110 vrf B match internal external 1 external 2 15.查看vrf A/B中的R4、R5、R6、R7路由表,确认MPLS VPN配置 16.ping确认路由的有效性 17。查看MP-BGP关于vrf的路由信息 R2#show ip bgp vpnv4 vrf A BGP table version is 16, local router ID is 2.2.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 10:10 (default for vrf A) *> 4.4.4.0/24 24.1.1.4 10 32768 ? *>i5.5.5.0/24 3.3.3.3 10 100 0 ? *>i35.1.1.0/24 3.3.3.3 0 100 0 ? R2# R4#ping 5.5.5.5 s展开阅读全文
咨信网温馨提示:1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。




CCNP第二十一讲.docx



实名认证













自信AI助手
















微信客服
客服QQ
发送邮件
意见反馈



链接地址:https://www.zixin.com.cn/doc/11693332.html