cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2987
Views
5
Helpful
1
Replies

Disabling a switch port for specific time interval

yogeshkelkar
Level 1
Level 1

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 1

Joe Clarke
Cisco Employee
Cisco Employee

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.

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: