This script connects to Cisco switches and routers and collects infos and writes them to a CSV. Following info will be collected:
- Device Name / IP Address
- Interface Name
- IP Address of the interface
- Subnet Mask in decimal Format
- CIDR Notation of the IP address
- CIDR Notation of the network address
- Interface Description
- VRF Name the interface belongs to
- UP/Down state of the interface
Warning: The information is mainly gathered of the running config. Interfaces with dynamically assigned (i.e. DHCP) IP addresses will not be collected.
- Works only with IOS based WLCs, AireOS is not supported
- Tested only with IOS 17.3.4c and DNAC 2.2.2.5, use on your on risk
$ git clone https://github.com/Ch1ll3r/cisco-network-gathering.git
Python version 3 and pip3 is required. Creating a dedicated virtual environment is recommended.
Install the virtualenv package:
$ python3 -m pip install virtualenv
Create and activate a new virtual environment:
$ python3 -m venv ./venv
$ source venv/bin/activate
$ python3 -m pip install -r requirements.txt
Add the IP addresses or hostnames you wish to check to the switches.txt file. Add one IP/hostname per line Afterward the script is ready for execution. To execute run following command:
$ python cisco-network-info-gather.py
The script will ask you for username and password to connect to the devices. The credentials are NOT stored.
It will write a csv with following filename: interface_config_info.csv
