Skip to content

Python script to help find the MAC addresses you're looking for on your Cisco Devices.

License

Notifications You must be signed in to change notification settings

pouriyajamshidi/CiscoMacFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cisco MAC Address Finder

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.

Requirements

Netmiko and PyYAML are required to run this script. You can install them using below command.

pip3 install -r requirements.txt

Usage

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

Run it like

./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

Tested on

IOS and IOS-XE.

Contributing

Pull requests are welcome.

License

License

About

Python script to help find the MAC addresses you're looking for on your Cisco Devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages