Setting up a time range is useful if you want other features of the switch to be triggered or activated at a certain time. In addition, you can also specify how long a range can last for features that you want to disable after a period of time. Recurring time ranges can also be set if you want to continuously enable and disable a feature. Several of these features rely on time ranges to implement security or access control.
Time ranges can be defined and associated with the following types of commands:
There are two types of time ranges:
If a time range includes both absolute and recurring ranges, the operations of the associated commands are active only if both absolute start time and the recurring time range have been reached. Operations of the associated commands are inactive when either of the time ranges is reached.
This article provides instructions on how to configure time range settings through the Command Line Interface (CLI) of your switch.
Note: To configure the time range settings of your switch using the web-based utility, click here.
Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Note: The commands may vary depending on the exact model of your switch. In this example, the SG350X switch is accessed through Telnet.
Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
Step 3. Enter the time-range command to define time ranges for different functions by entering the following:
Note: In this example, the time range name is Dayshift.
Step 4. (Optional) To remove the time range from the switch, enter the following:
Step 5. To determine the starting point of the absolute time range, enter the following:
Important: The permit or deny statement of the associated function is going to take effect at the defined absolute start time and date. If no start time and date are specified, the function is in effect immediately.
The options are:
Note: In this example, the absolute time range starts on January 1, 2017 at 8:00 in the morning.
Step 6. (Optional) To remove the start date and time, enter the following:
Step 7. To determine the end point of the absolute time range, enter the following:
Important: The permit or deny statement of the associated function will no longer take effect at the defined absolute end time and date. If no end time and date are specified, the effect of the function will never end.
The options are:
Note: In this example, the absolute time range ends on December 31, 2017 at 17:00 in the afternoon.
Step 8. (Optional) To remove the end date and time, enter the following:
Step 9. To go back to the Privileged EXEC mode, enter the following:
Step 10. To show the configured recurring or periodic time range settings on your switch, enter the following:
Note: In this example, the absolute time range settings for the time range Dayshift is displayed.
Step 11. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
Step 12. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have successfully configured the absolute time range settings on your switch through the CLI.
A recurring or periodic time element can be added to an absolute time range. This limits the operation to certain time periods within the absolute range.
Step 1. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
Step 2. Enter the time-range command to define time ranges for different functions by entering the following:
Note: In this example, the time range name is Dayshift.
Step 3. To specify a day of the week and a time (in 24-hour format) that the time range begins on a recurring basis, enter any of the following:
The options are:
Note: The second occurrence of the day can be at the following week. For example, Thursday to Monday means that the time range is effective on Thursday, Friday, Saturday, Sunday, and Monday. While the second occurrence of the time can be on the following day, such as 22:00 to 2:00 of the next day.
Note: In this example, the recurring time range starts every Monday at 8:00 in the morning and ends every Friday at 17:00 in the afternoon.
Step 4. (Optional) To remove the periodic date and time limitation, enter the no command to the configured time range in Step 3 by entering either of the following:
Step 5. To go back to the Privileged EXEC mode, enter the following:
Step 6. To show the configured recurring or periodic time range settings on your switch, enter the following:
Note: In this example, the absolute and periodic time range settings for the time range Dayshift is displayed.
Step 7. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
Step 8. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have successfully configured the recurring time range settings on your switch through the CLI.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
13-Dec-2018 |
Initial Release |