Apstra ZTP - 瞻博网络
EX 交换机需要 Junos OS 21.2 或更高版本。使用低于 21.2 版本的 Junos OS 的 EX 交换机缺少 ZTP 所需的 Python 模块。
瞻博网络和 ZTP 磁盘空间
Apstra ZTP 管理瞻博网络 Junos 设备的自举和生命周期。它使用自定义脚本来创建异机代理、创建本地用户以及设置其他系统配置。ZTP 进程会将新操作系统映像复制到交换机。安装 Apstra ZTP 之前,请确保交换机有足够的磁盘空间来存放 OS 映像。
root@leaf001-001-2> show system storage Filesystem Size Used Avail Capacity Mounted on /dev/gpt/junos 6.0G 1.0G 4.5G 18% /.mount <...>
示例:Juniper Junos - ztp.json
瞻博网络 Junos Offbox 代理/Apstra ZTP 4.1
{ "junos": { "junos-versions": [ "20.2R2-S3.5" ], "junos-image": "http://192.168.59.4/jinstall-host-qfx-5-20.2R2-S3.5-signed.tgz", "device-root-password": "root-password", "device-user": "admin", "device-user-password": "admin-password", "custom-config": "junos_custom.sh", "system-agent-params": { "platform": "junos", "agent_type": "offbox", "job_on_create": "install" } } }
示例:瞻博网络 Junos OS Evolved - ztp.json
瞻博网络 Junos OS 演化版 Offbox 代理/ Apstra ZTP 4.1
{ "junos-evo": { "junos-evo-versions": [ "20.4R3-S1.3-EVO" ], "junos-evo-image": "http://192.168.59.4/junos-evo-install-qfx-ms-fixed-x86-64-20.4R3-S1.3-EVO.iso", "device-root-password": "root-password", "device-user": "admin", "device-user-password": "admin-password", "custom-config": "junos_custom.sh", "system-agent-params": { "platform": "junos", "agent_type": "offbox", "job_on_create": "install" } } }
以下附加字段可用于双 RE 平台,如 PTX10004。
"dual-routing-engine": true, "management-ip": "10.161.37.7", "management-gw-ip": "10.161.39.254", "management-subnet-prefixlen": "21", "management-master-ip": "10.161.37.8", "management-backup-ip": "10.161.37.9",
瞻博网络 Junos Bootstrap 文件
Apstra ZTP 使用 Python 脚本在 ZTP 期间调配设备。要允许在非 Junos OS 演化版的设备上运行 Python 脚本 (ztp.py
),需要其他配置。使用脚本在 junos_apstra_ztp_bootstrap.sh
Junos 上启动 Apstra ZTP。它会下载并运行 ZTP 脚本。
Junos OS 演化型设备不需要此自举;他们直接运行 Apstra ZTP Python 脚本 (ztp.py)
瞻博网络 Junos 自定义配置文件
custom-config
配置瞻博网络 Junos 设备时,请参阅示例junos_custom.sh
,即在 ZTP 过程中执行的 bash 可执行文件。它可以在安装设备系统代理之前设置系统配置(如系统日志、NTP、SNMP 身份验证)。
具有双 RE 设置的 Junos OS 和 Junos OS 演化平台需要 set system commit synchronize
命令。如果没有此配置,ZTP 进程将失败。我们建议将命令添加到文件中 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 系统中。否则,设备系统代理将生成身份验证错误。
重新启动瞻博网络 Junos ZTP
要擦除(归零)设备并重新启动瞻博网络 Junos ZTP 进程:
root@leaf3> request system zeroize
瞻博网络 Junos ZTP 故障排除
处于 ZTP 模式时,瞻博网络交换机会将 ztp.py
文件 ztp.json
下载到 /var/preserve/apstra
目录中。对于诊断,请记下该文件 /var/preserve/apstra/aosztp.log
。
您可以在(搜索“ztp”)中找到 /var/log/messages
其他有用消息。