Disabling a switch port for specific time interval

Unanswered Question
Aug 25th, 2009
User Badges:

Hi can any one guide on how we can disable a specific switch port on Catalyst 2960 switches for a specific period of time. NTP is running on the switch.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Tue, 08/25/2009 - 21:40
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I just saw this posted on another thread I'm working on:


time-range test

periodic weekend 0:01 to 23:59

!

access-list 105 deny ip any any time-range test

access-list 105 permit ip any any

!

int fa0/8

ip access-group 105 in


This blocks all IP traffic on a port for a given time range.


Another solution is to use the Embedded Event Manager to shutdown the port at a given time. The EEM solution would require IOS 12.2(40)SE or higher. You could do something like:


event manager applet shutdown-port

event timer cron cron-entry "0 17 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "interface Fa0/8"

action 4.0 cli command "shut"

action 5.0 cli command "end"

action 6.0 syslog msg "Port FastEthernet0/8 taken down"


event manager applet up-port

event timer cron cron-entry "0 8 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "interface Fa0/8"

action 4.0 cli command "no shut"

action 5.0 cli command "end"

action 6.0 syslog msg "Port FastEthernet0/8 brought back up"


This will take down port Fa0/8 at 17:00, and bring it backup at 8:00.

Actions

This Discussion