我创建了小网络并设置了 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
当我断开 R1 和 R0 时,这是 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 0
R0
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
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
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
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
