skip to content

NETCONF

Configuration as a transaction instead of CLI keystrokes: XML RPCs over SSH against running and candidate datastores, with YANG defining what is valid. Automation interviews lean on it.

on this pageshow

explore

questions

page 1 of 2

In NETCONF, what do the running, candidate and startup configuration datastores each hold, and which one must every device have?

level: juniorimportance: must knowfreq 28%

answer

  1. one live, one draft, one for boot
  2. the base model has exactly one
  3. capabilities add the other two
  4. :candidate and :startup capability URIs

basics

~20 s

Running holds the configuration in use now and is the only datastore every NETCONF device has. Candidate is an optional full working copy you edit and then commit; startup is an optional copy loaded at boot.

solid answer

~40 s

RFC 6241 defines a configuration datastore as the complete set of configuration needed to take a device from its default state to the desired one. `<running>` is the configuration currently active, and it is the only datastore the base model guarantees. `<candidate>` exists only when the server advertises `:candidate`: it is a full configuration you can change without touching the device, and a `<commit>` makes running equal to it. `<startup>` exists only with `:startup`: it is what the device loads at boot, and changes to running are not copied there automatically, so you save with `<copy-config>` from running to startup. A client reads the server's `<hello>` capabilities to learn which of the three it can use.

go deeper

for a junior

Recall the three names, that running is the only one always present, and that candidate and startup appear only when the server advertises :candidate or :startup.

for a middle

Explain how the datastores relate: edit candidate, commit to running, copy running to startup, and boot loads startup into running. Know that each datastore is a full configuration.

for a senior

Show that you check the server hello before choosing a workflow, and that you know an unsaved change on a :startup device is undone by a reboot, which is both a risk and a recovery path.

for a principal

Discuss how an automation platform should model devices that expose different datastore sets, and why the RFC 8342 architecture later added intended and operational to the original three.

## What a configuration datastore is NETCONF (RFC 6241, which obsoletes RFC 4741) separates *where* configuration lives from *how* you change it. A **configuration datastore** is, in the RFC's words, the complete set of configuration data required to get a device from its initial default state into a desired operational state. Two consequences follow straight from that definition: - A datastore is a **whole configuration**, not a list of pending changes. - A configuration datastore holds **no state data** such as counters or learned neighbours, and no executive commands. Protocol operations name the datastore they act on with an empty element: `<running/>`, `<candidate/>` or `<startup/>` inside a `<source>` or `<target>` parameter. ## The three datastores of RFC 6241 | Datastore | What it holds | Present when | How it changes | |---|---|---|---| | `<running>` | the configuration active on the device right now | always; exactly one exists | `<edit-config>` or `<copy-config>` if `:writable-running` is advertised, or a `<commit>` from the candidate | | `<candidate>` | a full working copy that does not affect the device | the server advertises `:candidate` | `<edit-config>`, `<copy-config>`; reset by `<discard-changes>` | | `<startup>` | the configuration loaded when the device boots | the server advertises `:startup` | `<copy-config>` from running to startup | The base model has **only `<running>`**. RFC 6241 Section 5.1 says additional datastores may be defined by capabilities and exist only on devices that advertise them; Sections 8.3 and 8.7 define candidate and startup that way. RFC 8342, the datastore architecture, adds that running does not even have to be writable: a device may expose running for reading and accept changes only through the candidate. ## How a client learns what exists Each peer sends a `<hello>` listing its capabilities as URIs when the session opens. The three datastore-related ones are: 1. `urn:ietf:params:netconf:capability:writable-running:1.0` - running can be the target of `<edit-config>` and `<copy-config>`. 2. `urn:ietf:params:netconf:capability:candidate:1.0` - the candidate datastore exists, and so do `<commit>` and `<discard-changes>`. 3. `urn:ietf:params:netconf:capability:startup:1.0` - running and startup are distinct, and saving is an explicit step. A client that skips this check and assumes a candidate will find `<commit>` unavailable on a device that never advertised `:candidate`. ## How the datastores relate RFC 8342 draws the original NETCONF model as three boxes with running in the middle: 1. The client edits `<candidate>`; nothing on the device changes yet. 2. `<commit>` sets `<running>` to the candidate's contents, and the device starts behaving accordingly. 3. `<copy-config>` with running as source and startup as target saves the result. 4. At boot, the device loads `<startup>` into `<running>`. RFC 8342 also says how the copies behave across a reboot: the candidate does not typically persist, and if it is kept in non-volatile storage it is reset to the contents of running at boot. A device with no distinct startup will typically use non-volatile storage so that running itself persists, which is an implementation choice rather than a protocol step. ## Common confusions - **"Candidate holds my diff."** It holds a full configuration, so a commit makes running equal to everything in it, including edits another session left there. - **"Changing running updates startup."** On a `:startup` device, RFC 6241 Section 8.7 says operations that affect running are not automatically copied to startup. - **"Startup is where you stage changes."** Staging is the candidate's job; startup is only what boot loads, and the standard editing model changes it only by copying running into it. - **"Every device has all three."** Only running is guaranteed; candidate and startup are optional and announced. - **"Running includes interface counters."** Counters are state data. The NETCONF `<get>` operation returns running together with state, which is why the two are easy to mix up, but the datastore itself is configuration only. ## Why the split matters to an operator The set of datastores a device advertises decides how a change can be pushed safely. With a candidate, a large change can be assembled, checked and applied in one step. With only a writable running datastore, every edit is live the moment it is accepted. With a distinct startup, a change that was never saved is undone by a reboot, which is a recovery path as much as it is a trap. Knowing which datastores exist is therefore the first question any NETCONF automation asks of a device.

  • Does the NETCONF candidate datastore survive a device reboot?
    RFC 8342 says the candidate does not typically persist across reboots, even when non-volatile storage is available. If an implementation does store it in non-volatile storage, the candidate is reset at boot to the contents of running. Uncommitted work in the candidate should therefore be treated as lost on reboot.
  • Can a NETCONF device have a candidate but refuse direct writes to running?
    Yes. `:writable-running` and `:candidate` are independent capabilities. A device that advertises `:candidate` without `:writable-running` accepts NETCONF configuration only through the candidate, so over NETCONF a `<commit>` is how running changes. RFC 8342 notes that running does not have to be writable.
  • Why does RFC 6241 keep state data out of the configuration datastores?
    A configuration datastore is defined as the configuration needed to reach a desired state, so it excludes state data and executive commands. That keeps datastores copyable and comparable: copying running to startup copies intent, not counters. State is read with `<get>`, which returns running plus state, or under NMDA from the operational datastore.

Running is the plan on the team's whiteboard that everyone is working from; candidate is a full redraft on a shared flip chart beside it that nobody acts on until someone copies it onto the board; startup is a photo of the board kept for the morning. Redrawing the board does not retake the photo; you have to take it again.

saying these in an interview costs you the question

  • Candidate and startup exist on every NETCONF device.
  • Changing running also updates startup automatically.
  • The candidate holds only the diff waiting to be applied.
  • Startup is the place to stage changes before activating them.
  • The running datastore includes counters and other state data.
open as a page

How does a NETCONF client open a session over SSH, and why does NETCONF run as an SSH subsystem rather than through a shell?

level: juniorimportance: must knowfreq 28%

basics

~20 s

A NETCONF client connects to TCP port 830, authenticates over SSH, opens an SSH session channel and requests the subsystem named "netconf". The subsystem hands the channel straight to the NETCONF server, so no shell prompt or login banner corrupts the XML stream.

open as a page

Why is SNMP mostly used to monitor network devices, while NETCONF is the protocol usually chosen to configure them?

level: juniorimportance: must knowfreq 28%

basics

~20 s

SNMP was designed for cheap polling of counters and status, and standard MIB modules rarely expose writable configuration; NETCONF was designed for configuration, with full-configuration retrieval, staged and validated edits, an all-or-nothing commit and a YANG schema.

open as a page

In NETCONF, how does the candidate workflow of edit, <validate>, then <commit> or <discard-changes> change the running datastore?

level: middleimportance: must knowfreq 22%

basics

~10 s

Edits to the candidate change nothing on the device. <validate> checks the candidate, <commit> sets running to the candidate's entire contents, and <discard-changes> throws the edits away by resetting the candidate to running.

open as a page

In NETCONF, what does a <lock> on a configuration datastore prevent, how long does it last, and what does a competing session get back?

level: middleimportance: must knowfreq 22%

basics

~20 s

A NETCONF <lock> gives one session exclusive write access to a whole datastore until it unlocks or its session ends; other sessions, SNMP and CLI cannot change it, and a competing <lock> fails with lock-denied naming the holder's session-id.

open as a page

In NETCONF, how do <get> and <get-config> differ, and which one should a nightly configuration-backup job call?

level: middleimportance: must knowfreq 18%

basics

~20 s

<get-config> returns only configuration data from a named datastore such as running, candidate or startup; <get> returns the running configuration plus read-only state such as counters. A backup job should call <get-config>, so the archive holds only restorable data.

open as a page

A NETCONF <edit-config> meant only to change an interface's MTU also erased that interface's description; what in the request explains it?

level: middleimportance: must knowfreq 15%

basics

~20 s

The request used replace: an operation="replace" attribute on the interface entry, or default-operation replace. Replace makes the sent data the whole entry, so the omitted description is deleted; merge, the default, would have changed only the MTU.

open as a page

In NETCONF, what do the client and server exchange in their <hello> messages, and how do they settle the protocol version and session-id?

level: middleimportance: must knowfreq 20%

basics

~20 s

Each NETCONF peer sends a <hello> listing its capabilities as soon as the session opens, without waiting for the other. They use the highest base protocol version both list, or stop; only the server's hello carries the <session-id>.

open as a page

How does a NETCONF client learn which YANG modules, revisions, features and deviations a device implements, and what changed with YANG 1.1?

level: middleimportance: must knowfreq 18%

basics

~20 s

YANG 1.0 modules appear in the NETCONF hello as capability URIs carrying module, revision, features and deviations parameters. YANG 1.1 moved the list into the ietf-yang-library data, read with <get>; the hello carries only an identifier that changes when that list does.

open as a page

In a NETCONF subtree filter, how do containment, selection and content-match nodes combine to return one interface's counters and nothing else?

level: middleimportance: must knowfreq 15%

basics

~20 s

Send <get> (counters are state data, which <get-config> never returns) with a subtree filter: interfaces and interface as containment nodes, name with the text eth0 as a content-match node, and an empty statistics element as a selection node.

open as a page

A CI pipeline's NETCONF commit to a router might cut off the pipeline's own management path; how does a confirmed commit protect it, and when does it roll back?

level: seniorimportance: must knowfreq 20%

basics

~20 s

A confirmed commit applies the candidate but reverts running to its prior state unless a confirming <commit> arrives within confirm-timeout (600 seconds by default); it also reverts at once if the issuing session drops, unless <persist> was set.

open as a page

On a NETCONF device advertising :startup, why does a committed change disappear after a reboot, and how do you make it persist?

level: middleimportance: should knowfreq 16%

basics

~10 s

With :startup, the device boots from a separate startup datastore, and changes to running are not copied there automatically. Persist a change with <copy-config> from running to startup, ideally after testing it.

open as a page

Before a NETCONF client edits the candidate datastore and commits it, why should it lock both candidate and running, and what does each lock guard?

level: middleimportance: should knowfreq 12%

basics

~20 s

The candidate is a scratch pad every session may share, and <commit> publishes all of it; locking candidate keeps other sessions' edits out of your commit, and locking running stops anyone changing or committing to running until you finish.

open as a page

When a NETCONF server rejects an <edit-config> with an <rpc-error>, which fields should automation read to decide what failed and where?

level: middleimportance: should knowfreq 8%

basics

~20 s

Automation should branch on error-tag, a fixed string from RFC 6241's Appendix A such as data-exists or invalid-value, refined by error-app-tag, and locate the problem with error-path. error-type gives the layer; error-message is for humans.

open as a page

Why did NETCONF over SSH replace the ]]>]]> end-of-message delimiter with chunked framing, and when does a session use each?

level: middleimportance: should knowfreq 14%

basics

~20 s

The ]]>]]> delimiter assumed that sequence never occurs in well-formed XML, but it can, inside attributes, comments or processing instructions. Chunked framing length-prefixes each chunk instead. Hellos always end with ]]>]]>; chunked framing follows only when both hellos list :base:1.1.

open as a page

How does a YANG data model differ from an SMIv2 MIB module, and why does the difference matter for automating device configuration?

level: middleimportance: should knowfreq 15%

basics

~20 s

SMIv2 describes scalar objects arranged into conceptual tables, with writability as an access level. YANG describes nested configuration trees, marks configuration apart from state, and states constraints and references that the server must enforce before a change is accepted.

open as a page

A NETCONF client meets a device module it has no copy of; how does it find and fetch that module's source from the device itself?

level: middleimportance: should knowfreq 9%

basics

~10 s

The client reads the schemas list of the ietf-netconf-monitoring module (RFC 6022) with <get>, then sends <get-schema> with the module's identifier, ideally its version, and format yang; the reply's <data> holds the module text.

open as a page

Pushing the same 200-line NETCONF change to one router with :candidate and one with only :writable-running, how must the plan differ, and why?

level: seniorimportance: should knowfreq 12%

basics

~20 s

On the :candidate router you stage the change in pieces, validate, and commit it in one step. On the running-only router every <edit-config> is live and must leave running valid, so send the change as one edit after checkpointing running.

open as a page

An operator's script died holding a NETCONF lock on running and the CI pipeline now gets lock-denied; how should the pipeline clear the stale lock safely?

level: seniorimportance: should knowfreq 10%

basics

~20 s

The pipeline takes the holder's session-id from lock-denied, confirms through NETCONF monitoring that the session is really stale, and sends <kill-session>; that releases the lock but does not roll back edits the dead session already made to running.

open as a page

In a NETCONF <edit-config>, why might a cleanup job use operation="remove" rather than "delete", and what does default-operation none add?

level: seniorimportance: should knowfreq 10%

basics

~20 s

delete fails with data-missing when the node is absent; remove deletes it if present and is ignored otherwise, so a retried cleanup stays quiet. default-operation none stops the request's ancestors being merged; they only locate the target.

open as a page

A NETCONF <edit-config> changing twenty interfaces hits an error on the twelfth; what does each error-option value leave in the target datastore?

level: seniorimportance: should knowfreq 7%

basics

~20 s

stop-on-error, the default, aborts at the first error without promising to undo earlier edits; continue-on-error applies what it can and still replies with an error; rollback-on-error, which needs the :rollback-on-error capability, restores the target to its state before the request.

open as a page

A NETCONF client completes SSH login and the hello exchange, sends its first <rpc>, then waits forever for a reply; what framing mismatch explains it?

level: seniorimportance: should knowfreq 9%

basics

~20 s

Framing must follow both hellos: chunked only if both list :base:1.1, otherwise ]]>]]>. A client that switches to chunked on the server's hello alone, or never switches, sends or expects a message end the other side never produces, so one reader waits.

open as a page

An SNMP SetRequest applies its variable bindings atomically, so why is that not enough to roll one VPN change out to forty routers, and what does NETCONF offer instead?

level: seniorimportance: should knowfreq 14%

basics

~20 s

A SetRequest is atomic only within one PDU on one agent, while a fleet change spans many PDUs and devices with no lock, staging or rollback. NETCONF adds per-device locks, validated candidates and self-reverting confirmed commits that an orchestrator coordinates.

open as a page

When does a NETCONF client need an XPath filter instead of a subtree filter, and what must it confirm about the server before sending one?

level: seniorimportance: should knowfreq 8%

basics

~20 s

When selection needs more than exact matches, such as comparisons, functions or conditions elsewhere in the tree. The server must advertise the :xpath capability; then the filter has type xpath, an empty <filter> element and the expression in a select attribute.

open as a page

Your NETCONF automation must push one change to forty routers while operators still run their own scripts; how would you design the locking and confirmed commits around it?

level: principalimportance: should knowfreq 7%

basics

~20 s

Lock running and candidate on each router, load and validate, then confirmed-commit everywhere, test the network, and confirm only when all pass; otherwise cancel. NETCONF gives per-device atomicity and an undo window, not a cross-device transaction.

open as a page

How would you divide configuration and monitoring between NETCONF and SNMP for a router fleet in which a third of the devices offer only SNMP?

level: principalimportance: should knowfreq 10%

basics

~20 s

Configure through NETCONF wherever devices support it, keep a single writer per device, and give SNMP read-only access; poll counters with SNMPv3 across the whole fleet, and accept traps or informs from legacy devices beside NETCONF notifications from the rest.

open as a page

Under the NMDA of RFC 8342, how do the intended and operational datastores differ from running, and why can committed configuration be missing from operational?

level: seniorimportance: nice to knowfreq 6%

basics

~20 s

Running is what clients configured; intended is running after transformations such as template expansion, read-only and validated; operational is what the device actually uses. Configuration for a missing resource stays in running and intended but is absent from operational.

open as a page

When would a NETCONF client use RFC 5717's <partial-lock> instead of <lock>, and what does a partial lock fail to protect?

level: seniorimportance: nice to knowfreq 5%

basics

~20 s

A <partial-lock> locks selected nodes of running so two managers can edit different sections at once; it protects only the nodes its XPath matched at lock time, plus their subtrees, never later-created siblings, reads, or the rest of the configuration.

open as a page

A NETCONF-managed device sits behind NAT and accepts no inbound connections; how does NETCONF call home let a manager reach it, and which roles reverse?

level: seniorimportance: nice to knowfreq 6%

basics

~20 s

With NETCONF call home (RFC 8071) the device opens the TCP connection to the manager, on port 4334 for SSH or 4335 for TLS. Only the TCP role reverses: the device remains the SSH or TLS server and the NETCONF server.

open as a page

How do NETCONF event notifications (RFC 5277) differ from SNMP traps and informs in delivery, content, and recovering events a manager missed?

level: seniorimportance: nice to knowfreq 9%

basics

~20 s

SNMP traps are unacknowledged UDP datagrams sent to configured targets; informs add acknowledgement and retransmission. RFC 5277 notifications flow only after a client subscribes, ride its reliable NETCONF session, carry an eventTime, and can be replayed from a log.

open as a page

showing 1–30 of 32