ベンダー固有のカスタム構成の作成
概要 デバイスのベンダーによっては、設定(custom-config
)のカスタマイズが必要な場合があります。
シェルスクリプトを使用して、ZTP中にデバイスにカスタム設定を追加できます。これらのファイルは、TFTP ディレクトリ、または URL でポイントする HTTP サーバにあります。
ztp.json ファイルを構成するときは、プラットフォーム固有のセクションの custom-config フィールドに bash ファイル名を指定します。
junos_custom.sh
Juniper Junos OSおよびJunos OS Evolvedデバイスで設定をカスタマイズするには、ZTPプロセス中に実行されるbashスクリプトファイルの に設定 junos_custom.sh
を追加します。
デバイスシステムエージェントが自動的にインストールされる前に、Syslog、NTP、SNMP認証などのJunos設定コマンドを実行できます。
デュアルRE設定のJunos OSおよびJunos OS Evolvedプラットフォームでは、 set system commit synchronize
コマンドが必要です。この設定がないと、ZTP プロセスは失敗します。コマンドを junos_custom.sh
ファイルに追加することをお勧めします。
サンプル junos_custom.sh
ファイルを参照してください。
#!/bin/sh SOURCE_IP=$(cli -c "show conf interfaces em0.0" | grep address | sed 's/.*address \([0-9.]*\).*/\1/') # Syslog SYSLOG_SERVER="192.168.59.4" SYSLOG_PORT="514" # NTP NTP_SERVER="192.168.59.4" # SNMP SNMP_NAME="SAMPLE" SNMP_SERVER="192.168.59.3" # Syslog cli -c "configure; \ set system syslog host $SYSLOG_SERVER any notice ; \ set system syslog host $SYSLOG_SERVER authorization any ; \ set system syslog host $SYSLOG_SERVER port $SYSLOG_PORT ; \ set system syslog host $SYSLOG_SERVER routing-instance mgmt_junos ; \ commit and-quit" cli -c "configure; \ set system syslog file messages any notice ; \ set system syslog file messages authorization any ; \ commit and-quit" # NTP cli -c "configure; \ set system ntp server $NTP_SERVER routing-instance mgmt_junos ; \ set system ntp source-address $SOURCE_IP routing-instance mgmt_junos ; \ commit and-quit;" # SNMP cli -c "configure; \ set snmp name $SNMP_NAME; \ set snmp community public clients $SNMP_SERVER/32 ; \ set snmp community public routing-instance mgmt_junos ; \ set snmp routing-instance-access access-list mgmt_junos ; \ commit and-quit"
外部 AAA 認証を設定する場合(例 authentication-order
:)、デバイスシステムエージェント device-user
と device-user-password
を AAA システムで複製する必要があります。それ以外の場合、デバイス システム エージェントは認証エラーを生成します。
eos_custom.sh
Arista EOSデバイスの設定をカスタマイズするには、ZTPプロセス中に実行されるbashスクリプト・ファイルである に設定を追加します eos_custom.sh
。
EOS設定コマンドを実行して、SSHログインバナーや、デバイスシステムエージェントが自動的にインストールされる前に設定する必要があるその他のシステム設定を設定できます。
サンプル eos_custom.sh
ファイルを参照してください。
#!/bin/sh FastCli -p 15 -c $'conf t\n service routing protocols model multi-agent\n hardware tcam\n system profile vxlan-routing\n banner login\n ######################################################## UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED ########################################################\n EOF\n'
ZTPプロセス中、EOSバナーログインは「デバイスはゼロタッチプロビジョニングモードです...".デフォルトでは、ZTP スクリプトはこれを恒久的な設定にコピーします。
これを防ぐには、別の または を構成するno banner login
スクリプト (eos_custom.sh
など) banner login
へのポインティングを構成するcustom-config
必要があります。
の後に \n
スペースが必要です。
nxos_custom.sh (オンボックスエージェント)
Cisco NX-OS デバイスの設定をカスタマイズするには、ZTP プロセス中に実行される bash スクリプト ファイルの に設定 nxos_custom.sh
を追加します。
SSHログインバナーなどのシステム設定を設定するNX-OS設定コマンドや、デバイスシステムエージェントを自動的にインストールする前に設定する必要があるその他のシステム設定を実行できます。
サンプル nxos_custom.sh
ファイルを参照してください。
ファイルを使用して custom-config
追加 copp profile strict
する必要があります。
#!/bin/sh /isan/bin/vsh -c "conf ; copp profile strict ; banner motd ~ ######################################################## BANNER BANNER BANNER BANNER BANNER BANNER BANNER BANNER ######################################################## Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec gravida, arcu vitae tincidunt sagittis, ligula massa dignissim blah, eu sollicitudin nisl dui at massa. Aliquam erat volutpat. Vitae pellentesque elit at pulvinar volutpat. Etiam lacinia derp lacus, non pellentesque nunc venenatis rhoncus. ######################################################## ~"
nxos_custom.sh (オフボックスエージェント)
Apstra ZTP を使用してオフボックスエージェントで使用するためにCisco NX-OSデバイスを準備する場合は、ファイルで次のNX-OS設定コマンドを有効にする必要があります custom-config
。
feature nxapi feature bash-shell feature scp-server feature evmed copp profile strict nxapi http port 80
以下 nxos_custom.sh
を使用して、これらをバナーとともに追加できます。
#!/bin/sh /isan/bin/vsh -c "conf ; feature nxapi ; nxapi http port 443 ; feature bash-shell ; feature scp-server ; feature evmed ; copp profile strict ; banner motd ~ ######################################################## BANNER BANNER BANNER BANNER BANNER BANNER BANNER BANNER ######################################################## Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec gravida, arcu vitae tincidunt sagittis, ligula massa dignissim blah, eu sollicitudin nisl dui at massa. Aliquam erat volutpat. Vitae pellentesque elit at pulvinar volutpat. Etiam lacinia derp lacus, non pellentesque nunc venenatis rhoncus. ######################################################## ~"
sonic_custom.sh
Enterprise SONiC デバイスで設定をカスタマイズするには、ZTP プロセス中に実行される bash スクリプト ファイルに構成 sonic_custom.sh
を追加します。
デバイスシステムエージェントが自動的にインストールされる前に、Radius認証の設定などのEOS設定コマンドを実行できます。
サンプル sonic_custom.sh
ファイルを参照してください。
#!/bin/bash sed -i s/"#Banner.*"/"Banner /etc/issue.net"/ /etc/ssh/sshd_config cat >& /etc/issue.net << EOF Provisioned by AOS Date: $(date) EOF service ssh restart