Thursday, August 20, 2009 

Shutting Interfaces from Kron using Macros in Cisco IOS

You should be able to use kron and macros to be able to shut interfaces on a scheduled basis in Cisco IOS.

1. Make a macro to shut the interfaces (or perform other nested tasks)
Router(config)# macro name macro_name1
Router(config)# interface Vlan1
Router(config-if)# shutdown
Router(config-if)# no shutdown @

2. Make a kron job to call the Cisco IOS macro.
Router(config)# kron policy-list policy_name1
Router(config-kron-policy)# cli macro_name1
Router(config-kron-policy)# exit

3. Next, create a kron occurrence, in which you tell the router when and how often you want to run this policy list (i.e., group of commands). Here's an example:

Router(config)# kron occurrence policy_name1 at 22:00 Mon recurring
Router(config-kron-occurrence)# policy-list policy_name1
Router(config-kron-occurrence)# exit


References
Using macros with IOS
Schedule Kron with IOS


Labels: , ,