Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Disabling a switch port for specific time interval

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 REPLY
Cisco Employee

Re: Disabling a switch port for specific time interval

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.

712
Views
0
Helpful
1
Replies
CreatePlease login to create content