Avanzato automation
Comando Cisco restconf / netconf : Come Abilitare RESTCONF e NETCONF?
Il comando restconf e netconf-yang abilita API programmabili su IOS-XE. Permette automazione con Python, Ansible e Postman invece di CLI.
{ } Sintassi
restconf / netconf
! Abilita NETCONF e RESTCONF
netconf-yang
restconf
ip http secure-server
ip http authentication local
username admin privilege 15 secret Cisco123!
! Verifica
show netconf-yang datastores
show netconf-yang sessions
show platform software yang-management process>_ Verifica - Output
R1# show netconf-yang datastores
Datastore Name : running
Datastore Name : candidate
Datastore Name : startupR1# show netconf-yang sessions
R1# ! Nessuna sessione attivaR1# show platform software yang-management process
confd : Running
nesd : Running
syncfd : Running
ncsshd : Running
dmiauthd : Running
nginx : Running
ndbmand : Running
pubd : Running! RESTCONF su https://192.168.1.1/restconf/data/
! Errore Comune
⚠ http secure-server non abilitato - RESTCONF non risponde
Se abiliti restconf senza ip http secure-server, API non raggiungibile su HTTPS, errore 404 su Postman.
Fix: ip http secure-server + ip http authentication local + username ... privilege 15 secret ... + restconf + netconf-yang. Verifica show platform software yang-management process tutti Running.
✦ Trasparenza AI: uso strumenti AI per bozze, schemi e immagini. Ogni contenuto lo revisiono, testo i comandi in laboratorio e lo riscrivo con la mia esperienza in classe prima di pubblicarlo. La responsabilità di quello che leggi è mia.

