Time Based ACL Configuration
Time based ACLs were introduced in Cisco IOS 12.0.1.T. They allow for access control based on time.
A time range could be periodic (certain or recurring time of day or week) or absolute (start time to end time). Because time based ACLs rely on router system clock, the router time should be configured properly, either manually or using Network Time Protocol (NTP)
Scenario
Suppose the you have the following requirement
Users can access the company web server from 8:00am to 5:00pm only. The company web server’s IP address is 192.168.1.2
Configuration Steps
- Define time range
- Use the defined time range in ACLs
- Finally, apply to an interface
Configuration
Define time range
Router(config)#time-range OFFICE_TIME Router(config-time-range)#periodic ? Friday Friday Monday Monday Saturday Saturday Sunday Sunday Thursday Thursday Tuesday Tuesday Wednesday Wednesday daily Every day of the week weekdays Monday thru Friday weekend Saturday and Sunday Router(config-time-range)#periodic daily 08:00 to 17:00 Router(config-time-range)#
The above commands are self explanatory. Defined time range named OFFICE_TIME which will be active daily from 8:00am to 5:00pm.
Define access list using the above time range OFFICE_TIME. Permit traffic during office hour to our web server at 192.168.1.2
Drop all traffic to the web server after 5:00pm.
Router(config)#access-list 101 remark OFFICE_TIME_WWW Router(config)#access-list 101 permit tcp any host 192.168.1.2 eq www time-range OFFICE_TIME Router(config)#access-list 101 deny tcp any host 192.168.1.2 eq www Router(config)#access-list 101 permit ip any any Router(config)#
Apply access list 101 to an interface.
Router(config)#interface fastEthernet 0/0 Router(config-if)#ip access-group 101 in
Conclusion
The above configuration should work fine. The IP address and the interface used might be different depending on the network topology but the configuration concept should be same.
That it for this tutorial. Enjoy.
| This entry was posted by Arsalan A. Suzuki on August 8, 2010 at 9:00 pm, and is filed under Cisco, IOS, Security. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
