图同(1)是一样的
六、show路由信息(在特权模式下show ip route)
RT4:
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/5] via 172.16.24.1, 00:00:01, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/5] via 172.16.24.1, 00:00:01, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/5] via 172.16.24.1, 00:00:01, Serial0/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
R 5.5.5.5 [120/5] via 172.16.24.1, 00:00:01, Serial0/0
6.0.0.0/32 is subnetted, 1 subnets
R 6.6.6.6 [120/5] via 172.16.24.1, 00:00:01, Serial0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.24.0/30 is directly connected, Serial0/0
C 172.16.4.0/24 is directly connected, Ethernet3/0
10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
R 10.0.15.0/30 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.1.13.0/30 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.1.3.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.2.2.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.1.1.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.2.6.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.0.5.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.2.26.0/30 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.0.56.0/30 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
R 10.0.50.0/24 [120/5] via 172.16.24.1, 00:00:02, Serial0/0
(注意红色部分,可以看出来,如果没有执行重发布的话,单单是RT4上的路由条目是不会有那么多的,这部分就是通过重发布OSPF区域的路由学习到的,而且,注意,这些路由条目都有一个共同点,那就是开销都是5,对吧,这样,在RT2上做的双向重发布就起到了让不同的路由协议互联的效果)
RT3:
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/101] via 10.1.13.1, 00:01:23, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/401] via 10.1.13.1, 00:01:23, Serial0/0
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 E1 4.4.4.4 [110/1400] via 10.1.13.1, 00:01:23, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/201] via 10.1.13.1, 00:01:23, Serial0/0
6.0.0.0/32 is subnetted, 1 subnets
O IA 6.6.6.6 [110/301] via 10.1.13.1, 00:01:23, Serial0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O E1 172.16.24.0/30 [110/1400] via 10.1.13.1, 00:01:23, Serial0/0
O E1 172.16.4.0/24 [110/1400] via 10.1.13.1, 00:01:23, Serial0/0
10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
O IA 10.0.15.0/30 [110/200] via 10.1.13.1, 00:01:23, Serial0/0
C 10.1.13.0/30 is directly connected, Serial0/0
C 10.1.3.0/24 is directly connected, Ethernet3/0
O IA 10.2.2.0/24 [110/410] via 10.1.13.1, 00:01:23, Serial0/0
O 10.1.1.0/24 [110/110] via 10.1.13.1, 00:01:23, Serial0/0
O IA 10.2.6.0/24 [110/310] via 10.1.13.1, 00:01:23, Serial0/0
O IA 10.0.5.0/24 [110/210] via 10.1.13.1, 00:01:23, Serial0/0
O IA 10.2.26.0/30 [110/400] via 10.1.13.1, 00:01:23, Serial0/0
O IA 10.0.56.0/30 [110/300] via 10.1.13.1, 00:01:23, Serial0/0
O E1 10.0.50.0/24 [110/1200] via 10.1.13.1, 00:01:23, Serial0/0
(前面有OE1的都是通过重发布学习到的路由,此处一分为二的看。红色部分:从网段来看不难看出这是RIP区域的路由,这是重发布到OSPF进程1来的;蓝色部分:配置RT5的时候,特地留下了一个网段没有发布到OSPF区域,然后才执行重发布的,严格来说,这个网段不在OSPF协议区域之内,因此也算是“外部路由了”)
RT2:
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/301] via 10.2.26.2, 00:01:28, Serial0/2
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 IA 3.3.3.3 [110/401] via 10.2.26.2, 00:01:19, Serial0/2
4.0.0.0/32 is subnetted, 1 subnets
R 4.4.4.4 [120/1] via 172.16.24.2, 00:00:23, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/201] via 10.2.26.2, 00:01:28, Serial0/2
6.0.0.0/32 is subnetted, 1 subnets
O IA 6.6.6.6 [110/101] via 10.2.26.2, 00:01:28, Serial0/2
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.24.0/30 is directly connected, Serial0/0
R 172.16.4.0/24 [120/1] via 172.16.24.2, 00:00:23, Serial0/0
10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
O IA 10.0.15.0/30 [110/300] via 10.2.26.2, 00:01:28, Serial0/2
O IA 10.1.13.0/30 [110/400] via 10.2.26.2, 00:01:28, Serial0/2
O IA 10.1.3.0/24 [110/410] via 10.2.26.2, 00:01:20, Serial0/2
C 10.2.2.0/24 is directly connected, Ethernet3/0
O IA 10.1.1.0/24 [110/310] via 10.2.26.2, 00:01:28, Serial0/2
O 10.2.6.0/24 [110/110] via 10.2.26.2, 00:01:28, Serial0/2
O IA 10.0.5.0/24 [110/210] via 10.2.26.2, 00:01:28, Serial0/2
C 10.2.26.0/30 is directly connected, Serial0/2
O IA 10.0.56.0/30 [110/200] via 10.2.26.2, 00:01:28, Serial0/2
O E1 10.0.50.0/24 [110/1200] via 10.2.26.2, 00:01:18, Serial0/2
(RT2是自制系统边界路由器,即ASBR,因此既有OSPF的路由条目,也有以R开头的RIP路由条目)
(其他的设备上的路由就不show了,都跟RT3上是一样的,只是开销不一样)
七、总结
关于重发布
重发布可以将其他的不同的路由协议再一次“发布”到自己的区域,这样就能学次到外部的路由了,重发布可以有很多种,当然,上一节单区域配置中的下发缺省也算是一种重发布了。
OSPF防环
可知道OSPF一般是不会出现环路的,不像RIP那样是一种“侦听传言”的路由,它交互的是LSA路由信息,常用的LAS有1、2、3、4、5、7类LSA,各自有不同的作用,而在单区域内,通过LSA计算的路由都是最短路径优先树,当然不会有环了,在区域之间,所有的区域都必须跟骨干区域相连,骨干区域即区域0,区域0是必须要有的区域,所以,这样区域间也不会有环路了。
不同区域配置
多区域其实就是将不同的网段发布到不同的区域,多区域分为ABR(区域边界路由器)、ASBR(自制系统边界路由器),当然还有普通路由器了。ABR上一般都发布了一些网段到不同的区域,所以处在不同区域之间,即ABR。为什么要配置多区域呢,这个问题貌似有点纠结,因为从此实验看来,OSPF自制系统内的路由条目都是一样的,除了开销不同之外,基本没有什么可取之处了,但是,OSPF得到广泛的应用,当然有原因了,特殊区域的配置可以减少路由条目,所以也适用于中、大型的网络中。