7.3. Configuring Time-Range

Overview

Function Introduction

A time range is created that defines specific absolute times or periodic times of the day and week in order to implement time-based function, such as ACLs. The time range is identified by a name and then referenced by a function which by itself has no relevance. Therefore, the time restriction is imposed on the function itself. The time range relies on the system clock.

Principle Description

N/A

Configuration

Create an absolute time range

step 1 Enter the configure mode

Switch# configure terminal

step 2 Create a time-range and set absolute time

Switch(config)# time-range test-absolute
Switch(config-tm-range)# absolute start 1:1:2 jan 1 2023 end 1:1:3 jan 7 2023
Switch(config-tm-range)# exit

step 3 Exit the configure mode

Switch(config)# end

step 4 Validation

Switch# show time-range
time-range test-absolute
absolute start 01:01:02 Jan 01 2023 end 01:01:03 Jan 07 2023

Create a periodic time range

step 1 Enter the configure mode

Switch# configure terminal

step 2 Create a time-range and set periodic time

Switch(config)# time-range test-periodic
Switch(config-tm-range)# periodic 1:1 mon to 1:1 wed
Switch(config-tm-range)# exit

step 3 Exit the configure mode

Switch(config)# end

step 4 Validation

Switch# show time-range
time-range test-periodic
periodic 01:01 Mon to 01:01 Wed

Application cases

N/A