News
发布日期:2023-05-15 浏览次数:2154 来源:WOLF-LAB
CCIE培训(EI方向)考试学习-MPLS解决BGP路由黑洞实验含拓扑
WOLFLAB官方微信:17316362402,欢迎关注【WOLFLAB网络实验室】,了解更多关于CCIE培训相关技术!最近EI CCIE、CCIE安全版本都稳定过人中,联系WOLFLAB咨询详情!
CCIE培训MPLS实验
如图所示,R1属于Site-A, R2属于Site-B,R2/R3/R4/R5作为运营商
根据拓扑配置设备IP地址;
使用OSPF协议配置运营商内部的底层网络,进程号为“1”;
R2-R5建立IBGP邻居,R1-R2、R5-R6建立EBGP邻居;
在R1和R6上将Loopback0口网段宣告进BGP;
在运营商网络内部启用MPLS,并观察实验现象。
Note:为了方便观察实验现象,你可以限制每台路由器所分发的标签范围
2 使用镜像
R1-R6:vIOS Version 15.8(3)M2
3 底层配置
3.1 配置运营商底层
R2:
R2(config)#interface Loopback0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#exit
R2(config)#interface GigabitEthernet0/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface GigabitEthernet0/1
R2(config-if)#ip address 23.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#
R3:
R3(config)#interface Loopback0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#exit
R3(config)#interface GigabitEthernet0/1
R3(config-if)#ip address 23.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface GigabitEthernet0/0
R3(config-if)#ip address 34.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#
R4:
R4(config)#interface Loopback0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
R4(config-if)#exit
R4(config)#interface GigabitEthernet0/0
R4(config-if)#ip address 34.1.1.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#interface GigabitEthernet0/1
R4(config-if)#ip address 45.1.1.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#
R5:
R5(config)#interface Loopback0
R5(config-if)#ip address 5.5.5.5 255.255.255.255
R5(config-if)#exit
R5(config)#interface GigabitEthernet0/1
R5(config-if)#ip address 45.1.1.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#interface GigabitEthernet0/0
R5(config-if)#ip address 56.1.1.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#
CCIE培训MPLS实验
底层OSPF
R2:
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#exit
R2(config)#interface Loopback0
R2(config-if)#ip ospf 1 area 0
R2(config-if)#exit
R2(config)#interface GigabitEthernet0/1
R2(config-if)#ip ospf 1 area 0
R2(config-if)#exit
R3:
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#exit
R3(config)#interface Loopback0
R3(config-if)#ip ospf 1 area 0
R3(config-if)#exit
R3(config)#interface GigabitEthernet0/0
R3(config-if)#ip ospf 1 area 0
R3(config-if)#exit
R3(config)#interface GigabitEthernet0/1
R3(config-if)#ip ospf 1 area 0
R3(config-if)#exit
R4:
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#exit
R4(config)#interface Loopback0
R4(config-if)#ip ospf 1 area 0
R4(config-if)#exit
R4(config)#interface GigabitEthernet0/0
R4(config-if)#ip ospf 1 area 0
R4(config-if)#exit
R4(config)#interface GigabitEthernet0/1
R4(config-if)#ip ospf 1 area 0
R4(config-if)#exit
R5:
R5(config)#router ospf 1
R5(config-router)#router-id 5.5.5.5
R5(config-router)#exit
R5(config)#interface Loopback0
R5(config-if)#ip ospf 1 area 0
R5(config-if)#exit
R5(config)#interface GigabitEthernet0/1
R5(config-if)#ip ospf 1 area 0
R5(config-if)#exit
3.2 配置Site-A&Site-B底层
R1:
R1(config)#interface GigabitEthernet0/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface Loopback0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#
R6:
R6(config)#interface GigabitEthernet0/0
R6(config-if)#ip address 56.1.1.6 255.255.255.0
R6(config-if)#no shutdown
R6(config-if)#exit
R6(config)#interface Loopback0
R6(config-if)#ip address 6.6.6.6 255.255.255.255
R6(config-if)#exit
R6(config)#
3.3 配置BGP
R2:
R2(config)#router bgp 2345
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 5.5.5.5 remote-as 2345
R2(config-router)#neighbor 5.5.5.5 update-source Loopback0
R2(config-router)#neighbor 5.5.5.5 next-hop-self
R2(config-router)#neighbor 12.1.1.1 remote-as 100
R2(config-router)#exit
R2(config)#
R5:
R5(config)#router bgp 2345
R5(config-router)#bgp router-id 5.5.5.5
R5(config-router)#neighbor 2.2.2.2 remote-as 2345
R5(config-router)#neighbor 2.2.2.2 update-source Loopback0
R5(config-router)#neighbor 2.2.2.2 next-hop-self
R5(config-router)#neighbor 56.1.1.6 remote-as 600
R5(config-router)#exit
R5(config)#
R1:
R1(config)#router bgp 100
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#neighbor 12.1.1.2 remote-as 2345
R1(config-router)#network 1.1.1.1 mask 255.255.255.255
R1(config-router)#exit
R1(config)#
R6:
R6(config)#router bgp 600
R6(config-router)#bgp router-id 6.6.6.6
R6(config-router)#neighbor 56.1.1.6 remote-as 2345
R6(config-router)#network 6.6.6.6 mask 255.255.255.255
R6(config-router)#exit
R6(config)#
4 观察现象
4.1 查看BGP表
R1:
R1#show ip bgp
BGP table version is 3, local router ID is 1.1.1.1
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,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 6.6.6.6/32 12.1.1.2 0 2345 600 i
R1#
R2:
R2#show ip bgp
BGP table version is 3, 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, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 12.1.1.1 0 0 100 i
*>i 6.6.6.6/32 5.5.5.5 0 100 0 600 i
R2#
R5:
R5#show ip bgp
BGP table version is 3, local router ID is 5.5.5.5
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,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 2.2.2.2 0 100 0 100 i
*> 6.6.6.6/32 56.1.1.6 0 0 600 i
R5#
R6:
R6#show ip bgp
BGP table version is 3, local router ID is 6.6.6.6
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,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 56.1.1.5 0 2345 100 i
*> 6.6.6.6/32 0.0.0.0 0 32768 i
R6#
4.2 测试可达性
R1:
R1#ping 6.6.6.6 source Loopback0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.....
Success rate is 0 percent (0/5)
R1#
R1无法使用Loopback0接口ping通6.6.6.6
4.3 查看路由表
R1:
R1#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 12.1.1.2 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [20/0] via 12.1.1.2, 00:10:52
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, GigabitEthernet0/0
L 12.1.1.1/32 is directly connected, GigabitEthernet0/0
R1#
R2:
R2#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [20/0] via 12.1.1.1, 00:12:30
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 23.1.1.3, 01:36:01, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/3] via 23.1.1.3, 01:35:30, GigabitEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/4] via 23.1.1.3, 01:35:06, GigabitEthernet0/1
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [200/0] via 5.5.5.5, 00:11:29
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, GigabitEthernet0/0
L 12.1.1.2/32 is directly connected, GigabitEthernet0/0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, GigabitEthernet0/1
L 23.1.1.2/32 is directly connected, GigabitEthernet0/1
34.0.0.0/24 is subnetted, 1 subnets
O 34.1.1.0 [110/2] via 23.1.1.3, 01:35:40, GigabitEthernet0/1
45.0.0.0/24 is subnetted, 1 subnets
O 45.1.1.0 [110/3] via 23.1.1.3, 01:35:16, GigabitEthernet0/1
R2#
R3:
R3#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 23.1.1.2, 01:37:15, GigabitEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 34.1.1.4, 01:36:50, GigabitEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/3] via 34.1.1.4, 01:36:20, GigabitEthernet0/0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, GigabitEthernet0/1
L 23.1.1.3/32 is directly connected, GigabitEthernet0/1
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.1.1.0/24 is directly connected, GigabitEthernet0/0
L 34.1.1.3/32 is directly connected, GigabitEthernet0/0
45.0.0.0/24 is subnetted, 1 subnets
O 45.1.1.0 [110/2] via 34.1.1.4, 01:36:30, GigabitEthernet0/0
R3#
R4:
R4#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/3] via 34.1.1.3, 01:37:18, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 34.1.1.3, 01:37:18, GigabitEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/2] via 45.1.1.5, 01:36:53, GigabitEthernet0/1
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/2] via 34.1.1.3, 01:37:18, GigabitEthernet0/0
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.1.1.0/24 is directly connected, GigabitEthernet0/0
L 34.1.1.4/32 is directly connected, GigabitEthernet0/0
45.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 45.1.1.0/24 is directly connected, GigabitEthernet0/1
L 45.1.1.4/32 is directly connected, GigabitEthernet0/1
R4#
R5:
R5#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [200/0] via 2.2.2.2, 00:14:28
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/4] via 45.1.1.4, 01:37:13, GigabitEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/3] via 45.1.1.4, 01:37:13, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 45.1.1.4, 01:37:13, GigabitEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [20/0] via 56.1.1.6, 00:13:27
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/3] via 45.1.1.4, 01:37:13, GigabitEthernet0/1
34.0.0.0/24 is subnetted, 1 subnets
O 34.1.1.0 [110/2] via 45.1.1.4, 01:37:13, GigabitEthernet0/1
45.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 45.1.1.0/24 is directly connected, GigabitEthernet0/1
L 45.1.1.5/32 is directly connected, GigabitEthernet0/1
56.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 56.1.1.0/24 is directly connected, GigabitEthernet0/0
L 56.1.1.5/32 is directly connected, GigabitEthernet0/0
R5#
R6:
R6#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 56.1.1.5 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [20/0] via 56.1.1.5, 00:14:30
6.0.0.0/32 is subnetted, 1 subnets
C 6.6.6.6 is directly connected, Loopback0
56.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 56.1.1.0/24 is directly connected, GigabitEthernet0/0
L 56.1.1.6/32 is directly connected, GigabitEthernet0/0
R6#
从上述输出可见:R3和R4是路由黑洞,没有1.1.1.1/32和6.6.6.6/32网段的路由
5 MPLS配置
5.1 配置MPLS
R2:
R2(config)#mpls label protocol ldp //配置标签分发协议为LDP
R2(config)#mpls ldp router-id Loopback0 //配置LDP的router-id
R2(config)#mpls label range 2000 2999 //配置标签的分发范围
R2(config)#interface GigabitEthernet0/1
R2(config-if)#mpls ip //接口下启用MPLS
R2(config-if)#exit
R2(config)#
R3:
R3(config)#mpls label protocol ldp //配置标签分发协议为LDP
R3(config)#mpls ldp router-id Loopback0 //配置LDP的router-id
R3(config)#mpls label range 3000 3999 //配置标签的分发范围
R3(config)#interface GigabitEthernet0/0
R3(config-if)#mpls ip //接口下启用MPLS
R3 (config-if)#exit
R3(config)#interface GigabitEthernet0/1
R3(config-if)#mpls ip //接口下启用MPLS
R3(config-if)#exit
R3(config)#
R4:
R4(config)#mpls label protocol ldp //配置标签分发协议为LDP
R4(config)#mpls ldp router-id Loopback0 //配置LDP的router-id
R4(config)#mpls label range 4000 4999 //配置标签的分发范围
R4(config)#interface GigabitEthernet0/0
R4(config-if)#mpls ip //接口下启用MPLS
R4 (config-if)#exit
R4(config)#interface GigabitEthernet0/1
R4(config-if)#mpls ip //接口下启用MPLS
R4(config-if)#exit
R4(config)#
R5:
R5(config)#mpls label protocol ldp //配置标签分发协议为LDP
R5(config)#mpls ldp router-id Loopback0 //配置LDP的router-id
R5(config)#mpls label range 5000 5999 //配置标签的分发范围
R5(config)#interface GigabitEthernet0/1
R5(config-if)#mpls ip //接口下启用MPLS
R5(config-if)#exit
R5(config)#
6 现象分析
6.1 相关show命令
Router#show mpls ldp neighbor //查看LDP邻居
Router#show ip route //查看RIB
Router#show ip cef //查看FIB
Router#show mpls ldp bindings //查看LIB
Router#show mpls forwarding-table //查看LFIB
6.2 查看RIB
R2:
R2# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [20/0] via 12.1.1.1, 00:29:19
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 23.1.1.3, 01:52:50, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/3] via 23.1.1.3, 01:52:19, GigabitEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/4] via 23.1.1.3, 01:51:55, GigabitEthernet0/1
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [200/0] via 5.5.5.5, 00:28:18
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, GigabitEthernet0/0
L 12.1.1.2/32 is directly connected, GigabitEthernet0/0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, GigabitEthernet0/1
L 23.1.1.2/32 is directly connected, GigabitEthernet0/1
34.0.0.0/24 is subnetted, 1 subnets
O 34.1.1.0 [110/2] via 23.1.1.3, 01:52:29, GigabitEthernet0/1
45.0.0.0/24 is subnetted, 1 subnets
O 45.1.1.0 [110/3] via 23.1.1.3, 01:52:05, GigabitEthernet0/1
R2#
R3:
R3# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 23.1.1.2, 01:54:30, GigabitEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 34.1.1.4, 01:54:05, GigabitEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/3] via 34.1.1.4, 01:53:35, GigabitEthernet0/0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, GigabitEthernet0/1
L 23.1.1.3/32 is directly connected, GigabitEthernet0/1
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.1.1.0/24 is directly connected, GigabitEthernet0/0
L 34.1.1.3/32 is directly connected, GigabitEthernet0/0
45.0.0.0/24 is subnetted, 1 subnets
O 45.1.1.0 [110/2] via 34.1.1.4, 01:53:45, GigabitEthernet0/0
R3#
R4:
R4# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/3] via 34.1.1.3, 01:55:10, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 34.1.1.3, 01:55:10, GigabitEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/2] via 45.1.1.5, 01:54:45, GigabitEthernet0/1
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/2] via 34.1.1.3, 01:55:10, GigabitEthernet0/0
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.1.1.0/24 is directly connected, GigabitEthernet0/0
L 34.1.1.4/32 is directly connected, GigabitEthernet0/0
45.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 45.1.1.0/24 is directly connected, GigabitEthernet0/1
L 45.1.1.4/32 is directly connected, GigabitEthernet0/1
R4#
R5:
R5# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [200/0] via 2.2.2.2, 00:32:35
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/4] via 45.1.1.4, 01:55:20, GigabitEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/3] via 45.1.1.4, 01:55:20, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 45.1.1.4, 01:55:20, GigabitEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [20/0] via 56.1.1.6, 00:31:34
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/3] via 45.1.1.4, 01:55:20, GigabitEthernet0/1
34.0.0.0/24 is subnetted, 1 subnets
O 34.1.1.0 [110/2] via 45.1.1.4, 01:55:20, GigabitEthernet0/1
45.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 45.1.1.0/24 is directly connected, GigabitEthernet0/1
L 45.1.1.5/32 is directly connected, GigabitEthernet0/1
56.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 56.1.1.0/24 is directly connected, GigabitEthernet0/0
L 56.1.1.5/32 is directly connected, GigabitEthernet0/0
R5#
从上述输出可见:R3和R4依然是路由黑洞,没有1.1.1.1/32和6.6.6.6/32网段的路由。
6.3 查看FIB
R2:
R2# show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
1.1.1.1/32 12.1.1.1 GigabitEthernet0/0
2.2.2.2/32 receive Loopback0
3.3.3.3/32 23.1.1.3 GigabitEthernet0/1
4.4.4.4/32 23.1.1.3 GigabitEthernet0/1
5.5.5.5/32 23.1.1.3 GigabitEthernet0/1
6.6.6.6/32 23.1.1.3 GigabitEthernet0/1
12.1.1.0/24 attached GigabitEthernet0/0
12.1.1.0/32 receive GigabitEthernet0/0
12.1.1.1/32 attached GigabitEthernet0/0
12.1.1.2/32 receive GigabitEthernet0/0
12.1.1.255/32 receive GigabitEthernet0/0
23.1.1.0/24 attached GigabitEthernet0/1
23.1.1.0/32 receive GigabitEthernet0/1
23.1.1.2/32 receive GigabitEthernet0/1
23.1.1.3/32 attached GigabitEthernet0/1
23.1.1.255/32 receive GigabitEthernet0/1
34.1.1.0/24 23.1.1.3 GigabitEthernet0/1
45.1.1.0/24 23.1.1.3 GigabitEthernet0/1
127.0.0.0/8 drop
224.0.0.0/4 drop
224.0.0.0/24 receive
240.0.0.0/4 drop
255.255.255.255/32 receive
R2# show ip cef 6.6.6.6
6.6.6.6/32
nexthop 23.1.1.3 GigabitEthernet0/1 label 3002-(local:2002)
R2#
R3:
R3# show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
2.2.2.2/32 23.1.1.2 GigabitEthernet0/1
3.3.3.3/32 receive Loopback0
4.4.4.4/32 34.1.1.4 GigabitEthernet0/0
5.5.5.5/32 34.1.1.4 GigabitEthernet0/0
23.1.1.0/24 attached GigabitEthernet0/1
23.1.1.0/32 receive GigabitEthernet0/1
23.1.1.2/32 attached GigabitEthernet0/1
23.1.1.3/32 receive GigabitEthernet0/1
23.1.1.255/32 receive GigabitEthernet0/1
34.1.1.0/24 attached GigabitEthernet0/0
34.1.1.0/32 receive GigabitEthernet0/0
34.1.1.3/32 receive GigabitEthernet0/0
34.1.1.4/32 attached GigabitEthernet0/0
34.1.1.255/32 receive GigabitEthernet0/0
45.1.1.0/24 34.1.1.4 GigabitEthernet0/0
127.0.0.0/8 drop
224.0.0.0/4 drop
224.0.0.0/24 receive
240.0.0.0/4 drop
255.255.255.255/32 receive
R3#
R4:
R4# show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
2.2.2.2/32 34.1.1.3 GigabitEthernet0/0
3.3.3.3/32 34.1.1.3 GigabitEthernet0/0
4.4.4.4/32 receive Loopback0
5.5.5.5/32 45.1.1.5 GigabitEthernet0/1
23.1.1.0/24 34.1.1.3 GigabitEthernet0/0
34.1.1.0/24 attached GigabitEthernet0/0
34.1.1.0/32 receive GigabitEthernet0/0
34.1.1.3/32 attached GigabitEthernet0/0
34.1.1.4/32 receive GigabitEthernet0/0
34.1.1.255/32 receive GigabitEthernet0/0
45.1.1.0/24 attached GigabitEthernet0/1
45.1.1.0/32 receive GigabitEthernet0/1
45.1.1.4/32 receive GigabitEthernet0/1
45.1.1.5/32 attached GigabitEthernet0/1
45.1.1.255/32 receive GigabitEthernet0/1
127.0.0.0/8 drop
224.0.0.0/4 drop
224.0.0.0/24 receive
240.0.0.0/4 drop
255.255.255.255/32 receive
R4#
R5:
R5# show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
1.1.1.1/32 45.1.1.4 GigabitEthernet0/1
2.2.2.2/32 45.1.1.4 GigabitEthernet0/1
3.3.3.3/32 45.1.1.4 GigabitEthernet0/1
4.4.4.4/32 45.1.1.4 GigabitEthernet0/1
5.5.5.5/32 receive Loopback0
6.6.6.6/32 56.1.1.6 GigabitEthernet0/0
23.1.1.0/24 45.1.1.4 GigabitEthernet0/1
34.1.1.0/24 45.1.1.4 GigabitEthernet0/1
45.1.1.0/24 attached GigabitEthernet0/1
45.1.1.0/32 receive GigabitEthernet0/1
45.1.1.4/32 attached GigabitEthernet0/1
45.1.1.5/32 receive GigabitEthernet0/1
45.1.1.255/32 receive GigabitEthernet0/1
56.1.1.0/24 attached GigabitEthernet0/0
56.1.1.0/32 receive GigabitEthernet0/0
56.1.1.5/32 receive GigabitEthernet0/0
56.1.1.6/32 attached GigabitEthernet0/0
56.1.1.255/32 receive GigabitEthernet0/0
127.0.0.0/8 drop
224.0.0.0/4 drop
224.0.0.0/24 receive
240.0.0.0/4 drop
255.255.255.255/32 receive
R5#
R5# show ip cef 1.1.1.1
1.1.1.1/32
nexthop 45.1.1.4 GigabitEthernet0/1 label 4000-(local:5000)
R5#
从上述输出可见:R3和R4虽然是路由黑洞,没有1.1.1.1/32和6.6.6.6/32网段的路由,但是目的地址1.1.1.1的数据包在R2-R3链路上是通过标签转发的,目的地址6.6.6.6的数据包在R5-R4上亦是如此。
6.4 R1-R2之间的链路
R1查看FIB发包:
R2#show ip cef
6.6.6.6/32
nexthop 12.1.1.2 GigabitEthernet0/0
R2#
R1发出的是一个IP包,下一跳R2。
6.5 R2-R3之间的链路
R2:
R2#show mpls ldp bindings
lib entry: 2.2.2.2/32, rev 2
local binding: label: imp-null
remote binding: lsr: 3.3.3.3:0, label: 3000
lib entry: 3.3.3.3/32, rev 4
local binding: label: 2000
remote binding: lsr: 3.3.3.3:0, label: imp-null
lib entry: 4.4.4.4/32, rev 6
local binding: label: 2001
remote binding: lsr: 3.3.3.3:0, label: 3001
lib entry: 5.5.5.5/32, rev 8
local binding: label: 2002
remote binding: lsr: 3.3.3.3:0, label: 3002
lib entry: 12.1.1.0/24, rev 10
local binding: label: imp-null
lib entry: 23.1.1.0/24, rev 12
local binding: label: imp-null
remote binding: lsr: 3.3.3.3:0, label: imp-null
lib entry: 34.1.1.0/24, rev 14
local binding: label: 2003
remote binding: lsr: 3.3.3.3:0, label: imp-null
lib entry: 45.1.1.0/24, rev 16
local binding: label: 2004
remote binding: lsr: 3.3.3.3:0, label: 3003
R2#
CCIE培训MPLS实验
从上述输出可以看出:R2为5.5.5.5/32这条路由分配的标签是2002,下一跳R3为5.5.5.5/32这条路由分配的标签是3002,而且R2并未给BGP路由6.6.6.6/32分配标签。
R2收到的是IP包,所以查询FIB:
R2# show ip cef 6.6.6.6
6.6.6.6/32
nexthop 23.1.1.3 GigabitEthernet0/1 label 3002-(local:2002)
R2#
从上述输出得知:虽然R2并未给BGP路由6.6.6.6/32分配标签,但是R2会为被6.6.6.6/32这条路由所匹配的数据包打上下一跳5.5.5.5所对应的出标签3002
6.6 R3-R4之间的链路
R3收到的是标签包,标签3002,所以查询LFIB:
R3# show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
3000 Pop Label 2.2.2.2/32 5269 Gi0/1 23.1.1.2
3001 Pop Label 4.4.4.4/32 0 Gi0/0 34.1.1.4
3002 4002 5.5.5.5/32 5659 Gi0/0 34.1.1.4
3003 Pop Label 45.1.1.0/24 0 Gi0/0 34.1.1.4
R3#
通过LFIB得知:R3将收到数据包中的标签3002替换成4002,下一跳R4。
6.7 R4-R5之间的链路
R4收到的是标签包,标签4002,所以查询LFIB:
R4# show mpls forwarding-table
R4#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
4000 3000 2.2.2.2/32 6404 Gi0/0 34.1.1.3
4001 Pop Label 3.3.3.3/32 0 Gi0/0 34.1.1.3
4002 Pop Label 5.5.5.5/32 6031 Gi0/1 45.1.1.5
4003 Pop Label 23.1.1.0/24 0 Gi0/0 34.1.1.3
R4#
通过LFIB得知:R4将收到数据包中的标签4002替换成隐含空标签(次末跳弹出),下一跳R5,由于收到的数据包只有单层标签,所以交给R5的数据包将是一个IP包。
6.8 R5-R6之间的链路
R5收到的是IP包,所以查询FIB:
R5# show ip cef 6.6.6.6
6.6.6.6/32
nexthop 56.1.1.6 GigabitEthernet0/0
R5#
CCIE培训MPLS实验
学网络就选WOLFLAB(沃尔夫)网络实验室
思科认证CCIE培训(EI方向)稳定过人中,联系网站客服预约免费试听!
我们提供:
CCNA|CCNP|EI CCIE;HCIA|HCIP|HCIE Datacom|VMware等培训课程