Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

NETCONF (CCNA)

Direct answer

NETCONF is a model-driven configuration protocol: XML RPCs over SSH (TCP 830) read and change YANG-modelled data in datastores (running, candidate, startup), with operations like get, get-config, edit-config, lock and commit.

When to use this

Use it for transactional, model-driven configuration of IOS XE and other devices, or when a NETCONF session or edit fails.

First 30 seconds

1. show netconf-yang status — enabled?

2. TCP 830 reachable from the client?

3. User has privilege 15?

4. Capabilities include the model you use?

5. <rpc-error> → read the error-path and fix the payload; read back with get-config.

Operational verification

netconf-yang enabled → SSH on TCP 830 → hello exchanges capabilities → RPC with YANG-modelled XML → device validates and applies → get-config reads back

Failure signatureNETCONF session opens but operations fail

SSH to port 830 works, but get-config/edit-config returns rpc-error or an unknown element.

Possible stored cause: The device does not advertise the needed capability or model, or the request targets the wrong datastore or namespace.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Scope / prerequisiteUse it for transactional, model-driven configuration of IOS XE and other devices, or when a NETCONF session or edit fai…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

SSH to port 830 works, but get-config/edit-config returns rpc-error or an unknown element.

Step 1 Verification & evidence Verify boundary

Verify SSH subsystem/session, capabilities, datastore/target and returned rpc-error messages.

Step 2 Common failure modes Narrow the fault

Capability mismatch, XML namespace/schema error, locked datastore, auth failure or editing wrong target.

Step 3 Troubleshooting workflow Narrow the fault

Focus for this topic: Capability mismatch, XML namespace/schema error, locked datastore, auth failure or editing wrong target.

Step 4 Common mistakes Narrow the fault
  • Editing the running datastore directly when the device supports candidate + commit.
  • Not locking the datastore during multi-step changes.
  • Forgetting netconf-yang on IOS XE, so port 830 never opens.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Enable on IOS XE with netconf-yang (and a privilege 15 user). The client and device exchange capabilities in hello messages — they list supported YANG models. The candidate datastore plus commit gives all-or-nothing changes where supported. Errors come back as <rpc-error> with a path and message.

Key checks
  • show netconf-yang status — agent enabled and port.
  • show netconf-yang sessions — active sessions.
  • show platform software yang-management process — YANG processes running.
  • ssh -p 830 <user>@<device> -s netconf — raw session showing the capabilities hello.
  • Python ncclient: m.server_capabilities — supported models.
ReferenceWhat it is1 section · depth on demand

Concept overview

Model-driven configuration protocol using structured XML RPC operations and datastores over a secure transport.

Key ideas: NETCONF manipulates modeled configuration/state through operations such as get/get-config/edit-config rather than screen-scraping CLI.

ReferenceWhy it matters1 section · depth on demand

Why it matters

NETCONF manipulates modeled configuration/state through operations such as get/get-config/edit-config rather than screen-scraping CLI.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

NETCONF operations and datastores

NETCONF manages configuration as structured data, with operations that behave predictably. RFC 6241 defines:

  • Base operations: get, get-config, edit-config, copy-config, delete-config, lock, unlock, close-session and kill-session.
  • Datastores: running always exists, while candidate and startup are advertised as capabilities.
  • The edit-config operation attribute: merge (the default), replace, create, delete or remove. Delete fails if the data is missing, while remove succeeds silently.
  • Options: test-option (test-then-set, set, test-only) and error-option (stop-on-error, continue-on-error, rollback-on-error).

Success without data returns <ok/>, and failures return a structured <rpc-error>.

Choosing an edit-config operation

GoalOperation
Add or update settings, keep the restmerge
Make a subtree exactly match the payloadreplace
Fail if it already existscreate
Remove, and fail if absentdelete
Remove if presentremove

Safe change patterns

PatternCapabilities needed
Lock → edit candidate → validate → commit → unlock:candidate, :validate
Confirmed commit with automatic rollback:confirmed-commit
Roll back on any error in a single edit:rollback-on-error
Test without applyingtest-option test-only (:validate:1.1)
R1(config)# netconf-yang
R1# show netconf-yang status
R1# show netconf-yang sessions
dev$ python3 - <<'PY'
from ncclient import manager
CFG = '''
<config><native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
  <vlan><vlan-list xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-vlan">
    <id>130</id><name>LAB-2F</name></vlan-list></vlan>
</native></config>'''
with manager.connect(host="10.255.1.21", port=830, username="netadmin",
                     password="<password>", hostkey_verify=False) as m:
    print(m.server_capabilities.__contains__("urn:ietf:params:netconf:capability:candidate:1.0"))
    with m.locked("running"):
        r = m.edit_config(target="running", config=CFG, default_operation="merge")
        print(r.ok)
PY

Reading rpc-error

FieldTells you
error-typeTransport, rpc, protocol or application layer
error-tagThe kind of error: invalid-value, data-exists, data-missing, lock-denied, access-denied
error-pathWhich node caused it
error-messageHuman-readable detail

Check the server's capabilities before relying on candidate or confirmed commits. Many access switches support only the running datastore.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

NETCONF is a protocol for managing device configuration as structured data rather than CLI text. Devices describe their configuration and state using YANG models, and NETCONF can validate a change, apply it as one transaction and roll back if any part fails. That makes automated changes far more predictable than sending CLI commands.

NETCONF (RFC 6241) manages configuration over SSH (TCP 830) using YANG data models, with operations get, get-config, edit-config, commit, lock/unlock and validate.

netconf-yang
! verify
show netconf-yang sessions
ssh -p 830 admin@10.0.0.1 -s netconf
from ncclient import manager
with manager.connect(host="10.0.0.1", port=830, username=u, password=p, hostkey_verify=True) as m:
    print(m.get_config("running").data_xml[:500])

Datastores: running, candidate (commit-based), startup. Transactions make multi-part changes all-or-nothing.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 6241

Authoritative/upstream documentation reviewed for bounded claims in Automation and Artificial Intelligence → NETCONF. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc6241.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Depth when you need it

Deep reference

Design & tradeoffs

ENCOR design tradeoffs

Model-driven protocols improve structure/validation but require understanding data models and transaction semantics.

Confirmation

Confirm action

Continue?