カテゴリ:

今回はEIGRPの認証を確認します。R2とR3はシリアルケーブルで接続されています。

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R3#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/3                  23.23.23.3      YES manual up                    up
Loopback0                  17.17.3.3       YES NVRAM  up                    up

EIGRPの設定は下記のようになっています。

R2#show running-config | section eigrp
router eigrp 100
network 0.0.0.0
no auto-summary
eigrp router-id 17.17.2.2

R3#show running-config | section eigrp
ip authentication mode eigrp 100 md5
router eigrp 100
network 0.0.0.0
no auto-summary
eigrp router-id 17.17.3.3

R2はR3と接続していることが確認できます。

R2#show ip eigrp neighbors
IP-EIGRP neighbors for process 100
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   23.23.23.3              Se1/2             13 00:00:25    1  5000  2  0

R2#show ip route eigrp
     17.0.0.0/24 is subnetted, 2 subnets
D       17.17.3.0 [90/2297856] via 23.23.23.3, 00:00:07, Serial1/2

認証が利用されているかどうかを調べるには"show ip eigrp interfaces detail"が便利です。現在はR2とR3の間で認証は利用されていません。

R2#show ip eigrp interfaces detail s1/2
IP-EIGRP interfaces for process 100

                        Xmit Queue   Mean   Pacing Time   Multicast    Pending
Interface        Peers  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se1/2              1        0/0        34       0/15         151           0
  Hello interval is 5 sec
  Next xmit serial <none>
  Un/reliable mcasts: 0/0  Un/reliable ucasts: 3/82
  Mcast exceptions: 0  CR packets: 0  ACKs suppressed: 10
  Retransmissions sent: 65  Out-of-sequence rcvd: 2
  Authentication mode is not set
  Use unicast

EIGRPで認証を利用するには、まずキーチェーンを作成します。R2とR3で同じものを作成します。ここではキーチェーン名を"EIGRP"としキー番号は"1"としました。キーの文字列は"CISCO"です。

R2(config)#key chain EIGRP
R2(config-keychain)#key 1
R2(config-keychain-key)#key-string CISCO

キーチェーンを作成する際にありがちなミスとして、文字列の最後にスペースを加えてしまうというものがあります。見た目上は同じでも異なる文字列と認識され、認証が失敗しますので注意してください。このミスを防ぐため、"show key chain"で確認を行います。下記の例ではWITHSPACEの最後にスペースがあることが分かります。

R2#show key chain
Key-chain EIGRP:
    key 1 -- text "CISCO"
        accept lifetime (always valid) - (always valid) [valid now]
        send lifetime (always valid) - (always valid) [valid now]
Key-chain WITHSPACE:
    key 1 -- text "CISCO "
        accept lifetime (always valid) - (always valid) [valid now]
        send lifetime (always valid) - (always valid) [valid now]

R3でデバグを有効にします。

R3#debug eigrp packets
EIGRP Packets debugging is on
    (UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
R3#

R2のs1/2で認証をを有効にします。

R2(config)#int s1/2
R2(config-if)#ip authentication key-chain eigrp 100 EIGRP
R2(config-if)#ip authentication mode eigrp 100 md5

R3で認証を有効にしていない状態では下記のように表示されます。

Mar 28 11:05:03.178: EIGRP: Serial1/3: ignored packet from 23.23.23.2, opcode = 5 (authentication off or key-chain missing)
Mar 28 11:05:03.182: EIGRP: Dropping peer, invalid authentication
Mar 28 11:05:03.186: EIGRP: Sending HELLO on Serial1/3
Mar 28 11:05:03.186:   AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
Mar 28 11:05:03.198: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 23.23.23.2 (Serial1/3) is down: Auth failure

R3でも認証を有効にします。するとR2とR3の再接続が確認できます。

R3(config)#int s1/3
R3(config-if)#ip authentication key-chain eigrp 100 EIGRP
R3(config-if)#ip authentication mode eigrp 100 md5

Mar 28 11:07:06.974: EIGRP: received packet with MD5 authentication, key id = 1
Mar 28 11:07:06.974: EIGRP: Received HELLO on Serial1/3 nbr 23.23.23.2

確認すると、確かに認証を利用していることが表示されます。

R2#show ip eigrp interfaces detail s1/2
IP-EIGRP interfaces for process 100

                        Xmit Queue   Mean   Pacing Time   Multicast    Pending
Interface        Peers  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se1/2              1        0/0        15       0/15          95           0
  Hello interval is 5 sec
  Next xmit serial <none>
  Un/reliable mcasts: 0/0  Un/reliable ucasts: 7/90
  Mcast exceptions: 0  CR packets: 0  ACKs suppressed: 14
  Retransmissions sent: 66  Out-of-sequence rcvd: 4
  Authentication mode is md5,  key-chain is "EIGRP"
  Use unicast