CCNP-23 路由重发布3
实验拓扑:
实验要求:R1与R2之间采用集成的ISIS路由协议,R2与R3之间采用OSPF路由协议,配置重发布,使R1与R3之间可以相互学习到对方的路由。
试验目的:掌握OSPF与ISIS之间路由重发布的配置。
实验配置:
R1:
R1(config)#router isis
R1(config-router)#net 49.0001.1111.1111.1111.00
R1(config-router)#is-type level-1
R1(config-router)#exit
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int loop0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R1(config)#int loop1
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R1(config)#int loop2
R1(config-if)#ip add 172.16.2.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R1(config)#int loop3
R1(config-if)#ip add 172.16.3.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R1(config)#int loop4
R1(config-if)#ip add 172.16.4.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R1(config)#int loop5
R1(config-if)#ip add 172.16.5.1 255.255.255.0
R1(config-if)#ip router isis
R1(config-if)#exit
R2:
R2(config)#router isis
R2(config-router)#net 49.0001.2222.2222.2222.00
R2(config-router)#exit
R2(config)#int s1/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shu
R2(config-if)#ip router isis
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip router isis
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#ip add 199.99.2.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip ospf network point-to-point
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 199.99.2.0 0.0.0.255 area 0
R2(config-router)#exit
R3:
R3(config)#int s1/0
R3(config-if)#ip add 199.99.2.2 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int loop0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 199.99.2.0 0.0.0.255 area 0
R3(config-router)#exit
R3(config)#int loop1
R3(config-if)#ip add 172.17.1.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop2
R3(config-if)#ip add 172.17.2.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop3
R3(config-if)#ip add 172.17.3.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop4
R3(config-if)#ip add 172.17.4.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop5
R3(config-if)#ip add 172.17.5.1 255.255.255.0
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#network 172.17.1.0 0.0.0.255 area 0
R3(config-router)#network 172.17.2.0 0.0.0.255 area 0
R3(config-router)#network 172.17.3.0 0.0.0.255 area 0
R3(config-router)#network 172.17.4.0 0.0.0.255 area 0
R3(config-router)#network 172.17.5.0 0.0.0.255 area 0
R3(config-router)#end
以上为基本的配置,配置完成后我们来查看一下每台路由器的路由表:
R1#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 199.99.1.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
i L1 2.2.2.0 [115/20] via 199.99.1.2, Serial1/0
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C 172.16.4.0/24 is directly connected, Loopback4
C 172.16.5.0/24 is directly connected, Loopback5
C 172.16.1.0/24 is directly connected, Loopback1
C 172.16.2.0/24 is directly connected, Loopback2
C 172.16.3.0/24 is directly connected, Loopback3
C 199.99.1.0/24 is directly connected, Serial1/0
i*L1 0.0.0.0/0 [115/10] via 199.99.1.2, Serial1/0
ISIS路由除了一条R2的loopback地址外还有一条缺省路由。
R2#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
1.0.0.0/24 is subnetted, 1 subnets
i L1 1.1.1.0 [115/20] via 199.99.1.1, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
172.17.0.0/32 is subnetted, 5 subnets
O 172.17.4.1 [110/65] via 199.99.2.2, 00:00:13, Serial1/1
O 172.17.5.1 [110/65] via 199.99.2.2, 00:00:13, Serial1/1
O 172.17.1.1 [110/65] via 199.99.2.2, 00:00:13, Serial1/1
O 172.17.2.1 [110/65] via 199.99.2.2, 00:00:13, Serial1/1
O 172.17.3.1 [110/65] via 199.99.2.2, 00:00:13, Serial1/1
172.16.0.0/24 is subnetted, 5 subnets
i L1 172.16.4.0 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.5.0 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.1.0 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.2.0 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.3.0 [115/20] via 199.99.1.1, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
分别列出了从ISIS和OSPF学到的路由。
R3#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
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
172.17.0.0/24 is subnetted, 5 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
C 199.99.2.0/24 is directly connected, Serial1/0
R3只有直连路由被列出来了,呵呵!
下面开始在R2上配置路由重发布,首先,先将OSPF路由重发布到ISIS中去:
R2(config)#router isis
R2(config-router)#redistribute ospf 100 level-1 metric 5
R2(config-router)#exit
重发布OSPF 100的路由以level-1的形式洪泛到ISIS中,并且定义其度量值为5,然后在R1上查看路由表:
R1#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 199.99.1.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
i L1 2.2.2.0 [115/20] via 199.99.1.2, Serial1/0
172.17.0.0/32 is subnetted, 5 subnets
i L1 172.17.4.1 [115/15] via 199.99.1.2, Serial1/0
i L1 172.17.5.1 [115/15] via 199.99.1.2, Serial1/0
i L1 172.17.1.1 [115/15] via 199.99.1.2, Serial1/0
i L1 172.17.2.1 [115/15] via 199.99.1.2, Serial1/0
i L1 172.17.3.1 [115/15] via 199.99.1.2, Serial1/0
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C 172.16.4.0/24 is directly connected, Loopback4
C 172.16.5.0/24 is directly connected, Loopback5
i L1 172.16.0.0/16 [115/15] via 199.99.1.2, Serial1/0
C 172.16.1.0/24 is directly connected, Loopback1
C 172.16.2.0/24 is directly connected, Loopback2
C 172.16.3.0/24 is directly connected, Loopback3
i L1 199.99.2.0/24 [115/15] via 199.99.1.2, Serial1/0
C 199.99.1.0/24 is directly connected, Serial1/0
i*L1 0.0.0.0/0 [115/10] via 199.99.1.2, Serial1/0
上面用红颜色标记出来的都是从OSPF中学习到的路由,并且度量值为15(ISIS默认所有接口的度量值为10),然后我们再在R2上配置,将ISIS路由重发布到OSPF中:
R2(config)#router ospf 100
R2(config-router)#redistribute isis level-1 metric 10 subnets
R2(config-router)#exit
重发布ISIS level-1的路由到OSPF中,并且定义其度量值为10。然后再到R3上查看路由表:
R3#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
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/10] via 199.99.2.1, 00:00:04, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
172.17.0.0/24 is subnetted, 5 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
172.16.0.0/24 is subnetted, 5 subnets
O E2 172.16.4.0 [110/10] via 199.99.2.1, 00:00:04, Serial1/0
O E2 172.16.5.0 [110/10] via 199.99.2.1, 00:00:04, Serial1/0
O E2 172.16.1.0 [110/10] via 199.99.2.1, 00:00:05, Serial1/0
O E2 172.16.2.0 [110/10] via 199.99.2.1, 00:00:05, Serial1/0
O E2 172.16.3.0 [110/10] via 199.99.2.1, 00:00:05, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/0
好的,看到了O E2的路由了,接下来的工作就是配置路由汇总来减小路由表的大小了,在R2上配置:
R2(config)#router ospf 100
R2(config-router)#summary-address 172.16.0.0 255.255.0.0
R2(config-router)#exit
R2(config)#router isis
R2(config-router)#summary-address 172.17.0.0 255.255.0.0 level-1
R2(config-router)#end
两个路由协议的路由汇总配置差不多。然后再分别查看R1与R3的路由表:
R1#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 199.99.1.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
i L1 2.2.2.0 [115/20] via 199.99.1.2, Serial1/0
i L1 172.17.0.0/16 [115/15] via 199.99.1.2, Serial1/0
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C 172.16.4.0/24 is directly connected, Loopback4
C 172.16.5.0/24 is directly connected, Loopback5
i L1 172.16.0.0/16 [115/15] via 199.99.1.2, Serial1/0
C 172.16.1.0/24 is directly connected, Loopback1
C 172.16.2.0/24 is directly connected, Loopback2
C 172.16.3.0/24 is directly connected, Loopback3
i L1 199.99.2.0/24 [115/15] via 199.99.1.2, Serial1/0
C 199.99.1.0/24 is directly connected, Serial1/0
i*L1 0.0.0.0/0 [115/10] via 199.99.1.2, Serial1/0
路由被汇总了,再看看R3的:
R3#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
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/10] via 199.99.2.1, 00:00:57, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
172.17.0.0/24 is subnetted, 5 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
O E2 172.16.0.0/16 [110/10] via 199.99.2.1, 00:00:02, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/0
同样也只剩下了一条汇总路由。下面我们来看一下R2的路由表:
R2#show ip
*Nov 7 19:52:17.211: %SYS-5-CONFIG_I: Configured from console by consoleroute
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
1.0.0.0/24 is subnetted, 1 subnets
i L1 1.1.1.0 [115/20] via 199.99.1.1, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
172.17.0.0/16 is variably subnetted, 6 subnets, 2 masks
O 172.17.4.1/32 [110/65] via 199.99.2.2, 00:06:37, Serial1/1
O 172.17.5.1/32 [110/65] via 199.99.2.2, 00:06:37, Serial1/1
O 172.17.1.1/32 [110/65] via 199.99.2.2, 00:06:37, Serial1/1
i su 172.17.0.0/16 [115/5] via 0.0.0.0, Null0
O 172.17.2.1/32 [110/65] via 199.99.2.2, 00:06:37, Serial1/1
O 172.17.3.1/32 [110/65] via 199.99.2.2, 00:06:37, Serial1/1
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
i L1 172.16.4.0/24 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.5.0/24 [115/20] via 199.99.1.1, Serial1/0
O 172.16.0.0/16 is a summary, 00:02:21, Null0
i L1 172.16.1.0/24 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.2.0/24 [115/20] via 199.99.1.1, Serial1/0
i L1 172.16.3.0/24 [115/20] via 199.99.1.1, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
实验总结:掌握ISIS和OSPF路由协议之间的路由重发布的配置,以及路由汇总的配置方法。
本文转自loveme2351CTO博客,原文链接:http://blog.51cto.com/loveme23/49592 ,如需转载请自行联系原作者