What Is Needed to Make a NETCONF Script Work on IOS XE?
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? - 
Community Votes
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)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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 →