Time Range Commands for Time-Based ACLs

Use these commands to configure time ranges for time-based ACL rules.

Time-based ACLs allow one or more rules within an ACL to be based on time. Each ACL rule within an ACL except for the implicit deny all rule can be configured to be active and operational only during a specific time period. The time range commands allow you to define specific times of the day and week in order to implement time-based ACLs. The time range is identified by a name and can then be referenced by an ACL rule defined within an ACL.

time-range

M4250

M4350

Use this command to create a time range identified by name, consisting of one absolute time entry and/or one or more periodic time entries. The name parameter is a case-sensitive, alphanumeric string from 1 to 31 characters that uniquely identifies the time range. An alpha-numeric string is defined as consisting of only alphabetic, numeric, dash, underscore, or space characters.

If a time range by this name already exists, this command enters Time-Range config mode to allow updating the time range entries.

Note: When you successfully execute this command, the CLI mode changes to Time-Range Config mode.
Format time-range name
Mode Global Config

no time-range

This command deletes a time-range identified by name.

Format no time-range name
Mode Global Config

absolute

M4250

M4350

Use this command to add an absolute time entry to a time range. Only one absolute time entry is allowed per time-range. The time parameter is based on the currently configured time zone.

The optional start time date parameters indicate the time and date at which the configuration that referenced the time range starts going into effect. The time is expressed in a 24-hour clock, in the form of hours:minutes. For example, 8:00 is 8:00 am and 20:00 is 8:00 pm. The date is expressed in the format day month year. If no start time and date are specified, the configuration statement is in effect immediately.

The optional end time date parameters indicate the time and date at which the configuration that referenced the time range is no longer in effect. The end time and date must be after the start time and date. If no end time and date are specified, the configuration statement is in effect indefinitely.

Format absolute [start time date month year] [end time date month year]
Mode Time-Range Config

no absolute

This command deletes the absolute time entry in the time range.

Format no absolute
Mode Time-Range Config

periodic

M4250

M4350

Use this command to add a periodic time entry to a time range. The time parameter is based off of the currently configured time zone.

The first occurrence of the day-of-the-week argument is the starting day(s) from which the configuration that referenced the time range starts going into effect. The second occurrence is the ending day or days from which the configuration that referenced the time range is no longer in effect. If the end days-of-the-week are the same as the start, they can be omitted.

This argument can be any single day or combinations of days: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. Other possible values are:

  • daily—Monday through Sunday
  • weekdays—Monday through Friday
  • weekend—Saturday and Sunday

If the ending days of the week are the same as the starting days of the week, they can be omitted.

The first occurrence of the time argument is the starting hours:minutes which the configuration that referenced the time range starts going into effect. The second occurrence of the time argument is the ending hours:minutes at which the configuration that referenced the time range is no longer in effect.

The hours:minutes are expressed in a 24-hour clock. For example, 8:00 is 8:00 am and 20:00 is 8:00 pm.

Format periodic {{day-of-the-week time} | {day-of-the-week [day-of-the-week]}} to {{day-of-the-week time} | {day-of-the-week [day-of-the-week]}}
Mode Time-Range Config

no periodic

This command deletes a periodic time entry from a time range.

Format no periodic days-of-the-week time to time
Mode Time-Range Config

show time-range

M4250

M4350

Use this command to display a time range and all the absolute/periodic time entries that are defined for the time range. Use the name parameter to identify a specific time range to display. When name is not specified, all the time ranges defined in the system are displayed.

Format show time-range [name]
Mode Privileged EXEC

The information in the following table displays when no time range name is specified.

Term Definition
Admin Mode The administrative mode of the time range feature on the switch.
Current number of all Time Ranges The number of time ranges currently configured in the system.
Maximum number of all Time Ranges The maximum number of time ranges that can be configured in the system.
Time Range Name Name of the time range.
Status Status of the time range (active/inactive).
Periodic Entry count The number of periodic entries configured for the time range.
Absolute Entry Indicates whether an absolute entry has been configured for the time range (Exists).