2023-08-20 Juniper Apstra を触ってみた

提供: hkatou_Lab
ナビゲーションに移動 検索に移動

DC で使用する EVPN で、たくさんの機器を GUI から構築・設定・監視できる Juniper Apstra を触ってみました。

元々は Apstra 社の製品で Juniper に買収されたためにネットワーク機器メーカーに依存しません。

このため Juniper ブランドでありながらマルチベンダーに対応しています。

できること

メーカーの資料を読む限り、以下の内容が Apstra で実現可能なようです。(できるとは言っていない)

対応機器

Juniper QFX Junos

Cisco Nexus NX-OS

Arista DCS EOS

Whitebox SONiC

Day0

BULE PRINT

ラック・接続・レイヤ数などのデザインを決める [1]

  • Super Spine ありか、Spine / Leaf のみか
  • 3 階層の 5-Stage CLOS 対応
ネットワーク構築
  • Apstra インストール
  • Apstra Agent インストール
  • Apstra ZTP
    • DHCP で機器管理ポートに IP 割当
    • NOS バージョン変更、ライセンス適用
    • Apstra Agent インストール
    • 初期コンフィグ適用

Day1

設定追加・変更Staged Blueprint
  • リファレンス アーキテクチャを元にコンフィグを自動生成
ロールバック
ネットワーク拡張・縮小・変更
その他
  • AS 番号などのリソース不足を事前確認

Day2+

IBA (Intent Based Analytics) : 運用であるべき姿をもとにして、正常性を保つ

死活監視のみではなく、手順書でよくあるステータス確認を常時実行して、状態確認を行える

  • グラフデータベースの情報を元に、あるべき状態 (インテント) と、現在の情報を比較して正常性確認
    • 物理ポートは Up か
    • LACP でバンドルされているか
    • P2P リンクで BGP が Establish か
    • MAC アドレスが学習できているか

メンテナンスモード : 複数台の機器を GUI から操作してトラフィック迂回させ、NOS バージョンアップ

  • トラフィック迂回は他のソフトウェアでもよくありますが、正常性確認もセットで行えるのが良い点

コンフィグ レット : SNMP NTP などをテンプレート コンフィグとして各機器へ展開

できないこと

未対応 : ブラウン フィールドへ Apstra を展開する

  • 構築済みの環境を Apstra のコントロール下に置くことはできない [2]

メーカー資料リンク

Juniper Apstra 製品概要 (PDF)

Juniper Apstra 4.1.0 ハンズオン (PDF)

Juniper Apstra 4.1ユーザーガイド

  • NOS 側のエージェント設定とか

インストール

EVE-NG 公式サイトの手順 [3] でインストールしました。

スクリーンショット

てきとうに NX-OS / Junos / EOS で 3 layer 組んでみたの図。

Apstra_at_EVE-NG
Apstra_at_EVE-NG

GUI にログインして、

Apstra_GUI_login

NOS は固定 IP で設定、Apstra GUI から IP 指定して Offbox として機器を検出。

Apstra_GUI_node_list
Apstra_GUI_node_list

Apstra エージェント インストール用 NOS 初期コンフィグ

テンプレートコンフィグを流し込み。以下は <> のパラメータを環境に応じて書き換える必要あり。

Junos

Junos は応答プロンプトがあるため、パスワード入力時に停止します。流し込みはできません。

(load terminal でできるかもですが、未確認)

root
Juniper

cli
configure
set system root-authentication plain-text-password
<root_pass>
<root_pass>
set system login user admin class super-user authentication plain-text-password
<root_pass>
<root_pass>

set interfaces em0.0 family inet address <mgmt_ip>
delete interfaces em0.0 family inet dhcp

set system services telnet connection-limit 15
set system services ssh
set system services netconf ssh

set system host-name <hostname>

set system management-instance
set routing-instances mgmt_junos routing-options static route 0.0.0.0/0 next-hop <mgmt_gw>
set system ntp server <ntp_server> routing-instance mgmt_junos
commit

NX-OS

admin

conf t
!
hostn <hostname>
!
no password strength-check
username admin role network-admin password admin
!
interface mgmt0
  ip address <mgmt_ip>
vrf context management
  ip route 0.0.0.0/0 <mgmt_gw>
feature telnet
feature nxapi
feature bash-shell
feature scp-server
feature evmed
nxapi http port 80
!
boot nxos bootflash:nxos.9.3.4.bin
!
ntp server <ntp_server> use-vrf management
!
guestshell enable
!
end

copy running-config startup-config

EOS

#zerotouch disable
!!! 自動で再起動がかかる
admin

enable

configure terminal

hostname <hostname>

vrf instance management
!

service routing protocols model multi-agent

aaa authorization exec default local

username admin privilege 15 role network-admin secret admin

interface Management1
 vrf management
 ip address <mgmt_ip>/24
 no shutdown
!
ip route vrf management 0.0.0.0 0.0.0.0 <mgmt_gw>

management telnet
 no shutdown
management ssh
 no shutdown
management api http-commands
   protocol http
   no shutdown
   !
   vrf management
      no shutdown
!
ntp server vrf management <ntp_server>

end

write memory
reload

!!! multi-agent 有効化のため、再起動

ナレッジ

Cisco NX-OS で Apstra Agent が Offbox 登録できない

オフボックスエージェントの作成 に、Apstra から NOS を認識させるための、各 NOS の初期設定が記載されていますが、NX-OS はコマンドが足りません。

GUI で show log ボタンをクリック

エラー内容を見てみると・・・

2023-08-20 01:00:43,389 INFO:10.11.252.189 install
2023-08-20 01:00:43,389 INFO:Ensure stable connection for 60s
2023-08-20 01:00:43,390 INFO:TASK: Check Connectivity
2023-08-20 01:00:44,777 INFO:Successful connection check..
2023-08-20 01:01:13,803 INFO:Successful connection check..
2023-08-20 01:01:43,820 INFO:Successful connection check..
2023-08-20 01:01:43,821 INFO:TASK: Get platform type
2023-08-20 01:01:45,841 INFO:10.11.252.189::nxos
2023-08-20 01:01:45,842 INFO:System Agent id: 
2023-08-20 01:01:47,619 INFO:TASK: Verify boot variables are same
2023-08-20 01:01:48,478 INFO:TASK: Get device facts
2023-08-20 01:01:49,143 INFO:aos found? True
2023-08-20 01:01:50,410 INFO:Command failed (rc=9), retrying..
2023-08-20 01:01:56,053 INFO:Command failed (rc=9), retrying..
2023-08-20 01:02:01,732 INFO:Command failed (rc=9), retrying..
2023-08-20 01:02:07,396 INFO:Command failed (rc=9), retrying..
2023-08-20 01:02:13,054 INFO:Command failed (rc=9), retrying..
2023-08-20 01:02:18,733 ERROR:Failure reason: , return-code: 9
2023-08-20 01:02:18,734 ERROR:FAILED
2023-08-20 01:02:18,735 ERROR:Failed command: guestshell run sudo su -c "/etc/init.d/aos show_version && echo APSTRA_CMD_SUCCESS"
2023-08-20 01:02:18,735 ERROR:Remote ssh command failed
Traceback (most recent call last):
  File "/aos/system_agent/runner/aos_device_installer/run.py", line 100, in <module>
    action.run_action()
  File "/aos/system_agent/runner/actions/base_action.py", line 302, in run_action
    self.run()
  File "/aos/system_agent/runner/actions/cisco.py", line 914, in run
    self._install()
  File "/aos/system_agent/runner/actions/base_action.py", line 374, in _install
    self.device_facts = self.get_device_facts()
  File "/aos/system_agent/runner/actions/utils/base_di.py", line 186, in wrapped
    return f(self, *args, **kwargs)
  File "/aos/system_agent/runner/actions/cisco.py", line 218, in get_device_facts
    "/etc/init.d/aos show_version")
  File "/aos/system_agent/runner/actions/cisco.py", line 86, in guestshell
    % cmd, timeout=timeout, ** kwargs)
  File "/aos/system_agent/runner/actions/cisco.py", line 53, in run_show_command
    return_val = self.run_remote_command(cmd, num_try=num_try, **kwargs)
  File "/aos/system_agent/runner/actions/cisco.py", line 45, in run_remote_command
    return ssh.run()
  File "/aos/system_agent/runner/actions/utils/remote.py", line 130, in run
    raise RemoteSshCommandException(self)
RemoteSshCommandException: Remote ssh command failed
2023-08-20 01:02:18,737 ERROR:STDOUT: Note: Guest shell is not enabled by default, use the 'guestshell enable' command to enable it
2023-08-20 01:02:18,738 ERROR:STDERR:

ご丁寧にも "guestshell enable を有効にしろ" 、と出てきますので、

# show guestshell

# configure terminal
(config)# guestshell enable
# end

# show guestshell
Virtual service guestshell+ detail
  State                 : Initializing
  Package information
    Name                : None
    Path                : Not Available
    Application
      Name              : None
      Installed version : None
      Description       : None
    Signing
      Key type          : Unsigned
      Method            : None
    Licensing
      Name              : None
      Version           : None
  Resource reservation
    Disk                : 0 MB
    Memory              : 0 MB
    CPU                 : 0% system CPU

で有効化しましょう。いやらしいことに、guestshell enable は show running-config all にも表示されない設定です。

show guestshell コマンドで確認します。

引用