What Does NETCONF Mean?
On This Page
Quick Definition
NETCONF is a way for network engineers to talk to routers, switches, and firewalls using commands that are structured like XML, making automation easier. Unlike older methods that use typed commands, NETCONF uses a clear, tree-like structure to organize device settings. This helps in managing many devices at once and reduces errors from manual entry.
Commonly Confused With
RESTCONF is a companion protocol to NETCONF that uses RESTful principles and HTTP/HTTPS instead of SSH. RESTCONF supports both XML and JSON, while NETCONF uses XML exclusively. NETCONF has more robust transaction handling (candidate datastore, confirmed-commit) than RESTCONF.
If you are building a web app to manage a network, you might use RESTCONF because it uses HTTP methods like GET and POST. If you need to prepare configuration changes offline and commit them safely, use NETCONF.
SNMP is primarily for monitoring and retrieving statistics from network devices. It uses MIBs and OIDs to organize data. NETCONF is for configuration management and uses XML and YANG. SNMP does not support transactional rollback or candidate configurations.
Use SNMP to check how much bandwidth an interface is using. Use NETCONF to change the IP address of that interface.
SSH gives you a command-line interface (CLI) where you type text commands. NETCONF also uses SSH but sends structured XML commands. The CLI is human-readable but error-prone for automation. NETCONF is machine-readable and allows scripting across many devices.
Typing 'configure terminal' and 'ip address 10.0.0.1 255.255.255.0' via SSH is CLI. Using NETCONF, you send an XML <edit-config> with the same information in a structured way.
gNMI is a newer protocol that uses Protocol Buffers instead of XML. It is designed for high-performance telemetry and configuration. NETCONF is older and more widely supported. gNMI is often used in open networking and cloud-scale environments.
If you need to stream high-frequency telemetry from a data center switch, gNMI may be better. If you are configuring enterprise routers, NETCONF is more common.
Must Know for Exams
NETCONF appears in several major certification exams. For Cisco, it is covered in the CCNP Enterprise (350-401 ENCOR) and CCNP Service Provider exams. In the ENCOR exam, NETCONF is part of Objective 6.
1 which covers automation and programmability. Candidates must understand the difference between NETCONF and RESTCONF, the role of YANG models, and how to use NETCONF for device configuration and retrieval. Cisco also tests the concept of NETCONF datastores (running, candidate, startup) and the <edit-config> operation with its various merge, replace, create, delete, and remove attributes.
For Juniper, the JNCIA-Junos exam covers NETCONF as part of the Automation and DevOps section. Juniper uses NETCONF extensively in its Junos OS. They test the use of the NETCONF XML API and how it relates to the Junos XML configuration hierarchy.
The exam may ask about the <load-configuration> operation which is Juniper's way of using NETCONF. In CompTIA Network+, NETCONF appears in a lighter way, usually as a comparison with SNMP. The exam wants you to know that NETCONF is more modern, uses XML, and is better for configuration tasks.
For the Microsoft Azure Administrator (AZ-104), NETCONF is relevant when managing Azure networking resources, especially with Azure Network Watcher and Azure Automation. It is not a major topic but appears in context of using Azure CLI or PowerShell to automate network settings. In the AWS Certified Advanced Networking - Specialty exam, NETCONF is mentioned in the context of hybrid networking and automation of on-premises devices.
It may appear in questions about integrating on-premises routers with AWS Direct Connect and using NETCONF to configure BGP parameters. For the Linux Professional Institute (LPI) DevOps Tools Engineer exam, NETCONF is part of the Infrastructure as Code and Configuration Management objectives. The exam tests the ability to write Ansible playbooks that use the netconf_connection plugin.
In all these exams, the typical question patterns include: identifying the correct NETCONF operation for a given task, selecting the proper datastore, understanding the role of YANG, and diagnosing why a NETCONF session failed. Questions may present a scenario where a network engineer tries to push a configuration change but the device rolls back. Candidates need to know that the confirmed-commit timer expired without a confirmation.
Another common trap involves mixing up NETCONF and RESTCONF. NETCONF uses XML exclusively, while RESTCONF supports both XML and JSON over HTTP or HTTPS.
Simple Meaning
Think of NETCONF as a universal remote control for a smart home system. Instead of walking up to each device, like a light bulb, thermostat, or door lock, and pressing buttons individually, you use one remote that sends clear, structured commands. Each command says exactly what to do, such as "set thermostat to 72 degrees" or "turn off all lights."
The device understands the command because it follows a strict format, like a recipe. NETCONF does the same for network equipment. It uses a language called XML, which is like a set of labeled boxes.
One box might say "interface name = GigabitEthernet0/1," another says "IP address = 192.168.1.1," and another says "subnet mask = 255.255.255.0." The device reads these boxes and applies the settings.
This is much better than older methods like SSH or Telnet, where you type messy text commands and hope the device understands. With NETCONF, the commands are precise, and the device can confirm it received them correctly. It also keeps a copy of the running configuration, so you know what is actually set.
This is especially useful when you have to configure hundreds of devices at once. You can send the same set of XML commands to all of them, and they will all apply the settings the same way. It also supports rollbacks, if something breaks, you can undo the changes easily.
NETCONF is not just for making changes. It can also ask a device for its current settings or for statistics like bandwidth usage. It does this using operations like "get" and "get-config."
These operations are like asking the device: "Show me your current configuration" or "Tell me how much traffic you see on port 10." Because everything is structured, a program can read the answers and do something useful, like adjusting settings automatically when traffic gets heavy.
Full Technical Definition
NETCONF, defined in RFC 6241 by the IETF, is a network management protocol that uses a client-server architecture. The NETCONF client (often a network management system or automation script) communicates with a NETCONF server (the network device) typically over SSH (port 830). The protocol operates on a remote procedure call (RPC) paradigm, where the client sends an XML-encoded operation and the server responds with XML-encoded data.
The fundamental operations include <get>, <get-config>, <edit-config>, <copy-config>, <delete-config>, <lock>, <unlock>, <close-session>, and <kill-session>. The <get> operation retrieves both running configuration and operational state data. <get-config> retrieves configuration data from a specified datastore.
<edit-config> allows creating, modifying, or deleting configuration data with operations like merge, replace, create, delete, and remove. NETCONF introduces the concept of datastores, which are logical repositories for configuration. The standard datastores are "running" (the active configuration), "candidate" (a working copy that can be edited without impacting the running configuration), and "startup" (the configuration loaded at boot).
Devices may also support operational state datastores. NETCONF uses capabilities to negotiate features. Upon session establishment, the server sends a list of capabilities in its <hello> message.
The client then knows which features, like candidate configuration or confirmed-commit, are supported. A key feature is the confirmed-commit capability, which allows the administrator to commit changes with a timeout. If the commit is not confirmed within the timeout, the device automatically rolls back to the previous configuration.
This prevents accidental lockouts. NETCONF also supports event notifications via RFC 5277, enabling the server to send asynchronous alerts to the client. The protocol's transport layer is required to provide authentication, data integrity, and encryption.
SSH is the most common transport, but BEEP and TLS are also specified. The data models used with NETCONF are defined in YANG (RFC 6020), which describes the structure and constraints of configuration and state data. YANG models define what can be configured, the data types, and relationships between elements.
In real-world implementation, platforms like Cisco IOS-XE, Juniper Junos, Arista EOS, and open-source tools like OpenDaylight use NETCONF. It is foundational for software-defined networking (SDN) and network automation because it allows programmatic, idempotent, and error-checked device management. NETCONF is more reliable than SNMP for configuration because it provides transaction-like semantics and validation.
Real-Life Example
Imagine you run a chain of twenty coffee shops. Each shop has the same equipment: espresso machines, grinders, refrigerators, and registers. When you open a new shop, you need to set up all the equipment exactly the same way as the other shops.
The old way would be to print out a manual for each shop, walk around, and press buttons on each machine one by one. That takes forever and you might forget to set the grinder to the right coarseness. NETCONF is like having a master control app on your tablet.
You open the app, and it shows you a form for each machine. For the espresso machine, you fill in fields like "water temperature = 200°F" and "shot time = 25 seconds." For the refrigerator, you set "target temp = 38°F."
When you hit "apply," the app sends those settings over Wi-Fi to every machine in every shop at the same time. Each machine gets the exact same structured instructions. No typos. No missed steps.
If a machine has a problem, it sends back an error saying "I don't have a water temperature setting." That is like NETCONF's error reporting. Also, you can ask the app: "Show me the current temperature of all refrigerators."
It will poll each refrigerator and give you a neat report. If you need to change the shot time for all espresso machines because you got new beans, you just update that one field in the app and send it again. The old settings are replaced cleanly.
If a new hire accidentally sets a refrigerator to 50°F, you can tell the app to "revert", to go back to the last safe configuration. That is the rollback feature. Without NETCONF, you would have to SSH into each device, type the same commands twenty times, and hope you did not make a mistake.
With NETCONF, you automate everything.
Why This Term Matters
In modern IT, networks are no longer small. They can have thousands of routers, switches, firewalls, and wireless controllers spread across data centers and branch offices. Manually configuring each device using command-line interfaces (CLI) is slow, error-prone, and does not scale.
NETCONF matters because it enables automation. A network engineer can write a script that configures a hundred switches exactly the same way in under a minute. This reduces the risk of misconfiguration, which is a leading cause of network outages.
NETCONF also supports auditing and compliance. Because it uses structured data, you can compare the actual configuration of a device against a known-good baseline. If a device drifts from the standard, the automation system can detect it and fix it.
Another reason NETCONF matters is that it is vendor-neutral. The YANG models define how data is structured, so a single automation platform can manage Cisco, Juniper, Arista, and other devices. This is critical for multi-vendor environments.
NETCONF also supports robust change management. The candidate datastore lets you prepare changes without affecting the running system. Then you commit the changes, and if something goes wrong, the confirmed-commit feature automatically rolls back.
This makes it safer to push changes to production. NETCONF is foundational for DevOps and Infrastructure as Code (IaC) in networking. Tools like Ansible, Puppet, and SaltStack use NETCONF to manage network devices.
By treating network configuration as code, organizations can version control their entire network state, review changes in pull requests, and automate testing. This brings network engineering closer to software engineering practices.
How It Appears in Exam Questions
Multiple-choice questions often present a scenario where a network administrator wants to automate the configuration of an interface on 50 switches. The question asks which protocol is best suited, and the answer is NETCONF because it supports structured data and batch configuration. Another common pattern is a question about datastores.
For example: "An engineer is preparing a configuration change. They want to edit the configuration without affecting the currently running system. Which NETCONF datastore should they use?"
The correct answer is the candidate datastore. A variation might ask about committing changes with a safety net: "After making changes to the candidate configuration, the engineer wants to automatically revert if the changes cause a loss of connectivity. Which NETCONF feature should they use?"
The answer is confirmed-commit. There are also questions about specific XML operations. A multiple-choice question might show an XML snippet with <edit-config> and an <operation> attribute of "delete."
The question asks what this will do to the target configuration. The answer is that it will remove the specified configuration nodes. Questions can also test the transport layer. For instance: "Which transport protocol does NETCONF typically use?"
The answer is SSH on port 830. Another variant: "Why is SSH preferred over plain TCP for NETCONF?" The answer: SSH provides authentication, encryption, and integrity. In performance-based questions (labs), you might be given a virtual device and asked to establish a NETCONF session, retrieve the running configuration, and change the hostname using an XML payload.
The lab checks if you can connect and execute the correct operations. In troubleshooting-based questions, a scenario might describe that a NETCONF session is established but the device rejects an <edit-config> operation with an error about capability. The candidate must identify that the client is using an operation the server does not support, such as using confirmed-commit without the server having that capability.
Another troubleshooting scenario: a device fails to apply a configuration change, and the error code indicates a data validation error. The candidate needs to realize that the XML data may violate the YANG model constraints, like a string being too long or an integer being out of range. Essay or short-answer questions (less common but possible in some vendor exams) might ask: "Compare and contrast NETCONF and SNMP for configuration management."
The expected answer includes that NETCONF uses XML structured data, supports transactional semantics (commit/rollback), and is designed for configuration, while SNMP is more for monitoring and uses MIB variables. Finally, some questions combine concepts: "An automation tool uses NETCONF to configure network devices. It defines the data models using a language that describes the structure and constraints.
What is that language?" The answer is YANG.
Practise NETCONF Questions
Test your understanding with exam-style practice questions.
Example Scenario
You are a junior network administrator at a growing company that just opened two new branch offices. Each office has two Cisco switches and one router. The company policy is that all switches must have the same VLAN configuration: VLAN 10 for data, VLAN 20 for voice, and VLAN 30 for management.
The network manager wants you to configure all four switches as quickly and consistently as possible. You have a management workstation with a Python script that uses NETCONF. First, you open a terminal and run the script.
The script connects to each switch over SSH on port 830. The switches are NETCONF servers. After the connections are established, the script sends an XML <hello> message to each switch.
The switches respond with their capabilities, such as support for candidate datastore and confirmed-commit. The script checks the capabilities to ensure it can proceed safely. Next, the script prepares the VLAN configuration in a YANG-compliant XML format.
For each switch, it builds an <edit-config> operation targeting the running datastore. The operation type is "merge" because you want to add VLANs without deleting existing ones. The XML payload includes the VLAN ID, name, and interface assignments.
The script sends the same payload to all four switches. The switches process the XML and apply the changes. They send back a <rpc-reply> with an <ok/> element, meaning the configuration was accepted.
To make sure everything is correct, the script then sends a <get-config> operation to retrieve the running configuration of each switch. It parses the XML response and checks that all three VLANs are present. The output shows VLAN 10, 20, and 30 on every switch.
Because the network manager is cautious, he asks you to use confirmed-commit. So you modify the script to use the candidate datastore instead. You prepare the changes in the candidate datastore, then commit with a 120-second timeout.
The script waits 120 seconds, and if the network stays stable, it sends a <commit> again without the timeout to confirm. If a switch becomes unreachable within those 120 seconds (maybe because the VLAN change accidentally removed the management VLAN), the switch will automatically roll back to the previous configuration. This prevents a total outage.
Later, the manager decides to decommission VLAN 20 in both offices. You write a new script that sends an <edit-config> with operation="delete" for VLAN 20. The switches remove it. You verify with <get-config>.
The entire process takes less than five minutes, and you never touched a command line interface.
Common Mistakes
Confusing NETCONF with SNMP for configuration tasks.
SNMP was designed primarily for monitoring and uses MIB variables, not structured data like XML. It is not transaction-oriented and does not support rollback. Using SNMP for configuration is risky and error-prone.
Remember: for configuration management, use NETCONF (or RESTCONF). For monitoring and alerts, SNMP is acceptable.
Assuming NETCONF only works over HTTPS.
NETCONF typically uses SSH (port 830) as its transport layer. While it can use TLS (HTTPS), that is less common. RESTCONF is the variation that uses HTTPS.
When you see a question about NETCONF transport, think SSH port 830. NETCONF = SSH. RESTCONF = HTTPS (port 443).
Using the wrong operation to modify configuration.
Learners sometimes use <get-config> to try to change configuration, but <get-config> only retrieves data. The correct operation for modifying configuration is <edit-config>.
Use <get-config> only for reading. Use <edit-config> for making changes.
Forgetting to check capabilities before using a feature.
NETCONF devices advertise which capabilities they support. If you try to use confirmed-commit on a device that does not advertise it, the operation will fail.
Always parse the <hello> message capabilities list and verify the required capability is present before using it.
Mixing up the operations in <edit-config>: merge vs. replace vs. create vs. delete.
Using the wrong operation can result in incomplete or unintended configuration changes. For example, using 'replace' instead of 'merge' might delete all existing configuration on that node.
Use 'merge' to add or update existing data. Use 'replace' only when you want to completely overwrite a configuration subtree. Use 'delete' to remove specific nodes.
Not using confirmed-commit when making risky changes.
If you commit a change that breaks network connectivity, you might get locked out of the device. Without confirmed-commit, there is no automatic rollback.
Always use confirmed-commit with a reasonable timeout (e.g., 120 seconds) when making changes that could impact reachability.
Exam Trap — Don't Get Fooled
{"trap":"A multiple-choice question says: 'A network administrator wants to automate device configuration. Which protocol should they use: SNMP or NETCONF?' The answer choices include 'SNMP because it is more widely supported.'
","why_learners_choose_it":"Learners know that SNMP has been around for a long time and is present on almost all devices. They incorrectly assume that wider support means it is better for configuration.","how_to_avoid_it":"Remember that SNMP is a monitoring protocol, not a configuration protocol.
NETCONF was specifically designed for configuration with features like rollback, candidate datastore, and structured XML data. Always choose NETCONF for configuration tasks."
Step-by-Step Breakdown
Session Establishment
The client (network management system) establishes an SSH connection to the device on port 830. This encrypts all subsequent communication. After SSH is established, both parties exchange <hello> messages containing their capabilities. The client learns what datastores, operations, and extensions the server supports.
Retrieve Current Configuration (Optional)
The client may send a <get-config> operation to retrieve the current running configuration from the device. The device responds with XML data representing the configuration tree. This step is useful to understand the baseline before making changes.
Prepare Configuration Change
The client constructs an XML payload for the <edit-config> operation. It specifies the target datastore (e.g., candidate or running) and the operation type (merge, replace, create, delete, remove). The payload contains the exact configuration data in a structured XML tree that conforms to the device's YANG model.
Send <edit-config> Operation
The client sends the <edit-config> RPC to the server over the established SSH session. The server validates the XML against its YANG model. If the data is invalid (e.g., wrong data type, out-of-range value, or missing mandatory nodes), the server returns an error response with a specific error tag and message.
Commit the Configuration (if using candidate datastore)
If the changes were made to the candidate datastore, the client must send a <commit> operation to apply them to the running configuration. Optionally, the client can use the confirmed-commit capability: it sends <commit> with a <confirmed/> and <confirm-timeout> element. The device applies the changes but starts a timer. If the client does not send a confirming <commit> within the timeout, the device automatically rolls back to the previous configuration.
Verify the Configuration
After committing, the client can send another <get-config> operation to retrieve the running configuration and compare it with the intended state. This step ensures the change was applied correctly. It can also use <get> to retrieve operational state data to confirm the device is functioning as expected.
Close the Session
When the configuration work is complete, the client sends a <close-session> operation. This gracefully terminates the NETCONF session and releases any locks on the datastore. The device will close the underlying SSH connection.
Practical Mini-Lesson
NETCONF is more than just a protocol; it is a paradigm shift in how network devices are managed. In practice, a NETCONF workflow starts with understanding the YANG models for the devices you manage. Every network vendor publishes YANG models that define what can be configured.
For example, Cisco publishes the 'openconfig' and 'Cisco-IOS-XE' models. You must locate the correct model for the feature you want to configure, such as interfaces, VLANs, or OSPF. In a production environment, automation engineers write scripts in languages like Python using the 'ncclient' library.
This library handles the SSH connection, session negotiation, and XML construction. A typical script will define a function that takes a device IP, username, password, and a configuration dictionary. It then opens a NETCONF session, locks the candidate datastore (if supported) to prevent others from making changes simultaneously, applies the configuration, commits, and unlocks.
Locks are important because without them, two automated systems could conflict. Another practical consideration is error handling. The XML response from NETCONF includes error severity (error, warning, warning-report), error-tag, and error-message.
For example, if you try to configure an interface that does not exist, you might get an 'invalid-value' error-tag. You script should parse these and retry or fail gracefully. Also, note that NETCONF can be used for transactional configuration.
You can bundle multiple changes in one <edit-config> operation. If any single element fails, the entire operation can be rolled back depending on the device's capabilities. This is far superior to CLI where a typo in the middle of a command sequence can leave the device in a half-configured state.
One thing that can go wrong is using the wrong YANG model or data path. For example, if you use a model for a Catalyst switch on an ISR router, the XML path may not match, causing an error. Always verify the model against the device's capabilities.
Another common issue is forgetting to close sessions. Each open NETCONF session consumes resources on the device. Some devices have a limited number of concurrent sessions. Always implement session cleanup in your scripts, either via <close-session> or by using context managers in Python.
Finally, security is critical. NETCONF uses SSH, but you should use strong keys and avoid passwords where possible. Use SSH keys stored in a secure vault. Also, consider using network management VLANs that restrict NETCONF traffic to trusted management subnets only.
In large environments, use a jump box or a management proxy to centralize access.
Memory Tip
Think: 'NETCONF = NEtwork Configuration over SSH on port 830. YANG defines the data, XML carries the message, candidate datastore is the safe sandbox, confirmed-commit is the safety net.'
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
200-301Cisco CCNA →AZ-400AZ-400 →Related Glossary Terms
802.1X is a network access control standard that authenticates devices before they are allowed to connect to a wired or wireless network.
AAA (Authentication, Authorization, and Accounting) is a security framework that controls who can access a network, what they are allowed to do, and tracks what they did.
An A record is a type of DNS resource record that maps a domain name to an IPv4 address.
Frequently Asked Questions
What port does NETCONF use?
NETCONF standard uses TCP port 830 over SSH. Some implementations may use other ports, but 830 is the official IANA port.
Is NETCONF better than SNMP?
For configuration tasks, yes. NETCONF offers structured data, transactional rollback, and candidate configurations. SNMP is better suited for monitoring and reading operational statistics.
Do all network devices support NETCONF?
No. Many enterprise devices from Cisco, Juniper, Arista, and others support NETCONF, but older devices or low-end consumer-grade equipment may not. You need to check the device's feature set.
Can I use NETCONF over the internet?
Technically yes, but it is not recommended. NETCONF should be used within a trusted management network. Exposing NETCONF to the internet increases security risk. Always use VPN or management tunnels.
What is a YANG model and why does it matter for NETCONF?
A YANG model is a data modeling language that defines the structure and constraints of configuration and operational data. NETCONF uses YANG to validate the XML data you send, ensuring you do not configure invalid parameters.
How do I start learning NETCONF?
Start by studying the RFC 6241. Then practice with a real device or a virtual lab (like Cisco Modeling Labs or EVE-NG). Use the Python ncclient library to write small scripts that retrieve and modify configurations.
What is the difference between <get> and <get-config>?
<get> retrieves both configuration and operational state data (like interface statistics). <get-config> retrieves only configuration data from a specific datastore (like running or candidate).
Summary
NETCONF is a modern network management protocol that makes configuring and managing network devices automated, reliable, and scalable. Unlike older methods like CLI or SNMP, NETCONF uses structured XML data over SSH and leverages YANG models to validate configuration changes before they are applied. It introduces powerful concepts like candidate datastores, where you can prepare changes safely without impacting the running system, and confirmed-commit, which provides automatic rollback if a change causes connectivity loss.
For IT professionals, especially those pursuing certifications in Cisco, Juniper, CompTIA, or cloud networking, understanding NETCONF is essential. Exams test not only the definition but also practical knowledge of operations like <edit-config>, datastore selection, and troubleshooting session failures. In the real world, NETCONF is the backbone of network automation.
It enables Infrastructure as Code, allowing network engineers to version control their configurations, deploy changes across hundreds of devices in minutes, and reduce human error. As networks grow in complexity, the ability to configure them programmatically using NETCONF becomes a non-negotiable skill. The key takeaways for exams are: know the default transport (SSH port 830), the core operations (get, get-config, edit-config, commit), the three main datastores (running, candidate, startup), and the role of YANG models.
Avoid confusing NETCONF with RESTCONF or SNMP, and always check capabilities before using advanced features. With this knowledge, you are prepared to answer exam questions correctly and apply NETCONF in your networking career.