实验目的
熟悉Back-to-Back解决方案工作机制。
熟练的掌握配置校验命令。
实验拓扑
接口IP配置:
R1(config)#interface e0/1
R1(config-if)#ip address 17.17.17.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface e0/0
R1(config-if)#ip address 12.12.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R2(config)#interface e0/0
R2(config-if)#ip address 12.12.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface e0/1
R2(config-if)#ip address 23.23.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R3(config)#interface e0/1
R3(config-if)#ip address 23.23.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface e0/0
R3(config-if)#ip address 34.34.34.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R4(config)#interface e0/0
R4(config-if)#ip address 34.34.34.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#interface e0/1
R4(config-if)#ip address 45.45.45.4 255.255.255.0
R4(config-if)#no shutdown
R4(config)#interface loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.0
R5(config)#interface e0/1
R5(config-if)#ip address 45.45.45.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#interface e0/0
R5(config-if)#ip address 56.56.56.5 255.255.255.0
R5(config-if)#no shutdown
R5(config)#interface loopback 0
R5(config-if)#ip address 5.5.5.5 255.255.255.0
R6(config)#interface e0/0
R6(config-if)#ip address 56.56.56.6 255.255.255.0
R6(config-if)#no shutdown
R6(config-if)#interface e0/1
R6(config-if)#ip address 68.68.68.6 255.255.255.0
R6(config-if)#no shutdown
R6(config)#interface loopback 0
R6(config-if)#ip address 6.6.6.6 255.255.255.0
R7(config)#interface e0/1
R7(config-if)#ip address 17.17.17.7 255.255.255.0
R7(config-if)#no shutdown
R7(config)#interface loopback 0
R7(config-if)#ip address 7.7.7.7 255.255.255.0
R8(config)#interface e0/1
R8(config-if)#ip address 68.68.68.8 255.255.255.0
R8(config-if)#no shutdown
R8(config)#interface loopback 0
R8(config-if)#ip address 8.8.8.8 255.255.255.0
完成AS1内及AS2内P-NETWORK及PE、CE间协议配置
R7(config)#router ospf 1
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 17.17.17.7 0.0.0.0 area 0
R8(config)#router ospf 1
R8(config-router)#router-id 8.8.8.8
R8(config-router)#network 8.8.8.8 0.0.0.0 area 0
R8(config-router)#network 68.68.68.8 0.0.0.0 area 0
R1(config)#ip vrf vpn
R1(config-vrf)#rd 100:100
R1(config-vrf)#route-target 100:100
R1(config)#mpls label protocol ldp
R1(config)#mpls label range 100 199
R1(config)#mpls ldp router-id loopback 0
R1(config-if)#router isis
R1(config-router)#net 49.0001.0000.0000.0001.00
R1(config)#interface loopback 0
R1(config-if)#ip router isis
R1(config)#interface e0/0
R1(config-if)#ip router isis
R1(config-if)#mpls ip
R1(config-if)#interface e0/1
R1(config-if)#ip vrf forwarding vpn
R1(config-if)#ip address 17.17.17.1 255.255.255.0
R1(config)#router ospf 1 vrf vpn
R1(config-router)#router-id 1.1.1.1
R1(config-router)#redistribute bgp 1 subnets
R1(config-router)#network 17.17.17.1 0.0.0.0 area 0
R1(config-router)#router bgp 1
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#neighbor 2.2.2.2 remote-as 1
R1(config-router)#neighbor 2.2.2.2 update-source loopback 0
R1(config-router)#address-family vpnv4
R1(config-router-af)#neighbor 2.2.2.2 activate
R1(config-router-af)#neighbor 2.2.2.2 send-community extended
R1(config-router)#address-family ipv4 vrf vpn
R1(config-router-af)#redistribute ospf 1
R2(config)#router isis
R2(config-router)#net 49.0001.0000.0000.0002.00
R2(config)#mpls label protocol ldp
R2(config)#mpls label range 200 299
R2(config)#mpls ldp router-id loopback 0
R2(config)#interface loopback 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip router isis
R2(config-if)#interface e0/0
R2(config-if)#ip router isis
R2(config-if)#mpls ip
R2(config-if)#interface e0/1
R2(config-if)#ip router isis
R2(config-if)#mpls ip
R2(config-if)#router bgp 1
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 1.1.1.1 remote-as 1
R2(config-router)#neighbor 1.1.1.1 update-source loopback 0
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)#address-family vpnv4
R2(config-router-af)#neighbor 1.1.1.1 activate
R2(config-router-af)#neighbor 1.1.1.1 route-reflector-client
R2(config-router-af)#neighbor 3.3.3.3 activate
R2(config-router-af)#neighbor 3.3.3.3 route-reflector-client
R3(config)#router isis
R3(config-router)#net 49.0001.0000.0000.0003.00
R3(config)#mpls label protocol ldp
R3(config)#mpls label range 300 399
R3(config)#mpls ldp router-id loopback 0
R3(config)#interface e0/1
R3(config-if)#ip router isis
R3(config-if)#mpls ip
R3(config)#interface loopback 0
R3(config-if)#ip router isis
R3(config-if)#router bgp 1
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
R3(config-router)#address-family vpnv4 unicast
R3(config-router-af)#neighbor 2.2.2.2 activate
R4(config)#router isis
R4(config-router)#net 49.0002.0000.0000.0004.00
R4(config)#mpls label protocol ldp
R4(config)#mpls label range 400 499
R4(config)#mpls ldp router-id loopback 0
R4(config)#interface loopback 0
R4(config-if)#ip router isis
R4(config-if)#interface e0/1
R4(config-if)#ip router isis
R4(config-if)#mpls ip
R4(config-if)#router bgp 2
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#neighbor 5.5.5.5 remote-as 2
R4(config-router)#neighbor 5.5.5.5 update-source loopback 0
R4(config-router)#address-family vpnv4 unicast
R4(config-router-af)#neighbor 5.5.5.5 activate
R5(config)#router isis
R5(config-router)#net 49.0002.0000.0000.0005.00
R5(config)#mpls label protocol ldp
R5(config)#mpls label range 500 599
R5(config)#mpls ldp router-id loopback 0
R5(config)#interface loopback 0
R5(config-if)#ip router isis
R5(config-if)#interface e0/1
R5(config-if)#ip router isis
R5(config-if)#mpls ip
R5(config-if)#interface e0/0
R5(config-if)#ip router isis
R5(config-if)#mpls ip
R5(config-if)#router bgp 2
R5(config-router)#bgp router-id 5.5.5.5
R5(config-router)#neighbor 4.4.4.4 remote-as 2
R5(config-router)#neighbor 4.4.4.4 update-source loopback 0
R5(config-router)#neighbor 6.6.6.6 remote-as 2
R5(config-router)#neighbor 6.6.6.6 update-source loopback 0
R5(config-router)#address-family vpnv4 unicast
R5(config-router-af)#neighbor 4.4.4.4 activate
R5(config-router-af)#neighbor 4.4.4.4 route-reflector-client
R5(config-router-af)#neighbor 6.6.6.6 activate
R5(config-router-af)#neighbor 6.6.6.6 route-reflector-client
R6(config)#ip vrf vpn
R6(config-vrf)#rd 100:100
R6(config-vrf)#route-target 100:100
R6(config)#router isis
R6(config-router)#net 49.0002.0000.0000.0006.00
R6(config)#mpls label protocol ldp
R6(config)#mpls label range 600 699
R6(config)#mpls ldp router-id loopback 0
R6(config)#interface loopback 0
R6(config-if)#ip router isis
R6(config-if)#interface e0/0
R6(config-if)#ip router isis
R6(config-if)#mpls ip
R6(config-if)#interface e0/1
R6(config-if)#ip vrf forwarding vpn
R6(config-if)#router ospf 1 vrf vpn
R6(config-router)#router-id 6.6.6.6
R6(config-router)#redistribute bgp 2 subnets
R6(config-router)#net 68.68.68.6 0.0.0.0 area 0
R6(config-router)#router bgp 2
R6(config-router)#bgp router-id 6.6.6.6
R6(config-router)#neighbor 5.5.5.5 remote-as 2
R6(config-router)#neighbor 5.5.5.5 update-source loopback 0
R6(config-router)#address-family vpnv4
R6(config-router-af)#neighbor 5.5.5.5 activate
R6(config-router-af)#neighbor 5.5.5.5 send-community extended
R6(config-router)#address-family ipv4 vrf vpn
R6(config-router-af)#redistribute ospf 1
完成如上步骤后确认AS1,AS2 MP-BGP 对等体关系正常建立、R1 R6 能正常学习C-NETWORK路由。
R2#show ip bgp all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 1 35 33 7 0 0 00:25:46 2
3.3.3.3 4 1 26 29 7 0 0 00:20:44 0
R2#show ip bgp vpnv4 all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 1 36 34 7 0 0 00:26:41 2
3.3.3.3 4 1 27 30 7 0 0 00:21:39 0
R5#show ip bgp all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
4.4.4.4 4 2 15 15 3 0 0 00:09:18 0
6.6.6.6 4 2 12 10 3 0 0 00:05:12 2
R5#show ip bgp vpnv4 all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
4.4.4.4 4 2 16 16 3 0 0 00:09:48 0
6.6.6.6 4 2 12 11 3 0 0 00:05:42 2
R7#ping 17.17.17.1 source 7.7.7.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.17.1, timeout is 2 seconds:
Packet sent with a source address of 7.7.7.7
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R8#ping 68.68.68.6 source 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 68.68.68.6, timeout is 2 seconds:
Packet sent with a source address of 8.8.8.8
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
在R3 R4 上创建VRF,建立基于VRF EBGP PEER 关系。
R3(config)#ip vrf vpn
R3(config-vrf)#rd 100:100
R3(config-vrf)#route-target 100:100
R3(config)#interface e0/0
R3(config-if)#ip vrf forwarding vpn
R3(config-if)#ip add 34.34.34.3 255.255.255.0
R3(config-if)#router bgp 1
R3(config-router)#address-family ipv4 vrf vpn
R3(config-router-af)#neighbor 34.34.34.4 remote-as 2
R4(config)#ip vrf vpn
R4(config-vrf)#rd 100:100
R4(config-vrf)#route-target 100:100
R4(config)#interface e0/0
R4(config-if)#ip vrf forwarding vpn
R4(config-if)#ip add 34.34.34.4 255.255.255.0
R4(config-if)#router bgp 2
R4(config-router)#neighbor 34.34.34.3 remote-as 1
R4(config-router)#address-family ipv4 vrf vpn
R4(config-router-af)#neighbor 34.34.34.3 remote-as 1
校验R3 R4上是否建立了EBGP PEER 关系,并且是否交换了路由信息。
R3#show ip bgp vpnv4 all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 1 58 51 7 0 0 00:41:34 2
34.34.34.4 4 2 9 10 7 0 0 00:03:38 2
R4#show ip bgp vpnv4 all summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
5.5.5.5 4 2 41 38 7 0 0 00:29:01 2
34.34.34.3 4 1 10 10 7 0 0 00:04:06 2
R3#show ip bgp vpnv4 all
BGP table version is 7, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:100 (default for vrf vpn)
*>i 7.7.7.7/32 1.1.1.1 11 100 0 ?
*> 8.8.8.8/32 34.34.34.4 0 2 ?
*>i 17.17.17.0/24 1.1.1.1 0 100 0 ?
*> 68.68.68.0/24 34.34.34.4 0 2 ?
R4#show ip bgp vpnv4 all
BGP table version is 7, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:100 (default for vrf vpn)
*> 7.7.7.7/32 34.34.34.3 0 1 ?
*>i 8.8.8.8/32 6.6.6.6 11 100 0 ?
*> 17.17.17.0/24 34.34.34.3 0 1 ?
*>i 68.68.68.0/24 6.6.6.6 0 100 0 ?
如上现象表明R3 R4已经建立了EBGP PEER 关系,并且相互交换了C-NETWORK 路由。
R7上PING R8 loop back 0网络,测试跨域MPLS VXN 是否生效。
R7#ping 8.8.8.8 source 7.7.7.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
Packet sent with a source address of 7.7.7.7
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
//R7 与R8已经成功通讯。
如上现象表明OPTION A 跨域的MPLS VXN 已经完成。