CNPE study materials
CNPE study resources

CNPE: Network Automation and Programmability

CNPE · Work through your exam, one topic at a time.

All guide sections

Network Automation and Programmability

The Network Automation and Programmability domain tests whether you can treat the network as data: model it, push it idempotently, and prove it in version control.

Interfaces and models

  • NETCONF runs over SSH on TCP 830 and uses YANG models; key operations are get-config, edit-config, and candidate with confirmed-commit for automatic rollback. It is not HTTP.
  • RESTCONF is HTTP-based with JSON or XML bodies. POST creates (201), PUT replaces, PATCH merges, DELETE returns 204, 401 means bad or expired credentials, 404 means the path or YANG module is wrong.
  • gNMI over gRPC streams telemetry on change; SNMP polling cannot scale to thousands of counters per second.
  • YANG is the schema; an instance is data conforming to it. Confusing model with instance is a classic error.

Tooling patterns

  • Ansible is agentless, pushes over SSH or network_cli, and is idempotent, so a correct playbook reports changed=0 on the second run. Keep secrets in vault or an external store, never in plaintext inventory.
  • Terraform is declarative with a state file; always plan before apply.
  • Jinja2 templates plus a source of truth (IPAM or CMDB) beat hand-edited configuration. Git branches and pull requests give review and rollback.

Worked example

A nightly playbook that sets NTP always reports changed=3 even when nothing changed. The template embeds the run timestamp in a banner, so every run rewrites that block: the task is imperative in disguise. Remove the volatile value, or use a resource module that compares intent against device state, and the second run reports changed=0. Idempotency is a property you test, not one you assume.

Traps that cost marks

Treating NETCONF as an HTTP API. Assuming a green playbook means the device matches intent - without a post-change read-back you have no proof. Storing secrets in Git. Skipping the diff or plan step. Automating a broken manual process, which only scales the breakage.