Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cisco-en-programmability/dnacenter_ip_address_conflict_prevention
This repo includes sample code to prevent the configuration of new IP addresses that may create IP address conflicts. It will use Cisco DNA Center REST APIs.
https://github.com/cisco-en-programmability/dnacenter_ip_address_conflict_prevention
Last synced: 25 days ago
JSON representation
This repo includes sample code to prevent the configuration of new IP addresses that may create IP address conflicts. It will use Cisco DNA Center REST APIs.
- Host: GitHub
- URL: https://github.com/cisco-en-programmability/dnacenter_ip_address_conflict_prevention
- Owner: cisco-en-programmability
- License: other
- Created: 2019-12-10T21:57:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T22:47:07.000Z (over 3 years ago)
- Last Synced: 2024-08-03T20:02:10.339Z (4 months ago)
- Language: Python
- Size: 43 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-cisco-dnac - dnacenter_ip_address_conflict_prevention
README
# Cisco DNA IPv4 Address Conflict Prevention
This Python script will verify if the use of an IPv4 Address will create a duplicated IPv4 address.
**Cisco Products & Services:**
- Cisco DNA Center
**Tools & Frameworks:**
- Python environment
**Usage**
This sample script will:
- ask user to input the file name with the CLI template to be configured
- validate the provided file name exists
- open the file
- select the IPv4 addresses to be configured on interfaces
- validate if the selected IPv4 addresses are valid IPv4 addresses
- Verify if the IPv4 addresses are:
- Used by a network device
- Used by a client
- Reachable
- deploying the configuration template will create an IPv4 address conflict if any of the above validations fail for one IPv4 addressExecute the script:
$ python ip_conflict_prevention.py
*Sample output:*
Start of Application "ip_conflict_prevention.py" Run
Input the CLI Template file name (example - "config.txt"): cli_template.txtThe CLI template:
!
interface Loopback65
ip address 10.93.130.21 255.255.255.255
!
interface Loopback200
ip address 10.93.141.67 255.255.255.255
!
interface Loopback201
ip address 10.93.140.35 255.255.255.255
!
interface Tunnel201
ip address 10.93.130.19 255.255.255.252
tunnel source Loopback200
tunnel destination 10.93.140.48
keepalive
!
router eigrp 123
network 10.93.140.49 0.0.0.0
!
router eigrp 201
network 10.93.140.46 0.0.0.0
redistribute static route-map REMOTE_ACCESS
exit
!The CLI template will configure these valid IPv4 addresses:
['10.93.130.21', '10.93.141.67', '10.93.140.35', '10.93.130.19']The IPv4 address 10.93.130.21 is used by this device PDX-M , GigabitEthernet0/0
The IPv4 address 10.93.141.67 is used by this device AP682C.7B4C.0510 ,
The IPv4 address 10.93.140.35 is not used by any network devices
The IPv4 address 10.93.140.35 is used by a clientThe IPv4 address 10.93.130.19 is not used by any network devices
The IPv4 address 10.93.130.19 is not used by a client
The IPv4 address 10.93.130.19 is not reachableDeploying the template config.txt will create an IP address conflict
End of Application "ip_conflict_prevention.py" Run
Process finished with exit code 0
**License**
This project is licensed to you under the terms of the [Cisco Sample Code License](./LICENSE).