deny... deny... deny... permit ip any any
•
To define multiple actions in an ACL (permit, deny), group each action type together to reduce the
number of entries.
•
Avoid including Layer 4 information in an ACL; adding this information complicates the merging
process. The best merge results are obtained if the ACLs are filtered based on IP addresses (source and
destination) and not on the full flow (source IP address, destination IP address, protocol, and protocol
ports). It is also helpful to use
don
’
t care
bits in the IP address, whenever possible.
If you need to specify the full-flow mode and the ACL contains both IP ACEs and TCP/UDP/ICMP
ACEs with Layer 4 information, put the Layer 4 ACEs at the end of the list. This gives priority to the
filtering of traffic based on IP addresses.
Time Ranges for ACLs
You can selectively apply extended ACLs based on the time of day and the week by using the
time-range
global configuration command. First, define a time-range name and set the times and the dates or the days of
the week in the time range. Then enter the time-range name when applying an ACL to set restrictions to the
access list. You can use the time range to define when the permit or deny statements in the ACL are in effect,
for example, during a specified time period or on specified days of the week. The
time-range
keyword and
argument are referenced in the named and numbered extended ACL task tables.
These are some benefits of using time ranges:
•
You have more control over permitting or denying a user access to resources, such as an application
(identified by an IP address/mask pair and a port number).
•
You can control logging messages. ACL entries can be set to log traffic only at certain times of the day.
Therefore, you can simply deny access without needing to analyze many logs generated during peak
hours.
Time-based access lists trigger CPU activity because the new configuration of the access list must be merged
with other features and the combined configuration loaded into the hardware memory. For this reason, you
should be careful not to have several access lists configured to take affect in close succession (within a small
number of minutes of each other.)
The time range relies on the switch system clock; therefore, you need a reliable clock source. We
recommend that you use Network Time Protocol (NTP) to synchronize the switch clock.
Note
Related Topics
Configuring Time Ranges for ACLs, on page 163
IPv4 ACL Interface Considerations
When you apply the
ip access-group
interface configuration command to a Layer 3 interface (an SVI, a Layer
3 EtherChannel, or a routed port), the interface must have been configured with an IP address. Layer 3 access
groups filter packets that are routed or are received by Layer 3 processes on the CPU. They do not affect
packets bridged within a VLAN.
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01
153
Configuring IPv4 ACLs
Time Ranges for ACLs