NETCONF
client → SSH 830 → hello → RPCs → datastores
1. Verify service, route, port and certificate/SSH.
2. Authenticate and inspect capabilities/models.
3. Read a narrow resource.
4. Validate/edit with correct datastore and media type.
5. Confirm reply errors and device state.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
netconf-yangPrimary Commands
Configuration and operational commands for this Topic.
Show Commands
Read-only and diagnostic commands for confirming state, narrowing a fault and interpreting the current boundary.
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.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Target-state verification ladder Verify boundary
NETCONF uses a strict target-state ladder for NETCONF RPC and datastore/effective network state: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.
Step 2 Verification path Verify boundary
Record device, session/RPC message-id, datastore, YANG module/revision and target path; inspect the runtime/control-plane result; then query the selected configuration or operational subtree on the network device through an independent read path and compare it with the versioned intent. For Automation → NETCONF, the evidence must connect the control-plane result to the selected configuration or operational subtree on the network device and explain any gap between desired, controller-reported and consumer-visible state.
Step 3 Where it fails Narrow the fault
Failure analysis for Automation → NETCONF should follow the path through the components: client model → SSH/TLS transport → NETCONF RPC → datastore validation/lock → commit/apply → datastore read-back. Common failure classes include capability mismatch, namespace drift, wrong datastore, lock contention, partial edit semantics and assuming <ok/> shows final device behavior. Before retrying a mutating operation, read current target state using the stable identity device, session/RPC message-id, datastore, YANG module/revision and target path; if state is unknown, stop broad retries.
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.
Subtopics
Go one level deeper into this subject.
NETCONF fundamentals: a client opens an SSH session to port 830, exchanges hello messages with capabilities, then sends XML RPCs such as get-config and edit-config that follow YANG models.
Subtopic SSH TransportNETCONF normally runs over SSH on TCP port 830 as an SSH subsystem, reusing SSH authentication and encryption, such as ssh -s admin@router -p 830 netconf.
Subtopic RPCAn RPC is a NETCONF request in an <rpc> element with a message-id, answered by <rpc-reply> containing data, <ok/> or <rpc-error> with the error type, tag and message.
Subtopic DatastoresNETCONF datastores are separate copies of configuration: running (active), candidate (staged changes) and startup (loaded at boot).
Subtopic runningThe running datastore is the active configuration currently in effect on the device.
Subtopic candidateThe candidate datastore holds staged configuration changes that do not affect the device until a commit copies them to running, letting several edits be applied together or discarded.
Subtopic startupThe startup datastore holds the configuration loaded at boot.
Subtopic getget retrieves both configuration and operational state data, such as interface counters, optionally limited by a subtree or XPath filter.
Subtopic get-configget-config retrieves configuration only, from a chosen datastore such as running or candidate, optionally filtered to part of the YANG tree.
Subtopic edit-configedit-config changes a datastore with an XML payload, using operations like merge, replace, create, delete and remove on specific nodes of the YANG data tree.
Subtopic commitcommit is the NETCONF operation that applies the candidate datastore to running.
Subtopic LockingNETCONF locking (lock and unlock operations) gives one session exclusive access to a datastore while it makes changes, preventing other sessions or users from editing at the same time.
Subtopic NETCONF TroubleshootingTroubleshoot NETCONF by checking it is enabled (netconf-yang on IOS XE) and port 830 reachable, the capabilities in the hello, rpc-error messages, namespaces in the XML payload and the device's YANG model support.
- NETCONF commonly uses SSH/TCP 830 and XML RPCs
- RESTCONF uses HTTPS, HTTP methods and JSON/XML representations
- Capability/model discovery precedes path or payload construction
- Running, candidate and startup semantics depend on server capabilities
- Transport success does not prove authorization, valid YANG paths or transaction success.
python3 -c 'from ncclient import manager'— libraryssh -p 830 <u>@<dev> -s netconf— subsystem- Device capabilities list — features
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
NETCONF (RFC 6241) is a network management protocol for reading and changing device configuration using YANG-modelled XML data. It runs over SSH (TCP 830), supports separate datastores (running, candidate, startup) and transactions, so a set of changes can be validated and committed as a whole.
| Operation | Purpose |
|---|---|
<get> | Configuration and operational state |
<get-config> | Configuration from a datastore |
<edit-config> | Change configuration |
<lock>/<unlock> | Prevent concurrent changes |
<commit> | Apply candidate to running |
<validate> | Check candidate before commit |
from ncclient import manager
with manager.connect(host='r1', port=830, username='admin', password=pw, hostkey_verify=True) as m:
print(m.get_config(source='running', filter=('subtree', '<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/>')))
Mechanics
Automation → NETCONF is owned at runtime by the NETCONF client/server session and the network device datastore implementation. Its durable intent is capability-aware XML RPC intent against explicit running/candidate/startup datastores; the stable identity contract is device, session/RPC message-id, datastore, YANG module/revision and target path. The consumer-visible target is the selected configuration or operational subtree on the network device. The operating invariants are that server capabilities are discovered, namespaces and datastores are explicit, locks/transactions are honored, and RPC success is followed by datastore read-back. Follow the chain of components client model → SSH/TLS transport → NETCONF RPC → datastore validation/lock → commit/apply → datastore read-back and record which layer currently owns truth.
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 NETCONF. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
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.
Quick lookup tables
RESTCONF / NETCONF evidence chain
Configuration, operational state, counters and downstream proof remain separate.
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | show netconf-yang sessions | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | transport/TLS/SSH → authentication/authorization → capabilities/YANG path → RPC/HTTP operation → datastore → device state | application success |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum device, session, message-id, datastore, module/revision, target path, rpc-error/error-tag/error-path, commit result and read-back values.