This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

Verify_Duplicate_IPv4_Addresses

This repo is for a simple script to verify if a CLI template will create duplicated IPv4 addresses with addresses.
This script will use the Cisco DNA Center APIs to access the device and client inventories.

Installation

The requirements.txt provides the list of Python libraries needed.
The script has been tested on Cisco DNA Center version 1.2.10.

Usage

This script will load the CLI template from the file with the name "configuration_template.txt".

  • This script will:
    • load a file with a CLI configuration that is intended to be deployed to a network device
    • identify and validate the IPv4 addresses that will be configured on interfaces
    • search using the DNA Center inventory database if these IPv4 addresses are configured on any interfaces, regardless the operational state of the interface, if "up" or "down"
    • find if any clients are using the IPv4 addresses
    • determine if deploying the configuration file will create an IP duplicate

Test

You may test this code on the DevNet Cisco DNA Center sandboxes.
Change the config.py file to match the Cisco DNA Center IP address, username and password for your environment.
You will need to update the template file with the desired content.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.