首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我失去了我的OSPF路线?

为什么我失去了我的OSPF路线?
EN

Network Engineering用户
提问于 2017-01-25 20:22:33
回答 1查看 560关注 0票数 2

我创建了小网络并建立了OSPF协议。当我拿走一根以太网电缆时,我希望看到路由表的变化.

但所发生的是,路由器只显示直接连接的网络,而没有OSPF。

只是一张便条:它还有其他路由器连接到它。我只删除了网络上的一条电缆。

这是所有连接时的R0路由表。

代码语言:javascript
复制
     192.168.1.0/29 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, FastEthernet0/1
     192.168.2.0/29 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, FastEthernet0/0
     192.168.3.0/29 is subnetted, 1 subnets
O       192.168.3.0 [110/2] via 192.168.1.2, 00:00:49, FastEthernet0/1
     192.168.4.0/29 is subnetted, 1 subnets
O       192.168.4.0 [110/2] via 192.168.2.2, 00:00:49, FastEthernet0/0

这个S R0路由表当我断开R1和R0时(所有的ospf网络都断开了)

代码语言:javascript
复制
     192.168.1.0/29 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, FastEthernet0/1

问题是为什么会发生这种情况。它是不是应该保持不变,除了那个断开的?

代码语言:javascript
复制
R0
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.7 area 0
Router(config-router)#network 192.168.2.0 0.0.0.7 area 0

R1
Router(config)#router ospf 1
Router(config-router)#network 192.168.2.0 0.0.0.7 area 0
Router(config-router)#network 192.168.4.0 0.0.0.7 area 0

R2
Router(config)#router ospf 1
Router(config-router)#network 192.168.4.0 0.0.0.7 area 0
Router(config-router)#network 192.168.3.0 0.0.0.7 area 0

R3
Router(config)#router ospf 1
Router(config-router)#network 192.168.3.0 0.0.0.7 area 0
Router(config-router)#network 192.168.1.0 0.0.0.7 area 0

R0

代码语言:javascript
复制
Router#show run
Building configuration...

Current configuration : 692 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface FastEthernet0/0
 ip address 192.168.2.1 255.255.255.248
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.248
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 network 192.168.1.0 0.0.0.7 area 0
 network 192.168.2.0 0.0.0.7 area 0
!
ip classless
!
ip flow-export version 9

line con 0
!
line aux 0
!
line vty 0 4
 login
end

R1

代码语言:javascript
复制
Router#show run
Building configuration...

Current configuration : 692 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.248
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.4.1 255.255.255.248
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 network 192.168.2.0 0.0.0.7 area 0
 network 192.168.4.0 0.0.0.7 area 0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

R2

代码语言:javascript
复制
Router#sh run
Building configuration...

Current configuration : 692 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.3.2 255.255.255.248
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.4.2 255.255.255.248
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 network 192.168.4.0 0.0.0.7 area 0
 network 192.168.3.0 0.0.0.7 area 0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

R3

代码语言:javascript
复制
Router#sh run
Building configuration...

Current configuration : 692 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.3.1 255.255.255.248
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.2 255.255.255.248
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 log-adjacency-changes
 network 192.168.3.0 0.0.0.7 area 0
 network 192.168.1.0 0.0.0.7 area 0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end
EN

回答 1

Network Engineering用户

回答已采纳

发布于 2017-01-26 23:20:03

您所看到的问题是由于缺乏稳定的路由器ID造成的。

OSPF在路由更新中需要一个路由器ID来标识自己。如果不手动指定路由器ID,路由器将使用最高的回送地址作为路由器ID。由于没有创建回送接口,路由器选择最高的接口地址作为路由器ID。

当您拔掉电缆时,该接口上的IP地址不再有效(因为接口已关闭)。因此OSPF进程停止运行。这就是为什么你没有看到任何OSPF路线。

好的做法是手动创建路由器ID:

代码语言:javascript
复制
router ospf 1
router-id 1.1.1.1

注意,虽然路由器ID和IP地址一样是用小数写成的,但它不是一个地址--它只是一个数字。选择任何你喜欢的唯一号码。

或者,您可以创建一个回送接口。路由器将使用这个地址作为路由器ID,因为它是一个虚拟接口,所以它永远不会关闭。

代码语言:javascript
复制
interface Loopback 0
ip address 1.1.1.1 255.255.255.255
票数 3
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/38371

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档