cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1387
Views
5
Helpful
4
Replies

Automatically changing vlans and shut/no shut a port with EEM

Hello! I'm trying to find a way to have EEM or TCL automatically change the vlan and change the enabled or disabled status of a port when an ethernet cable is plugged in. My goal is to have EEM apply the user vlan and voice vlan to the port as well as no shut the port when a cat-5 has been plugged in, and swap to dead vlan and shut when the cable is removed. Is there any way to do this?

 

Edit: Further details are stated below.

My main goal is to use an automated process to monitor the syslog for any changes in the state of a port. I plan to set a variable using TCL to represent a unique signifier of ports getting plugged in or getting unplugged. I will then most likely design 2 applets that will change ports that are connected to UP and on the User/Voice vlan, and ports that are disconnected to DOWN and on the Dead vlan.
I dont know what the most resource efficient way to constantly monitor for these changes would be, and I'm very new to EEM and TCL. Any help would be appreciated, I feel like this could be useful to many people.

4 Replies 4

Honestly at this point all I really need is a command in EEM or TCL that can automatically scan ports every so often, then I'm sure I can find a way to bind it with a separate command/string of commands that change ports to up/down and change vlan, but any information anyone has on this would be incredibly helpful.

Solution is possible, but what is the use case here..if you  keep them default vlan and shutdow, if the device connects back the port in shutdown mode, you hear more complaints about not working.

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Essentially what I'm looking to do with the script is to constantly monitor the switch from the inside so that I can have an automated system watching for a new device getting plugged in or unplugged. We have 802.1x preventing unknown devices from accessing the network, but we mostly worried about making sure that little issues like a port being down can be knocked off the list of possibilities.

Also so that when we set up a new switch, we dont have to manually configure all of the ports, we can just apply the script to the baseline and have the ports configure themselves when we plug devices in. Forgot to mention that.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: