300-435 Question 78
Select 3You are tasked with creating a Python script to configure an interface on a Cisco router using ncclient and NETCONF. Which of the following steps are required to successfully achieve this?
- A
Establish an SSH connection to the device using ncclient's manager.connect method.
- B
Construct an XML payload containing the interface configuration details.
- C
Use the manager.get_config method to send the XML payload to the device.
- D
Invoke the manager.edit_config method to apply the configuration payload.
- E
Validate the NETCONF session by sending a ping to the device's IP address.
Show answer and explanation
Correct answers: A, B, D
Explanation
To configure an interface using NETCONF and ncclient, you must first establish an SSH connection to the device with ncclient's manager.connect. Then, you need to construct an appropriate XML payload containing the configuration details. Finally, you apply the configuration using the manager.edit_config method. The manager.get_config method is irrelevant for applying configurations, and validating the session with a ping is not a standard NETCONF operation.
- A. Correct.
Correct. Establishing an SSH connection using ncclient's manager.connect method is the first step to interact with the device via NETCONF.
- B. Correct.
Correct. Constructing an XML payload is essential since NETCONF relies on XML for data exchange to configure and manage devices.
- C. Incorrect.
Incorrect. The manager.get_config method is used to retrieve the configuration or state data, not to send configuration changes.
- D. Correct.
Correct. The manager.edit_config method is used to apply configuration changes to the device using the XML payload.
- E. Incorrect.
Incorrect. Sending a ping to validate the NETCONF session is not a required step; NETCONF sessions use XML messages for communication and validation.