cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

EEM/Tcl script for changing vlan on ports on link down/reboot - read list of ports from a file?

Tommy Vindvik
Level 1
Level 1

Hi everybody!

 

I'm working with a regional public health-care provider in Norway, and we have a total of around ~42k access ports in our different campus networks. Access network consists of 3560/3750/3750-X/3850 and 4500 on different HW and SW levels.

 

Sometimes we se the need to change the vlan on a LOT of ports to get the clients over in another network for one reason or another. To minimize impact for the DHCP-attached clients, I'm looking for some way of doing this on port down event and preferably also on reboot (not all wireing-closets have UPS).

I have not learned to "speak" Tcl yet, and I understand that the file handling in EEM applets is very basic even in EEM v4.

 

So I'm looking for a script that:

  • Reads interface ID and new vlan ID from a file we can upload to flash
  • Changes the vlan id (switchport access vlan XX) to YY AND possibly the voice vlan on interface down event
  • Bonus points for running trough any remaining interfaces on reload
  • Tracks the changes to a logfile
  • One mail after all interfaces in list are completed
  • Triple bonus point for a scipt compatible with older EEM-versions (due to the different HW and SW levels in network).

 

The interface list input file could be constructed anyway needed, but maybe something like this:

Interface<tab>New vlan ID<tab>New Voice vlan   <- Not needed in actual file
FastEthernet1/0/43<tab>100
Gi2/0/38<tab>110
Gi1/43<tab>120<tab>300

And the logfile could be something like:

Interface Fa1/0/43 changed on interface down from vlan id XX to YY dd.mm.yyyy hh:mm:ss
Interface Gi1/43 changed on reload from vlan id XX to YY AND voice vlan ZZ dd.mm.yyyy hh:mm:ss

 

Soooo.....have anyone made/seen such a script, or something like it that could be adapted? Or do anyone Tcl-fluid people feel like helping me out? :) I can't quite imagine that we are the only one seeing the need for such a script?

 

Keeping the faith in the community :)

Tommy V

 

(Edit: Added voice vlan)

Regards, Tommy V
Who Me Too'd this topic