Apstra ZTP – Juniper
EX-Switches erfordern Junos OS Version 21.2 oder höher. Das für ZTP erforderliche Python-Modul fehlt auf EX-Switches, die Junos OS-Versionen unter 21.2 verwenden.
Juniper und ZTP-Festplattenspeicher
Apstra ZTP verwaltet den Bootstrap und den Lebenszyklus von Junos-Geräten von Juniper. Es verwendet ein benutzerdefiniertes Skript, um Offbox-Agenten zu erstellen, lokale Benutzer zu erstellen und andere Systemkonfigurationen festzulegen. Der ZTP-Prozess kopiert ein neues Betriebssystem-Image auf den Switch. Stellen Sie vor der Installation von Apstra ZTP sicher, dass der Switch über ausreichend Speicherplatz für das Betriebssystem-Image verfügt.
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 <...>
Beispiel: Juniper Junos – ztp.json
Juniper Junos Offbox Agent / 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" } } }
Beispiel: Juniper Junos OS Evolved – ztp.json
Juniper Junos OS Evolved Offbox Agent / 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" } } }
Die folgenden zusätzlichen Felder können für Dual-RE-Plattformen wie PTX10004 verwendet werden.
"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",
Juniper Junos Bootstrap-Datei
Apstra ZTP verwendet ein Python-Skript, um das Gerät während der ZTP bereitzustellen. Damit das Python-Skript (ztp.py
) auf einem Gerät ausgeführt werden kann, das nicht Junos OS Evolved ist, ist eine zusätzliche Konfiguration erforderlich. Verwenden Sie das junos_apstra_ztp_bootstrap.sh
Skript, um Apstra ZTP auf Junos zu booten. Es lädt das ZTP-Skript herunter und führt es aus.
Junos OS Evolved-Geräte erfordern diesen Bootstrap nicht. führen sie das Apstra ZTP Python-Skript (ztp.py) direkt aus.
Juniper Junos Custom Config File
Bei der Konfiguration custom-config
für Junos-Geräte von Juniper finden Sie im Beispiel junos_custom.sh
eine ausführbare Bash-Datei, die während des ZTP-Prozesses ausgeführt wird. Es kann die Systemkonfiguration (z. B. Syslog, NTP, SNMP-Authentifizierung) vor der Installation des Gerätesystemagenten festlegen.
Junos OS und Junos OS Evolved-Plattformen mit Dual-RE-Setups erfordern den set system commit synchronize
Befehl. Ohne diese Konfiguration schlägt der ZTP-Prozess fehl. Wir empfehlen, der Datei den Befehl hinzuzufügen 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"
Wenn Sie z. B. authentication-order
externe AAA-Authentifizierung festlegen, replizieren Sie den Gerätesystemagenten device-user
und device-user-password
in das AAA-System. Andernfalls generiert der Gerätesystemagent einen Authentifizierungsfehler.
Juniper Junos ZTP neu starten
So löschen (zeroisieren) Sie das Gerät und starten den Juniper Junos ZTP-Prozess neu:
root@leaf3> request system zeroize
Fehlerbehebung bei Juniper Junos ZTP
Im ZTP-Modus lädt der Juniper Switch die ztp.py
Dateien in ztp.json
das /var/preserve/apstra
Verzeichnis herunter. Für die Diagnose notieren Sie sich die /var/preserve/apstra/aosztp.log
Datei.
Weitere nützliche Meldungen finden Sie in /var/log/messages
(Suchen nach "ztp").