Apstra ZTP - Cisco
Cisco NX-OS 和 ZTP 磁盘空间
确保交换机上有足够的可用磁盘空间。作为 ZTP 过程的一部分,系统会将新的操作系统映像复制到交换机。在安装 Apstra ZTP 之前,请确保交换机有足够的磁盘空间来放置操作系统映像。
switch1# dir bootflash: | include free|total 1296171008 bytes free 3537219584 bytes total
如果 ZTP 正在安装 Cisco NX-OS 映像,则必须将映像(例如nxos.7.0.3.I7.7.bin)复制到目录中 /containers_data/tftp
,以确保正确的文件权限。
示例:Cisco NX-OS - ztp.json
{ "nxos": { "nxos-versions": [ "9.2(2)" ], "nxos-image": "http://192.168.0.6/nxos.9.2.2.bin", "device-root-password": "admin-password", "custom-config": "nxos_custom.sh", "device-user": "admin", "device-user-password": "admin-password", "system-agent-params": { "agent_type": "onbox", "job_on_create": "install" } } }
此配置可在服务器上的异机代理和设备 API 之间启用安全的异机代理 HTTPS(端口 443)。
Cisco NX-OS自定义配置文件
为Cisco NX-OS设备配置 custom-config
时,请参阅示例 nxos_custom.sh
,即在ZTP过程中执行的bash可执行文件。在安装设备系统代理之前,它可以执行NX-OS配置命令来设置系统配置,如SSH登录横幅。
注意:
您必须通过NX-OS自定义配置文件进行添加 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. ######################################################## ~"
Cisco NX-OS异机代理自定义配置文件
如果使用 Apstra ZTP 准备用于 Cisco NX-OS 设备以用于异机代理,则必须让 custom-config 文件启用以下 NX-OS 配置命令。
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. ######################################################## ~"
重新启动 Cisco NX-OS ZTP
注意:
如果设备上已安装代理,则在重新启动设备 ZTP 进程之前,请通过 UI 设备代理安装程序或通过设备 CLI 手动删除代理。
C9K-172-20-65-5# guestshell destroy Remove remaining AOS data from system Removing the guest-shell deletes most of the data left by AOS. Some files are still on the bootflash:/.aos folder. C9K-172-20-65-5# delete bootflash:.aos no-prompt
有关详细信息,请参阅 思科设备代理 。
要重新启动 Cisco NX-OS ZTP 进程:
switch# write erase switch# reload