- 论坛徽章:
- 0
|
![]()
如图所示,区域0被分成了两部分。这肯定会造成问题。如:R2会收到R3发来的一条类型3的LSA,其中包含了34.0.0.0/24网络的路由信息。由于这条LSA来自于右边的区域0,当R2收到这条LSA时,它发现这是一条来自于区域0的类型3的LSA,而R2本身又是区域0的边界路由器,因此它认为这种情况是不可能发生的。于是它会认为这是SPF算法出错,所以不会接收这条LSA,路由也就无法学习到。
在本实验中就要观察这种现象,然后找出解决方案。目前可行的方法有三种;分别是:
1 建立虚链路;
2 建立tunnel;
3 不同进程之间的重分布。
下面将逐一进行试验。
―――――――――――――――――――――――――――――――――――――――
1 基本配置
R1
interface Serial2/1
ip address 12.0.0.1 255.255.255.0
router ospf 1
router-id 1.1.1.1
network 12.0.0.0 0.0.0.255 area 0
R2
interface Serial2/1
ip address 12.0.0.2 255.255.255.0
interface Serial2/2
ip address 23.0.0.2 255.255.255.0
router ospf 1
router-id 2.2.2.2
network 12.0.0.0 0.0.0.255 area 0
network 23.0.0.0 0.0.0.255 area 1
R3
interface Serial2/1
ip address 23.0.0.3 255.255.255.0
interface Serial2/2
ip address 34.0.0.3 255.255.255.0
router ospf 1
router-id 3.3.3.3
network 23.0.0.0 0.0.0.255 area 1
network 34.0.0.0 0.0.0.255 area 0
R4
interface Serial2/1
ip address 34.0.0.4 255.255.255.0
router ospf 1
router-id 4.4.4.4
network 34.0.0.0 0.0.0.255 area 0
r2#sh ip os neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/ - 00:00:31 12.0.0.1 Serial2/1
3.3.3.3 1 FULL/ - 00:00:39 23.0.0.3 Serial2/2
r3#sh ip os neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/ - 00:00:34 23.0.0.2 Serial2/1
4.4.4.4 1 FULL/ - 00:00:30 34.0.0.4 Serial2/2
OSPF邻居已经建立。
r2#sh ip route
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/2
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial2/1
但R2无法学习到34.0.0.0/24的路由。原因正如前文所说
现在就前面提到的方法分别进行验证。
*******************************************************************************
方法一 建立虚链路(最常用的方法)
r2(config)#router os 1
r2(config-router)#area 1 virtual-link 3.3.3.3
r3(config)#router os 1
r3(config-router)#area 1 virtual-link 2.2.2.2
r2#sh ip route
34.0.0.0/24 is subnetted, 1 subnets
O 34.0.0.0 [110/128] via 23.0.0.3, 00:00:33, Serial2/2
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/2
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial2/1
方法二 建立tunnel
1 建立TUNNEL
r2(config)#int tunnel 0
r2(config-if)#ip add 2.2.2.2 255.255.255.0 /为tunnel接口配一个IP地址
r2(config-if)#tunnel source 23.0.0.2 /为tunnel指定一个源端
r2(config-if)#tunnel destination 23.0.0.3 /为tunnel指定一个目的端
r3(config)#int tunnel 0
r3(config-if)#ip add 2.2.2.3 255.255.255.0
r3(config-if)#tunnel source 23.0.0.3
r3(config-if)#tunnel destination 23.0.0.2
在本例中tunnel是建立在R2,R3之间的串行链路上。并且为tunnel接口配置了IP地址。而且IP地址必须处于同一网段。目的是将这一网段宣告至OSPF的区域0中。让tunnel将区域0连接起来。
――――――――――――――――――――――――――――――――――――――
2 将TUNNEL接口的IP宣告进OSPF的区域 0
r2(config)#router os 1
r2(config-router)#net 2.2.2.0 0.0.0.255 a 0
r3(config)#router os 1
r3(config-router)#net 2.2.2.0 0.0.0.255 a 0
―――――――――――――――――――――――――――――――――――――
r2#sh ip os nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/ - 00:00:38 12.0.0.1 Serial2/1
3.3.3.3 1 FULL/ - 00:00:35 23.0.0.3 Serial2/2
3.3.3.3 1 FULL/ - 00:00:36 2.2.2.3 Tunnel0
r3# sh ip os nei
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/ - 00:00:37 23.0.0.2 Serial2/1
4.4.4.4 1 FULL/ - 00:00:33 34.0.0.4 Serial2/2
2.2.2.2 1 FULL/ - 00:00:31 2.2.2.2 Tunnel0
可以看到R2,R3之间通过tunnel接口也建立起了邻居。
――――――――――――――――――――――――――――――――――――
r2#sh ip rou
34.0.0.0/24 is subnetted, 1 subnets
O 34.0.0.0 [110/11175] via 2.2.2.3, 00:03:51, Tunnel0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Tunnel0
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/2
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial2/1
r3#sh ip rou
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/2
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Tunnel0
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
O 12.0.0.0 [110/11175] via 2.2.2.2, 00:04:13, Tunnel0
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36438/showart_289811.html |
|