CLI로 ztp.json 구성
Apstra ZTP 서버에 SSH로 접속하고 ztp.json 파일을 구성합니다.
오류 발생 가능성을 줄이려면 Apstra ZTP GUI 구성 도구를 사용하여 구성 ztp.json하는 것이 좋지만 아래에 설명된 대로 CLI를 대신 사용할 수도 있습니다. vi 또는 nano와 같은 텍스트 편집기를 사용하여 ZTP 구성을 직접 구성할 수 있습니다.
CLI로 ztp.json 구성
- 터미널을 열고 Apstra ZTP 서버에 SSH로 연결합니다.
ssh admin@<apstra-ztp-server-ip>여기서<apstra-ztp-server-ip>는 Apstra ZTP 서버의 IP 주소입니다. - ZTP 구성 파일은 디렉터리의 Apstra ZTP VM에 있습니다.
/containers_data/tftpadmin@apstra-ztp:~$ sudo ls -l /containers_data/tftp total 336 -rwxrwxrwx 1 admin admin 2448 Aug 28 16:39 config_verifier.py -rwxrwxrwx 1 admin admin 742 Aug 28 16:39 container_init.sh -rwxr-xr-x 1 admin admin 292 Sep 11 15:17 cumulus_slicer_custom.sh -rwxrwxrwx 1 admin admin 178 Aug 28 16:39 Dockerfile -rwxrwxrwx 1 admin admin 107 Aug 28 16:39 eos_custom.sh -rwxr-xr-x 1 admin admin 75 Sep 11 15:17 eos_slicer_custom.sh -rwxrwxrwx 1 admin admin 5735 Aug 28 16:39 junos_apstra_ztp_bootstrap.sh -rwxrwxrwx 1 admin admin 1799 Aug 28 16:39 junos_custom.sh -rwxr-xr-x 1 admin admin 564 Sep 11 15:17 junos_evo_slicer_custom.sh -rwxr-xr-x 1 admin admin 517 Sep 11 15:17 junos_slicer_custom.sh -rwxr-xr-x 1 admin admin 214 Sep 11 15:17 linux_slicer_custom.sh -rwxrwxrwx 1 admin admin 86 Aug 28 16:39 nxos_custom.sh -rwxr-xr-x 1 admin admin 78 Sep 11 15:17 nxos_slicer_custom.sh -rwxrwxrwx 1 admin admin 205 Aug 28 16:39 poap-md5sum -rw-rw-r-- 1 admin admin 26720 Sep 11 15:17 pxelinux.0 -rwxrwxrwx 1 admin admin 1843 Aug 28 16:39 rsyslog.conf -rwxrwxrwx 1 admin admin 170 Aug 28 16:39 sonic_custom.sh -rwxr-xr-x 1 admin admin 88 Sep 11 15:17 sonic_slicer_custom.sh -rwxrwxrwx 1 admin admin 2640 Sep 11 15:17 ztp.json -rwxrwxrwx 1 admin admin 115549 Aug 28 16:58 ztp.py -rwxrwxrwx 1 root root 115506 Aug 28 16:58 ztp.py.md5
- vi 또는 nano와 같은 텍스트 편집기로 파일을 엽니다
ztp.json.admin@apstra-ztp:~$ sudo nano /containers_data/tftp/ztp.json
- 기본 섹션에는 기본 키-값 쌍이 포함됩니다. 여기에 정의된 값은 특정 플랫폼, 모델 또는 일련 번호와 같이 더 구체적인 섹션에 동일한 키가 정의되지 않는 한 모든 디바이스에 적용됩니다. 구체적인 키가 덜 구체적인 키보다 우선합니다. 주요 세부 정보는 ztp.json 키를 참조하십시오.
{ "defaults": { "nxos-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/cisco/nxos.10.2.5.bin", "eos-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/arista/EOS-4.27.6M.swi", "cumulus-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/cumulus/cl-4.2.1-bcm-amd64.bin", "junos-image": "http://10.24.128.10/apstrktr/switch_images/juniper/junos-5e-22.2R3.15.tgz", "junos-evo-image": "http://10.24.128.10/apstrktr/switch_images/juniper/junos-evo-install-qfx-ms-fixed-x86-64> "sonic-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/sonic/sonic-4.0.5-GA-adv-bcm.bin", "license": "http://onie.dc1.apstra.com/lic/cumulus.lic", "device-root-password": "admin", "device-user": "admin", "device-user-password": "admin" },아니면 이거?
{ "defaults": { "nxos-versions": [ "nxos-version1" ], "nxos-image": "aos_nxos_image.bin", "eos-versions": [ "eos-version1", "eos-version2" ], "eos-image": "aos_eos_image.bin", "junos-versions": [ "junos-version1", "junos-version2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-5e-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [ "junos-evo-version1" ], "junos-evo-image": "http://server_address/path/to/install_package_name.tgz", "sonic-versions": [ "sonic-version1", "sonic-version2" ], "sonic-image": "http://server_address/path/to/sonic_package_name.bin", "device-root-password": "admin", "device-user": "aosadmin", "device-user-password": "aosadmin", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "onbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "junos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S2.2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-5e-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "root123", "device-user": "aosadmin", "device-user-password": "aosadmin123", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "junos", "agent_type": "offbox", "install_requirements": false, "job_on_create": "install", "force_package_install": false, "packages": [] } }, "junos-evo": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "root123", "device-user": "", "device-user-password": "aosadmin123", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "junos", "agent_type": "offbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "install", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "eos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "eos_custom.sh", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "nxos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "admin123", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "onbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "JNP10002-60C [QFX10002-60C]": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S1.3" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S1.3/junos-vmhost-install-qfx-x86-64-21.2R1-S1.3.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "QFX10002-36Q": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S2.2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-10-f-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } } } - 플랫폼별 섹션에는 플랫폼을 기반으로 각 디바이스에 적용되는 구성이 포함됩니다. custom-config 파일에 대한 자세한 내용은 벤더별 사용자 지정 구성 만들기를 참조하세요
"junos": { "device-root-password": "root123", "custom-config": "junos_slicer_custom.sh" }, "junos-evo": { "device-root-password": "root123", "custom-config": "junos_evo_slicer_custom.sh" }, "eos": { "custom-config": "eos_slicer_custom.sh" }, "nxos": { "custom-config": "nxos_slicer_custom.sh" }, "cumulus": { "custom-config": "cumulus_slicer_custom.sh" }, "sonic": { "custom-config": "sonic_slicer_custom.sh" }, "linux": { "custom-config": "linux_slicer_custom.sh" } } - 모델별 매개 변수에는 다음이 포함됩니다.
- 일련 번호 매개 변수에는 다음이 포함됩니다.
"5254003765C9": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400EB0A3C": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "5254002FFA41": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400C36BF6": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400DE0AE4": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400B813C8": { "system-agent-params": null }, "5254007F0AF8": { "system-agent-params": null }, "5254008DDCCF": { "system-agent-params": null }, "525400602A79": { "system-agent-params": null }, "5254004D62B3": { "system-agent-params": null },