運用や構築の現場で遭遇するかも知れない問題の見つけ方と対処方法のまとめ1弾目です。次のような構成を想定しています。
タップできる目次
ネイバーが張れない
ワイルドカード設定ミス
R1はネイバーが張れていません。
R1#sh ip ospf nei R1#
「show ip ospf interface」コマンドで、OSPFが有効になっているインタフェースを確認します。
R1#show ip ospf interface fastEthernet 0/0 %OSPF: OSPF not enabled on FastEthernet0/0 R1#show ip ospf interface fastEthernet 0/1 %OSPF: OSPF not enabled on FastEthernet0/1 R1#
OSPFが有効になっていません。この結果から、OSPFの設定に誤りがあることが分かります。OSPFの設定を見てみます。
R1#show running-config | begin ospf router ospf 1 log-adjacency-changes network 172.16.0.0 0.0.0.255 area 0 !
このnetworkコマンドはワイルドカード指定に誤りがあり、172.16.0.0-172.16.0.255までしかカバーしません。ワイルドカードを設定し直す必要があります。次のように修正します。
network 172.16.1.0 0.0.0.255 area 0 network 172.16.2.0 0.0.0.255 area 0
ネイバーを張れるようになった事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:34 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:39 172.16.1.2 FastEthernet0/0 R1#
passive interfaceが有効になっている
R1はR3とネイバーが張れていません。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DR 00:00:32 172.16.1.2 FastEthernet0/0 R1#
「show ip ospf interface」コマンドで、f0/1でOSPFが有効になっているか確認します。
R1#show ip ospf interface fastEthernet 0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 No Hellos (Passive interface) Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1#
OSPFは有効になっていますね。でもちょっと待ってください。気になる出力があります。
No Hellos (Passive interface)
R1のOSPF設定を見てみます。
R1#show running-config | begin ospf router ospf 1 log-adjacency-changes passive-interface FastEthernet0/1 network 172.16.1.0 0.0.0.255 area 0 network 172.16.2.0 0.0.0.255 area 0 !
passive-interfaceが設定されています。この設定を外してみます。
R1(config)#router ospf 1 R1(config-router)#no passive-interface FastEthernet0/1
これでネイバーを張れるようになった事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:37 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:32 172.16.1.2 FastEthernet0/0 R1#
ACL設定ミス
R1はR3とネイバーを張れていません。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DR 00:00:35 172.16.1.2 FastEthernet0/0 R1#
fa0/1でOSPFが有効になっているか確認します。
R1#show ip ospf interface fastEthernet 0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:04 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1#
デバッグコマンドでhelloパケットの送受信を確認します。
R1#debug ip ospf hello OSPF hello events debugging is on R1# *Mar 1 01:39:17.811: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 01:39:17.811: OSPF: End of hello processing R1# *Mar 1 01:39:22.587: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1 R1# *Mar 1 01:39:24.643: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 172.16.1.1 R1# *Mar 1 01:39:27.835: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 01:39:27.835: OSPF: End of hello processing R1# *Mar 1 01:39:32.587: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1 R1# *Mar 1 01:39:34.643: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 172.16.1.1 R1# *Mar 1 01:39:37.815: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 01:39:37.815: OSPF: End of hello processing R1#no debug ip ospf hello *Mar 1 01:39:42.587: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1
R1では、FastEthernet0/1でhelloを送信しているにも関わらず受信はできていません。一方、R3はどうでしょうか。
R3#debug ip ospf hello OSPF hello events debugging is on R3# *Mar 1 01:08:40.491: OSPF: Rcv hello from 172.16.2.1 area 0 from FastEthernet0/1 172.16.2.1 *Mar 1 01:08:40.491: OSPF: Send immediate hello to nbr 172.16.2.1, src address 172.16.2.1, on FastEthernet0/1 *Mar 1 01:08:40.495: OSPF: Send hello to 172.16.2.1 area 0 on FastEthernet0/1 from 172.16.2.2 *Mar 1 01:08:40.495: OSPF: End of hello processing *Mar 1 01:08:40.771: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.2 R3# *Mar 1 01:08:50.491: OSPF: Rcv hello from 172.16.2.1 area 0 from FastEthernet0/1 172.16.2.1 *Mar 1 01:08:50.491: OSPF: Send immediate hello to nbr 172.16.2.1, src address 172.16.2.1, on FastEthernet0/1 *Mar 1 01:08:50.491: OSPF: Send hello to 172.16.2.1 area 0 on FastEthernet0/1 from 172.16.2.2 *Mar 1 01:08:50.495: OSPF: End of hello processing *Mar 1 01:08:50.771: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.2
R3はhelloの送受信ができているように見えます。ただ、このネットワーク環境で「Send immediate hello」が出るのはおかしいです。しかし、とりあえず送受信はできています。という事は、R1でhelloをフィルタリングしている可能性があります。アクセスリストが怪しいですね。確認してみます。
R1#show running-config interface fastEthernet 0/1 Building configuration... Current configuration : 119 bytes ! interface FastEthernet0/1 ip address 172.16.2.1 255.255.255.0 ip access-group 101 in duplex auto speed auto end R1# R1#show access-lists Extended IP access list 100 10 permit ospf any any Extended IP access list 101 10 permit tcp any any 20 permit udp any any R1#
原因がわかりました。access-list 101にOSPFを許可する設定が入っていません。設定を修正します。
R1(config)#access-list 101 permit ospf any any
これでネイバーを張れるようになった事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:35 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:30 172.16.1.2 FastEthernet0/0 R1#
hello interval設定ミス
R1はR3とネイバーが張れていません。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DR 00:00:33 172.16.1.2 FastEthernet0/0 R1#
fa0/1でOSPFが有効になっていることを確認します。
R1#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:00 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 3 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1#
一見すると問題ないように見えます。debugコマンドでhelloのやり取りを確認します。
R1#debug ip ospf hello OSPF hello events debugging is on R1# *Mar 1 06:14:57.018: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1 R1# *Mar 1 06:15:01.990: OSPF: Rcv hello from 172.16.2.2 area 0 from FastEthernet0/1 172.16.2.2 *Mar 1 06:15:01.990: OSPF: Mismatched hello parameters from 172.16.2.2 *Mar 1 06:15:01.990: OSPF: Dead R 40 C 20, Hello R 10 C 5 Mask R 255.255.255.0 C 255.255.255.0 *Mar 1 06:15:02.014: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 06:15:02.018: OSPF: End of hello processing *Mar 1 06:15:02.018: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 172.16.1.1 *Mar 1 06:15:02.018: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1
気になる出力があります。
Mismatched hello parameters from 172.16.2.2
Dead R 40 C 20, Hello R 10 C 5 Mask R 255.255.255.0 C 255.255.255.0
「R」はネイバーの設定、「C」はdebugコマンドを実行したルーターの設定です。このデバッグ出力を見ると、hello intervalの設定がR1とR3で異なっている事がわかります。
念のため、R1とR3で「show ip ospf interface」コマンドを実行してみます。
R1#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5 oob-resync timeout 40R Hello due in 00:00:03 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 3 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1# R3#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.2/24, Area 0 Process ID 1, Router ID 172.16.2.2, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.2, Interface address 172.16.2.2 No backup designated router on this network 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) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 2 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R3#
R1のhello intervalを修正しましょう。
R1(config)#interface fastEthernet 0/1 R1(config-if)#ip ospf hello-interval 10
これでネイバーを張れるようになった事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:33 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:33 172.16.1.2 FastEthernet0/0 R1#
サブネット不一致
R1はR3とネイバーが張れていません。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DR 00:00:35 172.16.1.2 FastEthernet0/0 R1#
R1のfa0/1でOSPFが有効になっている事を確認します。
R1#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/30, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:01 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1#
問題ないようです。次にdebugコマンドでhelloが正常にやり取りされている事を確認します。
R1#debug ip ospf hello OSPF hello events debugging is on R1# *Mar 1 06:42:51.862: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1 *Mar 1 06:42:52.058: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 06:42:52.058: OSPF: End of hello processing R1# *Mar 1 06:42:54.038: OSPF: Rcv hello from 172.16.2.2 area 0 from FastEthernet0/1 172.16.2.2 *Mar 1 06:42:54.038: OSPF: Mismatched hello parameters from 172.16.2.2 *Mar 1 06:42:54.038: OSPF: Dead R 40 C 40, Hello R 10 C 10 Mask R 255.255.255.0 C 255.255.255.252
気になる出力がありますね。
Mismatched hello parameters from 172.16.2.2
Dead R 40 C 40, Hello R 10 C 10 Mask R 255.255.255.0 C 255.255.255.252
前章でも書いた通り「R」はネイバーの設定、「C」はこのルーターの設定です。このデバッグ出力を見るとsubnet maskが異なっている事がわかります。R1とR3のインタフェース設定を見てみましょう。
R1#show running-config interface fastEthernet 0/1 Building configuration... Current configuration : 97 bytes ! interface FastEthernet0/1 ip address 172.16.2.1 255.255.255.252 duplex auto speed auto end R1# R3#show running-config interface fastEthernet 0/1 Building configuration... Current configuration : 95 bytes ! interface FastEthernet0/1 ip address 172.16.2.2 255.255.255.0 duplex auto speed auto end R3#
構成図通りR1のインタフェース設定を修正して、ネイバーが正常に張れる事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:38 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:35 172.16.1.2 FastEthernet0/0 R1#
認証設定不一致
R1はR3とネイバーが張れていません。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DR 00:00:39 172.16.1.2 FastEthernet0/0 R1#
R1のfa0/1でOSPFが有効になっている事を確認します。
R1#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0 Process ID 1, Router ID 172.16.2.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.1, Interface address 172.16.2.1 No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:07 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) Message digest authentication enabled Youngest key id is 1 R1#
問題は見られません。「debug ip ospf event」コマンドで確認をしてみます。
R1#debug ip ospf events OSPF events debugging is on R1# *Mar 1 01:29:51.007: OSPF: Send with youngest Key 1 *Mar 1 01:29:51.011: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.1 R1# *Mar 1 01:29:53.475: OSPF: Rcv hello from 172.16.3.1 area 0 from FastEthernet0/0 172.16.1.2 *Mar 1 01:29:53.475: OSPF: End of hello processing R1# *Mar 1 01:29:55.871: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 172.16.1.1 *Mar 1 01:29:56.435: OSPF: Rcv pkt from 172.16.2.2, FastEthernet0/1 : Mismatch Authentication Key - Message Digest Key 1
気になる出力があります。
Rcv pkt from 172.16.2.2, FastEthernet0/1 : Mismatch Authentication Key
どうやら認証設定に問題があるようです。出力の結果からfa0/0では認証設定をしておらず、fa0/1で認証設定をしているものの、認証エラーとなっている事がわかります。ではR1とR3の設定を確認してみます。
R1#show running-config interface fastEthernet 0/1 Building configuration... Current configuration : 174 bytes ! interface FastEthernet0/1 ip address 172.16.2.1 255.255.255.0 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 Cisco duplex auto speed auto end R1# R3#show running-config interface fastEthernet 0/1 Building configuration... Current configuration : 174 bytes ! interface FastEthernet0/1 ip address 172.16.2.2 255.255.255.0 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 cisco duplex auto speed auto end R3#
パスワードが「Cisco」と「cisco」で異なっています。R1のパスワードを「cisco」に修正してネイバーが張れるようにしましょう。
R1(config-if)#no ip ospf message-digest-key 1 R1(config-if)#ip ospf message-digest-key 1 md5 cisco
修正後、ネイバーが正常に張れる事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:30 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:37 172.16.1.2 FastEthernet0/0 R1#
エリア不一致
R3はR1とネイバーを張れていません。
R3#show ip ospf neighbor R3#
R3のfa0/1でOSPFが有効になっている事を確認します。
R3#show ip ospf interface fa0/1 FastEthernet0/1 is up, line protocol is up Internet Address 172.16.2.2/24, Area 0 Process ID 1, Router ID 172.16.2.2, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.2.2, Interface address 172.16.2.2 No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:07 Supports Link-local Signaling (LLS) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 5 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R3#
問題は見られません。「debug ip ospf event」コマンドで確認をしてみます。
R3#debug ip ospf event OSPF events debugging is on R3# *Mar 1 02:01:23.715: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.2.2 *Mar 1 02:01:24.443: OSPF: Rcv pkt from 172.16.2.1, FastEthernet0/1, area 0.0.0.0 mismatch area 0.0.0.1 in the header R3#
エリアIDに問題がある事がわかります。正しくはエリア0ですが、R1のエリアは1に設定されている事がわかります。R1の設定を確認してみます。
R1#show running-config | begin ospf router ospf 1 log-adjacency-changes network 172.16.1.0 0.0.0.255 area 0 network 172.16.2.0 0.0.0.255 area 1 !
エリア設定を修正します。
R1(config)#router ospf 1 R1(config-router)# network 172.16.2.0 0.0.0.255 area 0
修正後、ネイバーが正常に張れる事を確認します。
R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.1 1 FULL/BDR 00:00:36 172.16.2.1 FastEthernet0/1 R3#
FULL Stateにならない
みんなPriority 0
R1とR3は「2WAY」のままになっています。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 0 2WAY/DROTHER 00:00:36 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:39 172.16.1.2 FastEthernet0/0 R1# R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.1 0 2WAY/DROTHER 00:00:36 172.16.2.1 FastEthernet0/1 R3#
デフォルトではPriority値は1で、DR/BDRの選出はルーターIDで決まります。しかし、あるルーターを意図的に代表ルーターにするためにPriority値0を設定する事はよくあります。では双方のルーターでPriority値を0にするとどうなるのかというと、互いにFULL Stateになる事ができなくなります。
この問題を解決するためには、双方もしくはどちらかのPriority値を0以外にする必要があります。それでは、R3のプライオリティ値をデフォルトに戻してFULL Stateに遷移する事を確認します。
R3(config)#interface fastEthernet 0/1 R3(config-if)#no ip ospf priority
これでFULL Stateに遷移するはずです。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.2 1 FULL/DR 00:00:37 172.16.2.2 FastEthernet0/1 172.16.3.1 1 FULL/DR 00:00:34 172.16.1.2 FastEthernet0/0 R1# R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.2.1 0 FULL/DROTHER 00:00:37 172.16.2.1 FastEthernet0/1 R3#