拓扑图

图2.2 OSPF单域配置实验拓扑图

修改OSPF hello和dead时间参数

在R1上执行display ospf interface GigabitEthernet 0/0/1命令,查看OSPF默认的hello和dead时间。

[R1]display ospf interface GigabitEthernet 0/0/1

OSPF Process 1 with Router ID 10.1.0.1

Interfaces

Interface: 10.1.12.1 (GigabitEthernet0/0/1)

Cost: 1 State: DR Type: Broadcast MTU: 1500

Priority: 1

Designated Router: 10.1.12.1

Backup Designated Router: 10.1.12.2

Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

在R1的GE0/0/1接口执行ospf timer命令,将OSPF hello和dead时间分别修改为15秒和60秒。

[R1]interface GigabitEthernet 0/0/1

[R1-GigabitEthernet0/0/1]ospf timer hello 15

[R1-GigabitEthernet0/0/1]ospf timer dead 60

这步配置完成后,正常会有以下回显信息。

Mar 14 2020 17:33:16-08:00 R1 %%01OSPF/3/NBR_CHG_DOWN(l)[0]:Neighbor event:neigh

bor state changed to Down. (ProcessId=256, NeighborAddress=2.0.1.10, NeighborEve

nt=InactivityTimer, NeighborPreviousState=Full, NeighborCurrentState=Down)

Mar 14 2020 17:33:16-08:00 R1 %%01OSPF/3/NBR_DOWN_REASON(l)[1]:Neighbor state le

aves full or changed to Down. (ProcessId=256, NeighborRouterId=2.0.1.10, Neighbo

rAreaId=0, NeighborInterface=GigabitEthernet0/0/1,NeighborDownImmediate reason=N

eighbor Down Due to Inactivity, NeighborDownPrimeReason=Interface Parameter Mism

atch, NeighborChangeTime=2020-03-14 17:33:16-08:00)

[R1]display ospf interface g0/0/1

OSPF Process 1 with Router ID 10.1.0.1

Interfaces

Interface: 10.1.12.1 (GigabitEthernet0/0/1)

Cost: 1 State: DR Type: Broadcast MTU: 1500

Priority: 1

Designated Router: 10.1.12.1

Backup Designated Router: 0.0.0.0

Timers: Hello 15 , Dead 60 , Poll 120 , Retransmit 5 , Transmit Delay 1

在R1上查看OSPF邻居状态。

[R1]display ospf peer brief

OSPF Process 1 with Router ID 10.1.0.1

Peer Statistic Information


Area Id Interface Neighbor id State

0.0.0.0 GigabitEthernet0/0/2 10.1.0.3 Full


上述回显信息表明,R1只有一个邻居,那就是R3。因为R1和R2上的OSPF hello和dead时间取值不同,所以R1无法与R2建立OSPF邻居关系。

在R2的GE0/0/1接口执行ospf timer命令,将OSPF hello和dead时间分别修改为15秒和60秒。

[R2]interface GigabitEthernet 0/0/1

[R2-GigabitEthernet0/0/1]ospf timer hello 15

[R2-GigabitEthernet0/0/1]ospf timer dead 60

…output omit…

Mar 14 2020 17:40:58-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve

nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.12.1.10, Neighbor

Event=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)

再次在R1上查看OSPF邻居状态。

[R1]display ospf peer brief

OSPF Process 1 with Router ID 10.1.0.1

Peer Statistic Information


Area Id Interface Neighbor id State

0.0.0.0 GigabitEthernet0/0/1 10.1.0.2 Full

0.0.0.0 GigabitEthernet0/0/2 10.1.0.3 Full


两端时间匹配后,以上回显表示R1和R2正常建立邻居状态。


微思郭仔
31 声望2 粉丝

微思IT认证培训-思科、华为、红帽、oracle、VMware、PMP、CISP等,一切为了成为更好的自己,加油!!!