🌐

JANOG57 NETCON Level1-7 問題解説

に公開

問題文

topology

ネットワークエンジニアとして働いているあなたは、OSPFの設定を完了しネイバーの状況を確認しようと思いましたが、ネイバーが上がっていないことに気づきました。
OSPFのネイバーが上がっていない原因を調査し、ネイバーを上げて、ループバックアドレス間で通信ができるようにしてください。

達成条件

  • OSPFのネイバーが上がっていること
RT-01#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:39    192.168.0.2     GigabitEthernet2
  • RT-01からRT-02のループバックアドレスにpingが通ること
RT-01#ping 2.2.2.2 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/9/42 ms

制約

  • 設定の追加・削除は禁止ですが、修正・変更は可能とします。
  • スタティックルートの設定は禁止とする

解説

この問題では、OSPFの認証がうまく行っていないことが原因でOSPFネイバーが上がらずにLoopbackアドレス同士での通信ができていません。

みなさん、まずはコンフィグを見に行くと思います。show runをして設定を目grepするかと思いますが特にトラブルが起こるようなコンフィグがあるようには見えなそうです。
次に、対向のインターフェースにそもそも通信ができるのかを確認したいと思います。

RT-01#ping 192.168.0.2 repeat 3
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 2/3/5 ms

IPアドレスへの通信はできていることは確認できました。
というわけで、OSFPに問題が起こっていると判断してdebugコマンドでOSPFの状態を見ていこうと思います。

RT-01#debug ip ospf adj 
OSPF adjacency debugging is on
RT-01#show log
   (中略)
*Dec 30 11:12:53.633: OSPF-1 ADJ   Gi2: Send with youngest Key 1
*Dec 30 11:12:57.088: OSPF-1 ADJ   Gi2: Rcv pkt from 192.168.0.2 : Mismatched Authentication key - ID 1

ログを見てみると、どうやら認証キーが間違っていると言われています。もう一度それぞれのOSPFの設定部分を見比べてみたいと思います。

RT-01#show running-config | section interface GigabitEthernet2
interface GigabitEthernet2
 ip address 192.168.0.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 netcon
 ip ospf network point-to-point
 ip ospf 1 area 0
 ip ospf cost 10
 negotiation auto

RT-02#show running-config | section interface GigabitEthernet2
interface GigabitEthernet2
 ip address 192.168.0.2 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 netcon 
 ip ospf network point-to-point
 ip ospf 1 area 0
 ip ospf cost 10
 negotiation auto

OSPFの認証キーにあたる部分は、ip ospf message-digest-key 1 md5 netconになりますが二つとも同じキーワードのnetconになっています。
では、この認証キーの一体何が違うのかというと認証キーの部分をコードエディタにコピペしてみるとわかります。
上がRT-01で、下がRT-02のコンフィグになります。RT-02の方にnetconの後に半角スペースが入っているのがお分かりでしょうか。
今回使用しているIOS-XEには、空白も含んで認証キーとしてしまうような仕様になっています。
inSpace

原因が判明したのでRT-02の方の認証キーに含まれている空白を消します。

RT-02#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
RT-02(config)#interface GigabitEthernet 2
RT-02(config-if)#no ip ospf message-digest-key 1 
RT-02(config-if)#ip ospf message-digest-key 1 md5 netcon

OSPFのネイバーが上がっているのかを確認します。
ちゃんと上がっていますね。

RT-01#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:34    192.168.0.2     GigabitEthernet2

次にRT-01のLoopbackアドレスからRT-02のLoopbackアドレスへの疎通確認を行います。
ちゃんと繋がってますね。

RT-01#ping 2.2.2.2 repeat 3 source 1.1.1.1
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 1/1/1 ms

Discussion