キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
1363
閲覧回数
15
いいね!
0
コメント
Tomoya Watanabe
Spotlight
Spotlight

NSO5.6以上において、5.5以前では成功していた鍵交換が失敗するケースがあります。

5.5以下から5.6以上へupgradeし、sync-from/check-sync等の装置と接続をするオペレーションを実施した際に下記のようなError Messageが表示される場合があります。

 

 

user@ncs# devices device cisco ssh fetch-host-keys

result failed info Failed to authenticate towards device cisco: SSH key exchange failed
 

 

これはNSO5.6から鍵交換方式が指定できるような機構を持つようになり、装置との鍵交換方式が合わない設定になっている場合、鍵交換方式の確認でFailが起きていることが原因です。

 

 
 
  - ncs: Add support for configurable SSH algorithms in NSO making it
    possible to decide which algorithms should be used when connecting to a
    device. The new model is available as a global setting underneath
    /devices/global-settings, but can also be configured per device, device
    profile, cluster node or live status protocol.
    In addition to making the algorithms configurable, more algorithms have
    been added to the list of supported algorithms and the fetch-host keys
    action has been updated to only fetch host keys for the public key
    algorithms configured for a device.
    It is important to note that the ssh-rsa and ssh-dss algorithms have
    been removed from the default list of configured public key algorithms
    and therefore to be able to communicate with devices only supporting
    these algorithms one has to manually configure them in NSO for these
    devices.

    (ENG-25123)
 
対応策としては、下記の2点が存在します。
 
  1. 装置側の鍵交換方式を、NSOが対応する鍵交換方式に変更する
  2. NSOの鍵交換方式を、装置側が対応する鍵交換方式に変更する

 

 

装置側の鍵交換方式を、NSOが対応する鍵交換方式に変更する

装置側の鍵交換方式を変更する方法では、いくつか必要条件が存在します。

  1. 装置側が鍵交換方式を変更できる装置であること。複数種類の装置が存在する場合、それら全てが鍵交換方式を変更できる装置であること。
  2. 装置が複数台存在する場合、複数台の設定を全て変更できる状況にあること

1番のケースでは、実際にCisco IOS XE 3.x台前半では鍵交換の設定変更ができない装置が存在します。
鍵交換の設定変更が存在するルーターでは、下記のような設定で変更が可能です。

 

ip ssh server algorithm kex diffie-hellman-group14-sha1

上記の設定変更が可能な場合でも、1台ずつ設定変更をする必要があるため、2番(複数台設定変更する必要がある)のケースも考慮する必要があります。
NSOであれば複数台の設定変更をするようなScriptを作成し、Restconfで操作をすれば複数台を円滑に設定変更することができますが、そもそも鍵交換ができないためNSOからの設定変更はできません。python netmiko/napalm等のOSS等で変更するか、手動での変更が必要になるため、装置側の鍵変更をする場合にはそれらも考慮する必要があります。

 

 

NSOの鍵交換方式を、装置側が対応する鍵交換方式に変更する

NSOでの鍵交換方式の設定変更は下記のように実施します。

 

devices global-settings ssh-algorithms public-key [ ssh-rsa ]
devices global-settings ssh-algorithms kex [ diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha1 ]

NSO側で鍵交換方式を変更することで、装置1台1台の変更は避けることができますが、選択する暗号化方式によっては暗号化強度の観点では課題が残る可能性があります。

 

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします