Using NETCONF and ncclient to change the starting configuration
Retrieving the running configuration, as we will learn in the following recipes (please refer to the Changing an interface configuration using NETCONF and ncclient recipe), is already a powerful thing to do. But what if we want to overwrite a configuration? Perhaps we want to provide a completely new configuration from a local file or overwrite the starting configuration with our currently running configuration. This is what we are going to explore in this recipe. We'll learn how to use the copy_config()
function from ncclient
to copy the currently running configuration to a file and then copy it over to the starting configuration.
Getting ready
Open your code editor and create a file called change_starting.py
. Next, in your Terminal, navigate to the same directory that you just created the change_starting.py
file in.
You'll also need the login information of a networking device that supports the NETCONF...