AutomationGlobal Config

netconf-yang

Enables NETCONF-YANG on the device, allowing programmatic configuration and state retrieval using YANG data models over SSH.

Syntax·Global Config
netconf-yang

When to Use This Command

  • Automating device configuration with Ansible or Python scripts using NETCONF.
  • Collecting operational state data (e.g., interface statistics, routing table) via YANG models for monitoring.
  • Implementing a centralized network management system that uses NETCONF for configuration management.
  • Performing compliance checks by comparing device state against YANG-defined models.

Command Examples

Enable NETCONF-YANG with default SSH port

netconf-yang

This command enables NETCONF-YANG on the device using the default SSH port 830. No output is displayed upon successful configuration.

Verify NETCONF-YANG status

show netconf-yang status
NETCONF-YANG status: enabled
SSH port: 830
Session count: 2
Active sessions:
  Session ID: 1, User: admin, Source IP: 192.168.1.100, State: established
  Session ID: 2, User: netops, Source IP: 10.0.0.50, State: established

The output shows that NETCONF-YANG is enabled, listening on port 830, with two active sessions. Each session shows the session ID, username, source IP, and state (established indicates an active NETCONF session).

Understanding the Output

The 'show netconf-yang status' command provides a quick overview of the NETCONF-YANG service. The first line indicates whether the service is enabled or disabled. The SSH port line shows the TCP port used for NETCONF sessions (default 830). Session count shows the total number of active NETCONF sessions. The active sessions table lists each session with its ID, the username that authenticated, the source IP address of the client, and the session state (typically 'established' for active sessions). A healthy device will show 'enabled' and have sessions in 'established' state. If the service is disabled, no sessions will be listed. Watch for sessions in 'closing' or 'idle' states, which may indicate issues.

CCNA Exam Tips

1.

CCNA exam tip: NETCONF uses SSH port 830 by default, not port 22.

2.

CCNA exam tip: YANG is a data modeling language, while NETCONF is the protocol that uses YANG models.

3.

CCNA exam tip: The 'netconf-yang' command is entered in global configuration mode; no additional parameters are required for basic enablement.

4.

CCNA exam tip: NETCONF operations include <get>, <get-config>, <edit-config>, and <delete-config>.

Common Mistakes

Mistake: Forgetting to enable NETCONF-YANG before attempting to use it; sessions will fail to establish.

Mistake: Confusing NETCONF with RESTCONF; NETCONF uses SSH, RESTCONF uses HTTP/HTTPS.

Mistake: Not configuring SSH server or AAA authentication before enabling NETCONF, causing authentication failures.

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions