cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
743
Views
0
Helpful
1
Replies

Create a script to clear mac address - Sticky MACs

RipRoss
Level 1
Level 1

Hi,

 

I am looking to create a CLI application which will run the following command:

 

show port-security address | i <mac>

 

This will return the interface the mac address is on - I want to store this in a variable.. and then use the below command to clear the macs

 

clear port-security dynamic interface <interface>

 

and then shut/no shut the port.

 

Languages:

Powershell

Python

GoLang

 

SSHing to the switches and running the commands is no problem. What i'm struggling with is returning the interface and using it to clear the MAC's on that port.

 

What would be the most suitable method to complete such application?

1 Reply 1

Mohamed Alhenawy
Spotlight
Spotlight
Hello ripRoss,
You can use embedded event manger this ios script
You will creat # event applet manager “name”
# event syslog “xxxxx”
# action cli command 1.0 “xxxx”
# action cli command 2.0 “xxxx”
Etc
Review Cisco Networking products for a $25 gift card