OSPF構築時の取得コマンドをまとめてみました for 自分
検証時、手順書作成、レビュー時どんなログを取るべきか毎回考慮していましたが、いちいち考えてるのが面倒になったので纏めておくようにしました。基本的なコマンドだけになるので、設計や設定により適宜追加が必要になるかと思います。
show ip ospf neighbor
OSPFを動かしたら、まずずこれを見ています。neighbor張れているかの確認。
また、neighborの数が想定通りかも確認します。検証時1つ、2つneighborが足りないこともあります。その場合は、設定ミス、設定漏れ物理的な接続を確認します。
例)
IOU1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/BDR 00:00:32 13.1.1.3 Ethernet0/1
2.2.2.2 10 FULL/DR 00:00:34 12.1.1.2 Ethernet0/0
IOU1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/BDR 00:00:32 13.1.1.3 Ethernet0/1
2.2.2.2 10 FULL/DR 00:00:34 12.1.1.2 Ethernet0/0
show ip ospf neighbor detail
「show ip ospf neighbor」の詳細版です。構築時のログとして取得しておく場合とトラブルシュート時にstate changesカウントを見たります。
IOU1#show ip ospf neighbor detail
Neighbor 3.3.3.3, interface address 13.1.1.3
In the area 0 via interface Ethernet0/1
Neighbor priority is 1, State is FULL, 6 state changes
DR is 13.1.1.1 BDR is 13.1.1.3
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in 00:00:36
Neighbor is up for 01:09:56
Index 2/2, 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
Neighbor 3.3.3.3, interface address 13.1.1.3
In the area 0 via interface Ethernet0/1
Neighbor priority is 1, State is FULL, 6 state changes
DR is 13.1.1.1 BDR is 13.1.1.3
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in 00:00:36
Neighbor is up for 01:09:56
Index 2/2, 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
show ip ospf interface brief
意図したインターフェイスでOSPFが動いてるか確認します。このログは一番確認するようにしています。
- OSPFが動いているインターフェイスの不足がないか?
- OSPF Costは適切か?
- OSPF Areaは適切か?
- DR/BDRは適切か?
例)
IOU1#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Et0/1 1 0 13.1.1.1/24 10 DR 1/1
Et0/0 1 0 12.1.1.1/24 10 BDR 1/1
IOU1#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Et0/1 1 0 13.1.1.1/24 10 DR 1/1
Et0/0 1 0 12.1.1.1/24 10 BDR 1/1
show ip ospf interface
show ip ospf interface briefの詳細版のログになります。
このログで注目するのは「Hello 10, Dead 40, Wait 40」です(あまりタイマーは変更しませんが)
それ以外は構築時のログとして取得しています。
例)
Ethernet0/1 is up, line protocol is up
Internet Address 13.1.1.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 13.1.1.1
Backup Designated router (ID) 3.3.3.3, Interface address 13.1.1.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 0 msec, maximum is 1 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Ethernet0/1 is up, line protocol is up
Internet Address 13.1.1.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 13.1.1.1
Backup Designated router (ID) 3.3.3.3, Interface address 13.1.1.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 0 msec, maximum is 1 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
show ip ospf database
OSPFのタイプ別にパラメータが出てきますので、ここでもある程度確認します。基本は構築時のログとして保管しておきます。
例)
IOU1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1182 0x80000005 0x00893A 2
2.2.2.2 2.2.2.2 1182 0x80000005 0x002480 2
3.3.3.3 3.3.3.3 1074 0x80000005 0x006249 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
12.1.1.2 2.2.2.2 1182 0x80000003 0x000E06
13.1.1.1 1.1.1.1 1182 0x80000003 0x006BA8
23.1.1.2 2.2.2.2 1182 0x80000003 0x00E21E
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
1.1.1.1 1.1.1.1 1182 0x80000003 0x0097FE 0
2.2.2.2 2.2.2.2 1182 0x80000003 0x004B43 0
3.3.3.3 3.3.3.3 1074 0x80000003 0x00FE87 0
IOU1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1182 0x80000005 0x00893A 2
2.2.2.2 2.2.2.2 1182 0x80000005 0x002480 2
3.3.3.3 3.3.3.3 1074 0x80000005 0x006249 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
12.1.1.2 2.2.2.2 1182 0x80000003 0x000E06
13.1.1.1 1.1.1.1 1182 0x80000003 0x006BA8
23.1.1.2 2.2.2.2 1182 0x80000003 0x00E21E
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
1.1.1.1 1.1.1.1 1182 0x80000003 0x0097FE 0
2.2.2.2 2.2.2.2 1182 0x80000003 0x004B43 0
3.3.3.3 3.3.3.3 1074 0x80000003 0x00FE87 0
show ip ospf events
OSPFステータスログとして、エラーが無いか確認するレベルです。
例)
IOU1#show ip ospf events
OSPF Router with ID (1.1.1.1) (Process ID 1)
1 *Nov 7 00:50:21.122: Timer Exp: if_ack_delayed 0xF17349A8
2 *Nov 7 00:50:21.121: Timer Exp: if_ack_delayed 0xF17670C8
3 *Nov 7 00:50:18.648: Rcv Unchanged Type-1 LSA, LSID 3.3.3.3, Adv-Rtr 3.3.3.3, Seq# 80000005, Age 1, Area 0
4 *Nov 7 00:50:18.611: Rcv Unchanged Type-5 LSA, LSID 3.3.3.3, Adv-Rtr 3.3.3.3, Seq# 80000003, Age 1
5 *Nov 7 00:48:33.007: Timer Exp: if_ack_delayed 0xF17349A8
6 *Nov 7 00:48:30.533: Rcv Unchanged Type-5 LSA, LSID 2.2.2.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1
7 *Nov 7 00:48:30.533: Rcv Unchanged Type-2 LSA, LSID 23.1.1.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1, Area 0
8 *Nov 7 00:48:30.533: Rcv Unchanged Type-2 LSA, LSID 12.1.1.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1, Area 0
IOU1#show ip ospf events
OSPF Router with ID (1.1.1.1) (Process ID 1)
1 *Nov 7 00:50:21.122: Timer Exp: if_ack_delayed 0xF17349A8
2 *Nov 7 00:50:21.121: Timer Exp: if_ack_delayed 0xF17670C8
3 *Nov 7 00:50:18.648: Rcv Unchanged Type-1 LSA, LSID 3.3.3.3, Adv-Rtr 3.3.3.3, Seq# 80000005, Age 1, Area 0
4 *Nov 7 00:50:18.611: Rcv Unchanged Type-5 LSA, LSID 3.3.3.3, Adv-Rtr 3.3.3.3, Seq# 80000003, Age 1
5 *Nov 7 00:48:33.007: Timer Exp: if_ack_delayed 0xF17349A8
6 *Nov 7 00:48:30.533: Rcv Unchanged Type-5 LSA, LSID 2.2.2.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1
7 *Nov 7 00:48:30.533: Rcv Unchanged Type-2 LSA, LSID 23.1.1.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1, Area 0
8 *Nov 7 00:48:30.533: Rcv Unchanged Type-2 LSA, LSID 12.1.1.2, Adv-Rtr 2.2.2.2, Seq# 80000003, Age 1, Area 0
show ip route ospf / show ip route
ルーティングテーブルの確認は必須です。ospfオプションを付けるとOSPFだけに絞れるので見やすいと思います。ここではOSPFでもらう経路が想定で通りかと、External 1 / 2も併せて確認できます。
IOU1#show ip route ospf
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O E2 2.2.2.2 [110/20] via 12.1.1.2, 01:34:48, Ethernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O E2 3.3.3.3 [110/20] via 13.1.1.3, 01:33:21, Ethernet0/1
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/11] via 13.1.1.3, 01:33:21, Ethernet0/1
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O E2 2.2.2.2 [110/20] via 12.1.1.2, 01:34:48, Ethernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O E2 3.3.3.3 [110/20] via 13.1.1.3, 01:33:21, Ethernet0/1
23.0.0.0/24 is subnetted, 1 subnets
O 23.1.1.0 [110/11] via 13.1.1.3, 01:33:21, Ethernet0/1