OSPF 配置:路由器 ID 不会更改为环回地址

网络工程 思科 路由器 ospf
2021-07-19 20:32:20

我是新手,所以请原谅我的错误,但我觉得我在这里遗漏了一些东西。

我正在尝试使用环回地址作为我网络中 Router0 的路由器 ID。我正在输入:

Router(config)#int loopback 0
Router(config-if)#ip address 1.1.1.1 255.255.255.255
Router(config-if)#
Router(config-if)#exit
Router(config)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        150.45.101.1    YES manual up                    up 
FastEthernet1/0        unassigned      YES unset  administratively down down 
Serial2/0              200.200.200.3   YES manual up                    up 
Serial3/0              unassigned      YES unset  administratively down down 
FastEthernet4/0        unassigned      YES unset  administratively down down 
FastEthernet5/0        unassigned      YES unset  administratively down down 
Loopback0              1.1.1.1         YES manual up                    up
Router(config)#

所以我们可以看到已经配置了环回,但是当我显示路由器 ID 时,它仍然显示串行接口作为它的 ID。

Router(config)#do show ip ospf
 Routing Process "ospf 100" with ID 200.200.200.3
Supports only single TOS(TOS0) routes
 Supports opaque LSA
 It is an area border router
 SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 2. 2 normal 0 stub 0 nssa
 External flood list length 0
    Area BACKBONE(0) (Inactive)
        Number of interfaces in this area is 0
        Area has no authentication
        SPF algorithm executed 5 times
        Area ranges are
        Number of LSA 2. Checksum Sum 0x0137ce
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 1
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 2 times
        Area ranges are
        Number of LSA 0. Checksum Sum 0x000000
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

为了解决这个问题,我试过这个:

Router(config)#do clear ip ospf process
Reset ALL OSPF processes? [no]: y
Router(config)#

但是当我再次运行这个命令时,我得到了相同的结果:

Router(config)#do show ip ospf
 Routing Process "ospf 100" with ID 200.200.200.3
Supports only single TOS(TOS0) routes
 Supports opaque LSA
 It is an area border router
 SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 2. 2 normal 0 stub 0 nssa
 External flood list length 0
    Area BACKBONE(0) (Inactive)
        Number of interfaces in this area is 0
        Area has no authentication
        SPF algorithm executed 5 times
        Area ranges are
        Number of LSA 2. Checksum Sum 0x0137ce
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 1
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 2 times
        Area ranges are
        Number of LSA 0. Checksum Sum 0x000000
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

这是运行配置:

Router(config-if)#do show running-config

Building configuration...

Current configuration : 887 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip cef
no ipv6 cef
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 150.45.101.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial2/0
 ip address 200.200.200.3 255.255.255.0
!
interface Serial3/0
 no ip address
 shutdown
!
interface FastEthernet4/0
 no ip address
 shutdown
!
interface FastEthernet5/0
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 network 150.45.101.0 0.0.0.7 area 0
 network 200.200.200.0 0.0.0.3 area 0
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

我们可以看到路由器 ID 没有改变,我在这里做错了什么?

3个回答

简单地清除进程可能不足以重新启动 RID 选择进程。也就是说,正如 Ron 在评论中指出的那样,迄今为止最好的做法是在 OSPF(实际上,所有动态协议)中手动指定路由器 ID以避免这种事情。

我刚刚遇到了同样的问题,并尝试使用clear ip ospf 进程我最终重新加载了使用 OSPF 的设备以使更改生效。您可能会在 OSPF 路由器配置模式下使用router-id [router-id in IP address notation]命令,然后运行clear ip ospf process以查看是否有效(我尚未测试该方法)。此外,显示 ip 协议是另一种获取 ip 路由详细信息的方法,它可能更简洁。

重新加载 200.200.200.3>>>1.1.1.1

假设您使用的是 GNS3