Backing up your device configuration using NAPALM
With our vendor-agnostic functions, we can also carry out common backup tasks with ease. For instance, let's assume, before a big change, you want to back up all the configurations on your devices. NAPALM offers a very convenient way of retrieving not only the running configuration but also the starting and candidate configurations of your devices. In this recipe, we are going to explore how to use this ability to easily retrieve full configurations from a device to create backups.
Getting ready
Open your code editor and create a file called backup_config.py
. Next, in your Terminal, navigate to the same directory that you just created the backup_config.py
file in.
How to do it…
The following steps demonstrate how to connect to a device, read the different types of configurations, and then write them to a file:
- Import the
napalm
module:import napalm
- From the
napalm
module, retrieve the appropriate...