我创建了小网络并建立了OSPF协议。当我拿走一根以太网电缆时,我希望看到路由表的变化.
但所发生的是,路由器只显示直接连接的网络,而没有OSPF。
只是一张便条:它还有其他路由器连接到它。我只删除了网络上的一条电缆。

这是所有连接时的R0路由表。
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网络都断开了)
192.168.1.0/29 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/1问题是为什么会发生这种情况。它是不是应该保持不变,除了那个断开的?
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 0R0
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
endR1
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
!
!
!
endR2
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
!
!
!
endR3
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发布于 2017-01-26 23:20:03
您所看到的问题是由于缺乏稳定的路由器ID造成的。
OSPF在路由更新中需要一个路由器ID来标识自己。如果不手动指定路由器ID,路由器将使用最高的回送地址作为路由器ID。由于没有创建回送接口,路由器选择最高的接口地址作为路由器ID。
当您拔掉电缆时,该接口上的IP地址不再有效(因为接口已关闭)。因此OSPF进程停止运行。这就是为什么你没有看到任何OSPF路线。
好的做法是手动创建路由器ID:
router ospf 1
router-id 1.1.1.1注意,虽然路由器ID和IP地址一样是用小数写成的,但它不是一个地址--它只是一个数字。选择任何你喜欢的唯一号码。
或者,您可以创建一个回送接口。路由器将使用这个地址作为路由器ID,因为它是一个虚拟接口,所以它永远不会关闭。
interface Loopback 0
ip address 1.1.1.1 255.255.255.255https://networkengineering.stackexchange.com/questions/38371
复制相似问题