怀柔成都网站建设,成都市自住房建设网站,中国建造师官方网站查询,兰州网站建设哪家公司好MPLS 配置以下面拓扑为例配置MPLS 拓扑说明#xff1a;R1#xff0c;R2、R3路由器上分别配置Loopback1 接口#xff0c;IP地址分别为1.1.1.1#xff0c;2.2.2.2 3.3.3.3#xff1b;并配置OSPF#xff0c;让MPLS区域内的地址可以进行标签交换1、在MPLS区域配置标签交换R1R1R2、R3路由器上分别配置Loopback1 接口IP地址分别为1.1.1.12.2.2.2 3.3.3.3并配置OSPF让MPLS区域内的地址可以进行标签交换1、在MPLS区域配置标签交换R1interface Serial0/0 ip address 12.1.1.1 255.255.255.0 mpls label protocol ldp mpls ipR2mpls label protocol ldpinterface Serial0/0 ip address 12.1.1.2 255.255.255.0 mpls ip serial restart-delay 0!interface Serial0/1 ip address 23.1.1.2 255.255.255.0 mpls ip serial restart-delay 0R3:interface Serial0/1 ip address 23.1.1.3 255.255.255.0 mpls label protocol ldp mpls ip serial restart-delay 0验证R1、R3双方的Loopback1接口已经进行标签交换R1#traceroute 3.3.3.3Type escape sequence to abort.Tracing the route to 3.3.3.3 1 12.1.1.2 [MPLS: Label 17 Exp 0] 56 msec 40 msec 40 msec 2 23.1.1.3 40 msec * 40 msec2、在R1、R3间配置普通的BGP保证BGP邻居的建立R1#sh run | section bgprouter bgp 100 no synchronization bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 100 neighbor 3.3.3.3 update-source Loopback1 no auto-summaryR1#R3#sh run | section bgprouter bgp 100 no synchronization bgp log-neighbor-changes neighbor 1.1.1.1 remote-as 100 neighbor 1.1.1.1 update-source Loopback1 no auto-summaryR3#验证BGP邻居已经正常建立R1#sh ip bgp summary BGP router identifier 1.1.1.1, local AS number 100BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd3.3.3.3 4 100 20 20 1 0 0 00:17:42 0R1#3、在PE上创建VRF需要通信的两个用户网络的VRF与RD值要保持一致R1ip vrf ***1 rd 100:1 !R3ip vrf ***1 rd 100:1!4、在PE上将连接CE的接口划入到相应的VRF中这样表示从该接口进入的流量均通过VRF进行转发R1interface Serial0/1 ip vrf forwarding ***1 ip address 14.1.1.1 255.255.255.0 serial restart-delay 0R3!interface Serial0/0 ip vrf forwarding ***1 ip address 23.1.1.3 255.255.255.0 mpls label protocol ldp mpls ip serial restart-delay 0!在这里需要注意的是当把一个接口加入到VRF中时接口IP地址会丢失需要重新配置IP地址。在PE上查看VRF路由表R1#sh ip route vrf ***1Routing Table: ***1Codes: 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 14.0.0.0/24 is subnetted, 1 subnetsC 14.1.1.0 is directly connected, Serial0/1R1#在这里接口14.1.1.4已经进入VRF路由表需要说明的是该接口路由不会再出现在全局路由表中。5、在R1、R3上创建MP-BGP帮助传递用户网络信息R1router bgp 100 no synchronization bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 100 neighbor 3.3.3.3 update-source Loopback1 no auto-summary ! address-family ***v4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community both exit-address-familyR3router bgp 100 no synchronization bgp log-neighbor-changes neighbor 1.1.1.1 remote-as 100 neighbor 1.1.1.1 update-source Loopback1 no auto-summary ! address-family ***v4 neighbor 1.1.1.1 activate neighbor 1.1.1.1 send-community both exit-address-family验证MP-BGP邻居已经建立R1#sh ip bgp all summary For address family: IPv4 UnicastBGP router identifier 1.1.1.1, local AS number 100BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd3.3.3.3 4 100 45 46 1 0 0 00:08:45 0For address family: ×××v4 UnicastBGP router identifier 1.1.1.1, local AS number 100BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd3.3.3.3 4 100 45 46 1 0 0 00:08:45 0R1#6、为MP-BGP创建VRF表R1(config)#router bgp 100R1(config-router)#address-family ipv4 vrf ***1R3(config)#router bgp 100 R3(config-router)#address-family ipv4 vrf ***17、配置PE-CE路由协议在LAN1用户网络边缘配置RIPR1#sh running-config | section riprouter rip version 2 no auto-summary ! address-family ipv4 vrf ***1 redistribute bgp 100 metric 1 network 14.0.0.0 no auto-summary exit-address-familyR4#sh running-config | section riprouter rip version 2 network 10.0.0.0 network 14.0.0.0 no auto-summary 在LAN2用户网络边缘配置OSPFR3#sh running-config | section ospfrouter ospf 100 vrf ***1 router-id 36.1.1.3 log-adjacency-changes redistribute bgp 100 subnets network 36.1.1.3 0.0.0.0 area 0R6#sh running-config | section ospfrouter ospf 100 router-id 6.6.6.6 log-adjacency-changes network 36.1.1.6 0.0.0.0 area 0 network 192.168.1.6 0.0.0.0 area 0R6#验证PE R1路由器已经收到LAN1内部路由信息R1#sh ip route vrf ***1Routing Table: ***1Codes: 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 10.0.0.0/24 is subnetted, 1 subnetsR 10.1.1.0 [120/1] via 14.1.1.4, 00:00:00, Serial0/1 14.0.0.0/24 is subnetted, 1 subnetsC 14.1.1.0 is directly connected, Serial0/1同理验证R3也同样拥有LAN2内部路由信息8、将路由重分布进MP-BGPR1:router bgp 100 address-family ipv4 vrf ***1 redistribute rip no synchronization exit-address-familyR3!router bgp 100 address-family ipv4 vrf ***1 redistribute ospf 100 vrf ***1 no synchronization exit-address-family验证MP-BGP路由到此PE上应该有双方用户网络的路由信息R1#sh ip bgp ***v4 all BGP table version is 9, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight PathRoute Distinguisher: 100:1 (default for vrf ***1)* 10.1.1.0/24 14.1.1.4 1 32768 ?* 14.1.1.0/24 0.0.0.0 0 32768 ?*i36.1.1.0/24 3.3.3.3 0 100 0 ?*i192.168.1.0 3.3.3.3 128 100 0 ?R1#R3#sh ip bgp ***v4 all BGP table version is 9, local router ID is 3.3.3.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight PathRoute Distinguisher: 100:1 (default for vrf ***1)*i10.1.1.0/24 1.1.1.1 1 100 0 ?*i14.1.1.0/24 1.1.1.1 0 100 0 ?* 36.1.1.0/24 0.0.0.0 0 32768 ?* 192.168.1.0 36.1.1.6 128 32768 ?R3#10、查看VRF路由R1#sh ip route vrf ***1Routing Table: ***1Codes: 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 36.0.0.0/24 is subnetted, 1 subnetsB 36.1.1.0 [200/0] via 3.3.3.3, 00:21:27 10.0.0.0/24 is subnetted, 1 subnetsR 10.1.1.0 [120/1] via 14.1.1.4, 00:00:25, Serial0/1B 192.168.1.0/24 [200/128] via 3.3.3.3, 00:21:27 14.0.0.0/24 is subnetted, 1 subnetsC 14.1.1.0 is directly connected, Serial0/1R1#R3#sh ip route vrR3#sh ip route vrf ***1Routing Table: ***1Codes: 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 36.0.0.0/24 is subnetted, 1 subnetsC 36.1.1.0 is directly connected, Serial0/0 10.0.0.0/24 is subnetted, 1 subnetsB 10.1.1.0 [200/1] via 1.1.1.1, 00:28:37O 192.168.1.0/24 [110/128] via 36.1.1.6, 00:22:30, Serial0/0 14.0.0.0/24 is subnetted, 1 subnetsB 14.1.1.0 [200/0] via 1.1.1.1, 00:28:37R3#11、查看CE路由R4#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 routeGateway of last resort is not set 36.0.0.0/24 is subnetted, 1 subnetsR 36.1.1.0 [120/1] via 14.1.1.1, 00:00:25, Serial0/1 10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, Serial0/0R 192.168.1.0/24 [120/1] via 14.1.1.1, 00:00:25, Serial0/1 14.0.0.0/24 is subnetted, 1 subnetsC 14.1.1.0 is directly connected, Serial0/1R4#R6#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 routeGateway of last resort is not set 36.0.0.0/24 is subnetted, 1 subnetsC 36.1.1.0 is directly connected, Serial0/0 10.0.0.0/24 is subnetted, 1 subnetsO E2 10.1.1.0 [110/1] via 36.1.1.3, 00:23:58, Serial0/0C 192.168.1.0/24 is directly connected, Serial0/1 14.0.0.0/24 is subnetted, 1 subnetsO E2 14.1.1.0 [110/1] via 36.1.1.3, 00:23:58, Serial0/0R6#12、测试用户通信R5#traceroute 192.168.1.6Type escape sequence to abort.Tracing the route to 192.168.1.6 1 10.1.1.4 32 msec 36 msec 24 msec 2 14.1.1.1 12 msec 32 msec 40 msec 3 12.1.1.2 [MPLS: Labels 17/22 Exp 0] 68 msec 68 msec 104 msec 4 36.1.1.3 [MPLS: Label 22 Exp 0] 56 msec 96 msec 52 msec 5 36.1.1.6 100 msec * 92 msec 转载于:https://blog.51cto.com/martin1201/978552