Skip to content

al-joshua/Cisco_Devnet_Marathon_Day2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cisco Devnet Marathon Day2

Task

The task is to write a script which searches for an endpoint mac address in a network. Network is a random topology representing layer 2 domain with a bunch of clients connected to it. Client is considered to be any endpoint connected to the switch's any untagged interface (access) or an SVI belonging to a switch itself. The script has to take a mac address as an input and return the switch and corresponding interface name where the requested endpoint mac address is connected to.

Script description

Solution uses nornir framework and its scrapli ssh client integration in particular. Script collects some show commands outputs form a device, parses it via textfsm to get structured data and performs a search action.

You need to install the requirements first.

pip install -r requirements.txt

To run the script you need to provide the desired mac address as an argument. The format of the argument is strict - xxxx.yyyy.zzzz lower case (Cisco mac address-table address format). The script does not perform mac format normalization as it is out of scope of the task. However it would be a good thing to have in general.

python mac_address_search.py d89d.6714.cfd4

result:

MAC Address d89d.6714.cfd4 is connected to switch SW3 interface Gi1/0/5

About

Tool searches for an endpoint MAC address in a network

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages