This cross-platform Python script helps you find a MAC address on your Cisco switches or any other vendor that has a similar MAC table format as Cisco.
Use the included YAML
file to define different data centers, floors, etc. so that the program stops looking inside other data centers or floors upon finding a MAC address. There is no limit on the number of sites or devices that you define, everything will be handled dynamically.
For your convenience, it takes a MAC address in any notation (Linux
, Windows
, Cisco
) and automatically converts it to Cisco format.
Netmiko
and PyYAML
are required to run this script. You can install them using below command.
pip3 install -r requirements.txt
For starters, you need to populate the YAML
file with your switch names, their corresponding IP addresses and ports like below example:
France-DC:
- name: FR-SW-TOR-R1-Rack1
mgmt_ip: 172.16.16.1
port: 22
- name: FR-SW-TOR-R2-Rack2
mgmt_ip: 172.16.16.2
port: 22
Germany-DC:
- name: DE-SW-TOR-R1-Rack1
mgmt_ip: 172.18.18.1
port: 222
- name: DE-SW-TOR-R2-Rack2
mgmt_ip: 172.18.18.2
port: 222
Make the script executable:
chmod +x CiscoMacFinder.py
./CiscoMacFinder.py <MAC Address>
For example:
./CiscoMacFinder.py 8041.a473.453b
OR
./CiscoMacFinder.py 80:41:a4:73:45:3b
OR
./CiscoMacFinder.py 80-41-a4-73-45-3b
OR
python3 CiscoMacFinder.py <MAC Address>
For example:
python3 CiscoMacFinder.py 8041.a473.453b
OR
python3 CiscoMacFinder.py 80:41:a4:73:45:3b
OR
python3 CiscoMacFinder.py 80-41-a4-73-45-3b
IOS and IOS-XE.
Pull requests are welcome.