您的位置:首页 > 其它

OSPF系列小实验之7:断裂的区域连接

2010-06-01 22:41 405 查看




拓扑如上所示,area 0 被分开了,还有两个非骨干区域是直接相连的。要求以尽量小的动作修复这个网络,重新配置的方案可以不用考虑,否则本实验的意义何在。

方法一:建立GRE通道
现先让骨干区域连起来。可以同过R4和R2建立,也可以通过R5与R1建立。但是查看下路由表发现后面的一种方法是不可以行的,因为AREA2和AREA3之间相连了,所有R5没有到R1的路由。只能用R4和R2建立了。
基本配置如下:
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Tunnel0
ip address 42.1.1.2 255.255.255.0
tunnel source 24.1.1.2
tunnel destination 24.1.1.4
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
router ospf 10
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 2
network 42.1.1.0 0.0.0.255 area 0
R4上的配置原理一致,关键的地方要把tunnel发布到OSPF里,而且必须发布到骨干区域,否则还是建立不起来的。我试过把隧道都发布到area 2 ,结果是建立不起来。其实你自己想想也是,隧道窑通道area 0 区域里,你不把隧道口放在area 0 怎么能行!
这里还有一个需要注意的地方是我给隧道配置了ip地址,也可以尝试用ip unn 骨干区域的直连借口IP。
下面看看R5的路由表
R5#sh ip rou os
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/11240] via 45.1.1.4, 00:14:01, Serial1/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11176] via 45.1.1.4, 00:14:01, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/11304] via 45.1.1.4, 00:14:01, Serial1/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/65] via 45.1.1.4, 00:14:01, Serial1/0
42.0.0.0/24 is subnetted, 1 subnets
O 42.1.1.0 [110/11175] via 45.1.1.4, 00:14:01, Serial1/0
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.1.1.0 [110/128] via 45.1.1.4, 00:14:01, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
O 12.1.1.0 [110/11239] via 45.1.1.4, 00:14:01, Serial1/0
13.0.0.0/24 is subnetted, 1 subnets
O IA 13.1.1.0 [110/11303] via 45.1.1.4, 00:14:01, Serial1/0
R1R2的路由都学习到了。
这里有一个一举两得的效果,本来area 5被area 3隔开,对于R1R2组建的骨干区域来说是学不到的area 5的路由的,但是area 5是直接挂在R4与R5组建的骨干区域后面的,所以现在R1R2也可以学到area 5的路由。但是,这里有一个次优路由,R1到达区域5是通过R2的,这个不难理解,GRE通道是建在R2与R4间的,所以,R1去往R5就绕了一大圈。
我个人觉得是将area 3 或者area 5视为隔离区域要看具体情况,如果R1和R2组建的网络比较大的话,那么应该将area 5视为被隔离的,否则就是area 3 。

方法二:虚链路
建立虚链路跟GRE差不多,都是在非骨干区域上建立一条隧道。但是,虚链路于只可以应用在OSPF下,因为只有OSPF才有分层设计,虽然isis也是分层的,但是isis没有骨干不骨干的概念。为什么他不分骨干区域呢?
目前为止,我个人是这么理解的,因为OSPFv2还是基于子网的,isis却是基于链路的,是不是基于链路的就好一些呢?你看OSPFv3就知道了,他就是基于链路的。呵呵
建立虚链路需要注意的有两点:
1. 区域号写谁的?这里是要写成被跨越的区域的ID的
2. 注意了,虚链路是用RID来建立的,不是IP地址,这一点和GRE不一样!

R2的基本配置如下:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 24.1.1.2 255.255.255.0
serial restart-delay 0
!
!
router ospf 10
router-id 2.2.2.2
log-adjacency-changes
area 2 virtual-link 4.4.4.4
network 2.2.2.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 2
看看邻居表,与R4建立了虚链路上的邻居,没有死亡时间
R2#sh ip os neighbor

Neighbor ID Pri State Dead Time Address Interface
4.4.4.4 0 FULL/ - - 24.1.1.4 OSPF_VL1
1.1.1.1 0 FULL/ - 00:00:33 12.1.1.1 Serial1/0
4.4.4.4 0 FULL/ - 00:00:33 24.1.1.4 Serial1/1

路由表,都学到了
R2#sh ip rou os
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 12.1.1.1, 00:15:56, Serial1/0
35.0.0.0/24 is subnetted, 1 subnets
O IA 35.1.1.0 [110/192] via 24.1.1.4, 00:15:56, Serial1/1
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.1.1.1, 00:15:56, Serial1/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 24.1.1.4, 00:43:38, Serial1/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/129] via 24.1.1.4, 00:15:56, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
O IA 13.1.1.0 [110/128] via 12.1.1.1, 00:15:56, Serial1/0
45.0.0.0/24 is subnetted, 1 subnets
O 45.1.1.0 [110/128] via 24.1.1.4, 00:15:56, Serial1/1
30.0.0.0/24 is subnetted, 1 subnets
O IA 30.1.1.0 [110/193] via 24.1.1.4, 00:15:56, Serial1/1
R2#
方法三:进程间重发布
下面给出R4的配置
interface Loopback0
ip address 4.4.4.4 255.255.255.0
ip ospf network point-to-point
!
interface Serial1/0
ip address 45.1.1.4 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 24.1.1.4 255.255.255.0
serial restart-delay 0
!
router ospf 10
router-id 4.4.4.4
log-adjacency-changes
redistribute ospf 20 subnets
passive-interface Loopback0
network 4.4.4.0 0.0.0.255 area 2
network 24.1.1.0 0.0.0.255 area 2
!
router ospf 20
log-adjacency-changes
redistribute ospf 10 subnets
network 45.1.1.0 0.0.0.255 area 0

注意,在R3上另起了一个loopback 1 30.1.1.1/24放在area 5 以作路由寻址测试之用。
看看R1的路由表
R1#sh ip rou os
35.0.0.0/24 is subnetted, 1 subnets
O E2 35.1.1.0 [110/128] via 12.1.1.2, 00:01:29, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 12.1.1.2, 00:06:39, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 13.1.1.3, 00:06:39, Serial1/1
4.0.0.0/24 is subnetted, 1 subnets
O IA 4.4.4.0 [110/129] via 12.1.1.2, 00:06:28, Serial1/0
5.0.0.0/24 is subnetted, 1 subnets
O E2 5.5.5.0 [110/65] via 12.1.1.2, 00:01:29, Serial1/0
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.1.1.0 [110/128] via 12.1.1.2, 00:06:39, Serial1/0
45.0.0.0/24 is subnetted, 1 subnets
O E2 45.1.1.0 [110/64] via 12.1.1.2, 00:01:29, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
O E2 30.1.1.0 [110/129] via 12.1.1.2, 00:00:01, Serial1/0

看看路由表,都学到了。但是与前面的GRE隧道一样,R1到达area 5还是绕了一个大圈子。
R1#tra 30.1.1.1
Type escape sequence to abort.
Tracing the route to 30.1.1.1
1 12.1.1.2 24 msec 32 msec 16 msec
2 24.1.1.4 64 msec 64 msec 92 msec
3 45.1.1.5 124 msec 100 msec 120 msec
4 35.1.1.3 108 msec * 116 msec

有没有解决方法呢?
实验有待跟进,待续。本文出自 “海阔天空” 博客,转载请与作者联系!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: