What Is Needed to Make a NETCONF Script Work on IOS XE?

NETCONF and Device Programmability

Refer to the exhibit. An engineer deploys a script to retrieve the running configuration from a NETCONF-capable Cisco IOS XE device that is configured with default settings. The script fails. Which configuration must be applied to retrieve the configuration using NETCONF? - image

  1. print (netconf_host.get_config(‘show running’))
  2. port=830 Source Reference Answer
  3. device_params=(‘name’:’los-xe’})
  4. hostkey_verify=True,

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests your knowledge of NETCONF transport defaults: NETCONF uses port 830, not the default SSH port 22. The trap is to focus on the RPC call syntax while overlooking the connection-level port parameter.

For a NETCONF-capable Cisco IOS XE device, the default communication port is TCP 830. The community consensus confirms that adding port=830 to the ncclient connection is the correct fix for a failing script.

Choosing A because `get_config('show running')` appears to be a valid NETCONF retrieval call. In reality, the script already contains a `get_config` call, and the failure is caused by the missing `port=830` in the `manager.connect()` statement; additionally, `get_config` expects a datastore name like `'running'`, not a CLI command.

Community Discussion (5 comments)

chiacche 👍 1 Selected: B
NETCONF typically operates over port 830, which is the default port for NETCONF on Cisco devices. Port 22 is typically used for SSH.
supershysherlock 👍 2
B is correct. Typical defaults for a NETCONF-capable Cisco IOS XE device: XML as the data encoding format. Port 830 for NETCONF communication. The "admin" user for authentication by default. SSH as the transport protocol for secure communication.
FrankYaan1980 👍 2
why it is not A?
teems5uk 👍 3 Selected: B
B. port=830 NETCONF typically uses port 830 for communication.
peugeotdude 👍 2
As per Cisco, Netconf uses SSH but defaults to port number 830 https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1612/b_1612_programmability_cg/configuring_yang_datamodel.pdf NETCONFuses a simple RemoteProcedure Call (RPC) based mechanism to facilitate communication between a client and a server. The client can be a script or application running as part of a network manager. The server istypically a network device (switch or router). It usesSecureShell (SSH) asthe transport layer across network devices. It uses SSH port number 830 as the default port. The port number is a configurable option.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

B is correct because NETCONF operates over TCP port 830 on Cisco IOS XE devices by default. The ncclient Python library needs port=830 explicitly in the manager.connect() call when the device is not listening on the library's default port. Community comment [1] and [4] both emphasize that NETCONF uses port 830, while port 22 is used for standard SSH.

Why the Other Options Are Wrong

Option A is incorrect because it modifies the RPC call, not the connection setup; the script already calls get_config(). Option C is malformed Python and the device_params dictionary should be valid, but it does not address the port issue. Option D sets hostkey_verify=True, which requires a known host key and is not the default setting needed to make the initial NETCONF connection succeed; in fact, hostkey_verify=False is often used in lab environments.

Community Comment Notes

Comment [2] lists the Cisco IOS XE NETCONF defaults: XML encoding, port 830, "admin" user, and SSH transport. Comment [3] provides a Cisco documentation link showing that NETCONF uses SSH and defaults to port 830. Comment [5] asks why option A is not the answer, which is well explained by the fact that the connection fails before any RPC call is made.

Official Reference

Exam Strategy

When a NETCONF script fails, always inspect the manager.connect() parameters before worrying about RPC syntax. Remember that Cisco IOS XE NETCONF uses TCP port 830 by default, so if the script does not specify port=830, that is likely the missing configuration.

Related Analysis

Practice All 350-401 Questions

Access 218 questions with complete answers and detailed explanations.

View Full 350-401 Practice Test →

← Back to 350-401 Study Guide