1.配置完ospf后,在路由表中不出现ospf相关信息
[SW2]ospf
[SW2-ospf-1]are
[SW2-ospf-1]area 0
[SW2-ospf-1-area-0.0.0.0]net
[SW2-ospf-1-area-0.0.0.0]network 0.0.0.0
Jul 4 2024 22:11:58-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 19, the
change loop count is 0, and the maximum number of records is 4095.^
Error:Incomplete command found at '^' position.
[SW2-ospf-1-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]qu
[SW2-ospf-1]qu
[SW2]dis ip rou
[SW2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0192.168.2.0/24 Direct 0 0 D 192.168.2.2 Vlanif20192.168.2.2/32 Direct 0 0 D 127.0.0.1 Vlanif20192.168.3.0/24 Direct 0 0 D 192.168.3.254 Vlanif30192.168.3.254/32 Direct 0 0 D 127.0.0.1 Vlanif30
2.查看错误信息,display ospf error
[SW2]display ospf errorOSPF Process 1 with Router ID 192.168.3.254OSPF error statistics General packet errors:0 : IP: received my own packet 590 : Bad packet0 : Bad version 0 : Bad checksum0 : Bad area id 0 : Drop on unnumbered interface0 : Bad virtual link 0 : Bad authentication type0 : Bad authentication key 0 : Packet too small0 : Packet size > ip length 0 : Transmit error0 : Interface down 0 : Unknown neighbor590 : Bad net segment 0 : Extern option mismatch0 : Router id confusionHELLO packet errors:0 : Netmask mismatch 0 : Hello timer mismatch0 : Dead timer mismatch 0 : Virtual neighbor unknown0 : NBMA neighbor unknown 0 : Invalid Source AddressDD packet errors:0 : Neighbor state low 0 : Unknown LSA type0 : MTU option mismatchLS ACK packet errors:0 : Neighbor state low 0 : Unknown LSA typeLS REQ packet errors:0 : Neighbor state low 0 : Empty request0 : Bad requestLS UPD packet errors:0 : Neighbor state low 0 : Newer self-generate LSA 0 : LSA checksum bad 0 : Received less recent LSA0 : Unknown LSA typeOpaque errors:0 : 9-out of flooding scope 0 : 10-out of flooding scope0 : 11-out of flooding scope 0 : Unkown TLV typeRetransmission for packet over Limitation errors:0 : Number for DD Packet 0 : Number for Update Packet0 : Number for Request PacketReceive Grace LSA errors:0 : Number of invalid LSAs 0 : Number of policy failed LSAs0 : Number of wrong period LSAsConfiguration errors:0 : Tunnel cost mistake
出现2处错误:Bad net segment 和Bad packet。
猜测是由网段划分错误导致的包错误。
3.逐一检查2个路由器划分网段是否有误,最后在三层交换机的0/0/1接口发现网段配置错误,此处应该配置为vlan 20
[SW2]interface int
[SW2]interface g
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1port link-type accessport default vlan 30
#
return
4.重新划分网段port default vlan 20,出现如下信息,表示ospf建立邻居成功
[SW2-GigabitEthernet0/0/1]port default vlan 20
[SW2-GigabitEthernet0/0/1]
Jul 4 2024 22:22:15-08:00 SW2 %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif30 hasturned into DOWN state.
Jul 4 2024 22:22:15-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IPon the interface Vlanif30 has entered the DOWN state.
Jul 4 2024 22:22:19-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 20, the
change loop count is 0, and the maximum number of records is 4095.
Jul 4 2024 22:22:21-08:00 SW2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=1, NeighborAddress=192.168.2.1, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
Jul 4 2024 22:22:21-08:00 SW2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=1, NeighborAddress=192.168.2.1, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)
Jul 4 2024 22:22:21-08:00 SW2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=1, NeighborAddress=192.168.2.1, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange)
Jul 4 2024 22:22:21-08:00 SW2 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=1, NeighborAddress=192.168.2.1, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g)
Jul 4 2024 22:22:21-08:00 SW2 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=1, NeighborAddress=192.168.2.1, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
[SW2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 5 Routes : 5 Destination/Mask Proto Pre Cost Flags NextHop Interface127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0192.168.1.0/24 OSPF 10 2 D 192.168.2.1 Vlanif20192.168.2.0/24 Direct 0 0 D 192.168.2.2 Vlanif20192.168.2.2/32 Direct 0 0 D 127.0.0.1 Vlanif20