4.Cisco ASA Time Based Access-List



The Cisco ASA firewall supports time based access-lists. Simply said, for each entry that you configure you can specify it to be valid only during a certain time or day.

Take a look at the image below:

Cisco ASA Time Based Access-List

Above we have an inside host (R1) and a HTTP server in the DMZ (R3). Let’s say that our users on the inside should not be able to access this web server during working hours. Here’s what the configuration would look like:

ASA1(config)# clock set 13:55:00 3 December 2014

First I’ll configure the clock, next step is to create a time-range:

ASA1(config)# time-range WORK_HOURS   
ASA1(config-time-range)# periodic weekdays 09:00 to 17:00

This time-range called “WORK_HOURS” matches on weekdays and between 09:00 to 17:00.  Now we can create an access-list:

ASA1(config)# access-list INSIDE_INBOUND extended deny tcp any any eq 80 time-range WORK_HOURS
ASA1(config)# access-list INSIDE_INBOUND extended permit ip any any
ASA1(config)# access-group INSIDE_INBOUND in interface inside

The access-list above denies traffic with destination TCP port 80 but only if it’s within our time-range. All other traffic is permitted. Let’s give it a try:

R1#telnet 192.168.3.3 80
Trying 192.168.3.3, 80 ... 
% Connection refused by remote host

I’ll telnet to TCP port 80 from R1 to R3 in the DMZ and it doesn’t work. Here’s what you will see on the ASA:

ASA1# show access-list INSIDE_INBOUND
access-list INSIDE_INBOUND; 2 elements; name hash: 0x1cb98eea
access-list INSIDE_INBOUND line 1 extended deny tcp any any eq www time-range WORK_HOURS (hitcnt=3) 0xfc102fc8 
access-list INSIDE_INBOUND line 2 extended permit ip any any (hitcnt=1) 0x38288040

This traffic is denied since it matches our working hours, as a result the traffic has been dropped.

I hope this lesson has been useful, if you have any questions just leave a comment!

Comments

Popular posts from this blog

Cisco ASA Packet Drop Troubleshooting

show asp drop Command Usage

1.Cisco ASA Clock Configuration