Use it for transactional, model-driven configuration of IOS XE and other devices, or when a NETCONF session or edit fails.
NETCONF (CCNA)
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.
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
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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-yangon IOS XE, so port 830 never opens.
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.
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.
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
operationattribute: 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) anderror-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
| Goal | Operation |
|---|---|
| Add or update settings, keep the rest | merge |
| Make a subtree exactly match the payload | replace |
| Fail if it already exists | create |
| Remove, and fail if absent | delete |
| Remove if present | remove |
Safe change patterns
| Pattern | Capabilities 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 applying | test-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
| Field | Tells you |
|---|---|
| error-type | Transport, rpc, protocol or application layer |
| error-tag | The kind of error: invalid-value, data-exists, data-missing, lock-denied, access-denied |
| error-path | Which node caused it |
| error-message | Human-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.
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.
Deep reference
Design & tradeoffs
ENCOR design tradeoffs
Model-driven protocols improve structure/validation but require understanding data models and transaction semantics.