このページで解説している内容は、以下の YouTube 動画の解説で見ることができます。
OSPF(確認コマンド)
ここでは、「マルチエリアOSPF(集約ルートの設定)」で構築したネットワークを利用してOSPFにおける確認コマンドを解説します。

OSPF(show ip ospf database)
OSPFのトポロジデータベースの内容を確認するには、「show ip ospf database」コマンドを使用します。このコマンドで、トポロジデータベースの全体の概要を把握することができます。
特定のLSAの情報を詳しく見たい場合には、パラメータを指定します。パラメータを指定した確認コマンドについては、「OSPF(show ip ospf database)」で紹介しています。そちらも参考にしてみてください。
●R3ルータの「show ip ospf database」の出力結果
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 73 0x80000003 0x00b9ff 1
172.18.0.1 172.18.0.1 73 0x80000002 0x004212 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.18.0.1 172.18.0.1 73 0x80000001 0x006336
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.0.0 172.18.0.1 68 0x80000006 0x0039f5
172.17.0.0 172.18.0.1 68 0x80000001 0x005987
172.19.0.0 3.3.3.3 63 0x80000001 0x008f03
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 117 0x80000001 0x006a11 1
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
172.18.0.0 3.3.3.3 63 0x80000001 0x009bf7
192.168.0.0 3.3.3.3 63 0x80000002 0x00994c
172.17.0.0 3.3.3.3 63 0x80000003 0x00ade3
show ip ospf
OSPFの詳細情報を見るには、「show ip ospf」コマンドを使用します。ルータが、ABRなのか、ASBRであるのかなどを確認できます。
●R3ルータの「show ip ospf」の出力結果
R3#show ip ospf
Routing Process "ospf 1" with ID 3.3.3.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)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm executed 3 times
Area ranges are
Number of LSA 6. Checksum Sum 0x0281c6
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 2
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm executed 2 times
Area ranges are
Number of LSA 4. Checksum Sum 0x024d37
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
show ip ospf border-routers
ABR、ASBRによって学習した経路情報を見るには、「show ip ospf border-routers」コマンドを使用します。
●R3ルータの「show ip ospf border-routers」の出力結果
R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 172.18.0.1 [1] via 172.18.0.1, GigabitEthernet0/0, ABR, Area 0, SPF 1
show ip ospf neighbor
OSPFが動作する隣接ルータの情報を確認するには、「show ip ospf neighbor」コマンドを使用します。隣接関係の状態、「FULL」などの確認が行えます。
●R3ルータの「show ip ospf neighbor」の出力結果
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.18.0.1 1 FULL/DR 00:00:34 172.18.0.1 GigabitEthernet0/0
show ip ospf neighbor detail
OSPFが動作する隣接ルータの情報の詳細を確認するには、「show ip ospf neighbor detail」コマンドを使用します。隣接ルータのIPアドレス、DR、BDRのIPアドレスなどが確認できます。
●R3ルータの「show ip ospf neighbor detail」の出力結果
R3#show ip ospf neighbor detail
Neighbor 172.18.0.1, interface address 172.18.0.1
In the area 0 via interface GigabitEthernet0/0
Neighbor priority is 1, State is FULL, 6 state changes
DR is 172.18.0.1 BDR is 172.18.0.2
Options is 0x00
Dead timer due in 00:00:39
Neighbor is up for 00:19:30
Index 1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
debug ip ospf packet
OSPFルータが送受信の状態を確認するには、「debug ip ospf events」コマンドでを使用します。OSPFのネイバーが確立しない場合に、隣接ルータからOSPFパケットが受信しているのかを確認する際に使用します。
●R3ルータの「debug ip ospf events」の出力結果
R3#debug ip ospf events
OSPF events debugging is on
R3#
00:20:50: OSPF: Rcv hello from 172.18.0.1 area 0 from GigabitEthernet0/0 172.18.0.1
00:20:50: OSPF: End of hello processing
00:21:00: OSPF: Rcv hello from 172.18.0.1 area 0 from GigabitEthernet0/0 172.18.0.1
00:21:00: OSPF: End of hello processing
00:21:10: OSPF: Rcv hello from 172.18.0.1 area 0 from GigabitEthernet0/0 172.18.0.1
00:21:10: OSPF: End of hello processing
00:21:20: OSPF: Rcv hello from 172.18.0.1 area 0 from GigabitEthernet0/0 172.18.0.1
00:21:20: OSPF: End of hello processing
00:21:30: OSPF: Rcv hello from 172.18.0.1 area 0 from GigabitEthernet0/0 172.18.0.1
00:21:30: OSPF: End of hello processing
長くなりましたが、OSPFを確認するコマンドの解説は、これで終わります。OSPFの習得は、同じリンクステートプロトコルであるIS-ISの理解にも有効です。理解が不十分な場合は、再度、このサイトのOSPFコンテンツを読み直してみるとよいでしょう。
