About ACLs
An access control list (ACL) is an ordered set of rules that you can use to filter traffic. Each rule specifies a set of conditions that a packet must satisfy to match the rule. When the switch determines that an ACL applies to a packet, it tests the packet against the conditions of all rules. The first match determines whether the packet is permitted or denied. If there is no match, the switch applies the applicable default rule. The switch continues processing packets that are permitted and drops packets that are denied.
You can use ACLs to protect networks and specific hosts from unnecessary or unwanted traffic. For example, you could use ACLs to disallow HTTP traffic from a high-security network to the Internet. You could also use ACLs to allow HTTP traffic but only to specific sites, using the IP address of the site to identify it in an IP ACL.
IP ACL Types and Applications
The Cisco Nexus device supports IPv4 for security traffic filtering. The switch allows you to use IP access control lists (ACLs) as port ACLs, VLAN ACLs, and Router ACLs as shown in the following table.
Application |
Supported Interfaces |
Types of ACLs Supported |
||
---|---|---|---|---|
Port ACL |
An ACL is considered a port ACL when you apply it to one of the following:
When a port ACL is applied to a trunk port, the ACL filters traffic on all VLANs on the trunk port. |
IPv4 ACLs |
||
Router ACL |
|
IPv4 ACLs |
||
VLAN ACL (VACL) |
An ACL is a VACL when you use an access map to associate the ACL with an action and then apply the map to a VLAN. |
IPv4 ACLs |
||
VTY ACL |
VTYs |
IPv4 ACLs |
Application Order
-
Port ACL
-
Ingress VACL
-
Ingress Router ACL
-
Egress Router ACL
-
Egress VACL
Rules
Rules are what you create, modify, and remove when you configure how an ACL filters network traffic. Rules appear in the running configuration. When you apply an ACL to an interface or change a rule within an ACL that is already applied to an interface, the supervisor module creates ACL entries from the rules in the running configuration and sends those ACL entries to the applicable I/O module. Depending upon how you configure the ACL, there may be more ACL entries than rules, especially if you implement policy-based ACLs by using object groups when you configure rules.
You can create rules in ACLs and tYou can create rules in access-list configuration mode by using the permit or deny command. The device allows traffic that matches the criteria in a permit rule and blocks traffic that matches the criteria in a deny rule. You have many options for configuring the criteria that traffic must meet in order to match the rule.
This section describes some of the options that you can use when you configure a rule.
Source and Destination
In each rule, you specify the source and the destination of the traffic that matches the rule. You can specify both the source and destination as a specific host, a network or group of hosts, or any host.
Protocols
IPv4 and MAC ACLs allow you to identify traffic by protocol. For your convenience, you can specify some protocols by name. For example, in an IPv4 ACL, you can specify ICMP by name.
You can specify any protocol by the integer that represents the Internet protocol number.
Implicit Rules
IP and MAC ACLs have implicit rules, which means that although these rules do not appear in the running configuration, the switch applies them to traffic when no other rules in an ACL match.
All IPv4 ACLs include the following implicit rule:
deny ip any any
This implicit rule ensures that the switch denies unmatched IP traffic.
permit icmp any any nd-na
permit icmp any any nd-ns
permit icmp any any router-advertisement
permit icmp any any router-solicitation
All MAC ACLs include the following implicit rule:
deny any any protocol
This implicit rule ensures that the device denies the unmatched traffic, regardless of the protocol specified in the Layer 2 header of the traffic.
Additional Filtering Options
You can identify traffic by using additional options. IPv4 ACLs support the following additional filtering options:
-
Layer 4 protocol
-
TCP and UDP ports
-
ICMP types and codes
-
IGMP types
-
Precedence level
-
Differentiated Services Code Point (DSCP) value
-
TCP packets with the ACK, FIN, PSH, RST, SYN, or URG bit set
-
Established TCP connections
Sequence Numbers
The Cisco Nexus device supports sequence numbers for rules. Every rule that you enter receives a sequence number, either assigned by you or assigned automatically by the device. Sequence numbers simplify the following ACL tasks:
-
Adding new rules between existing rules—By specifying the sequence number, you specify where in the ACL a new rule should be positioned. For example, if you need to insert a rule between rules numbered 100 and 110, you could assign a sequence number of 105 to the new rule.
-
Removing a rule—Without using a sequence number, removing a rule requires that you enter the whole rule, as follows:
switch(config-acl)# no permit tcp 10.0.0.0/8 any
However, if the same rule had a sequence number of 101, removing the rule requires only the following command:
switch(config-acl)# no 101
-
Moving a rule—With sequence numbers, if you need to move a rule to a different position within an ACL, you can add a second instance of the rule using the sequence number that positions it correctly, and then you can remove the original instance of the rule. This action allows you to move the rule without disrupting traffic.
If you enter a rule without a sequence number, the device adds the rule to the end of the ACL and assigns a sequence number that is 10 greater than the sequence number of the preceding rule to the rule. For example, if the last rule in an ACL has a sequence number of 225 and you add a rule without a sequence number, the device assigns the sequence number 235 to the new rule.
In addition, the device allows you to reassign sequence numbers to rules in an ACL. Resequencing is useful when an ACL has rules numbered contiguously, such as 100 and 101, and you need to insert one or more rules between those rules.
Logical Operators and Logical Operation Units
IP ACL rules for TCP and UDP traffic can use logical operators to filter traffic based on port numbers.
The Cisco Nexus device stores operator-operand couples in registers called logical operation units (LOUs) to perform operations (greater than, less than, not equal to, and range) on the TCP and UDP ports specified in an IP ACL.
Note |
The range operator is inclusive of boundary values. |
These LOUs minimize the number of ternary content addressable memory (TCAM) entries needed to perform these operations. A maximum of two LOUs are allowed for each feature on an interface. For example an ingress RACL can use two LOUs, and a QoS feature can use two LOUs. If an ACL feature requires more than two arithmetic operations, the first two operations use LOUs, and the remaining access control entries (ACEs) get expanded.
The following guidelines determine when the device stores operator-operand couples in LOUs:
-
If the operator or operand differs from other operator-operand couples that are used in other rules, the couple is stored in an LOU.
For example, the operator-operand couples "gt 10" and "gt 11" would be stored separately in half an LOU each. The couples "gt 10" and "lt 10" would also be stored separately.
-
Whether the operator-operand couple is applied to a source port or a destination port in the rule affects LOU usage. Identical couples are stored separately when one of the identical couples is applied to a source port and the other couple is applied to a destination port.
For example, if a rule applies the operator-operand couple "gt 10" to a source port and another rule applies a "gt 10" couple to a destination port, both couples would also be stored in half an LOU, resulting in the use of one whole LOU. Any additional rules using a "gt 10" couple would not result in further LOU usage.
ACL TCAM Regions
You can change the size of the ACL ternary content addressable memory (TCAM) regions in the hardware.
The IPv4 TCAMs are single wide.
TCAM region sizes have the following guidelines and limitations:
-
To revert to the default ACL TCAM size, use the no hardware profile tcam region command. You no longer need to use the write erase command and reload the switch.
-
Depending on the Cisco Nexus device, each TCAM region might have a different minimum/maximum/aggregate size restriction.
-
The default size of the ARPACL TCAM is zero. Before you use the ARP ACLs in a Control Policing Plane (CoPP) policy, you must set the size of this TCAM to a non-zero size.
-
You must set the VACL and egress VLAN ACL (E-VACL) size to the same value.
-
The total TCAM depth is 4000 entries shared between ingress and egress, which can be carved in 16 entries blocks.
-
TCAM supports 256 statistic entries per ACL feature.
-
64 ACL L4OPs are supported, 32 in each direction.
-
2 L4OPs are supported per label in each direction. Each label can be shared across multiple interfaces for same ACL.
-
After TCAM carving, you must reload the switch.
-
All existing TCAMs cannot be set to size 0.
-
By default, all IPv6 TCAMs are disabled (the TCAM size is set to 0).
TCAM ACL Region |
Default Size |
Minimum Size |
Incremental Size |
---|---|---|---|
SUP (ingress) |
112 |
48 |
16 |
PACL (ingress) |
400 |
0 |
16 |
VACL (ingress), VACL (egress) |
640 (ingress), 640 (egress) |
0 (ingress), 0 (egress) |
16 |
RACL (ingress) |
1536 |
0 |
16 |
QOS (ingress), QOS (egress) |
192 (ingress), 64 (egress) |
16 (ingress), 64 (egress) |
16 |
E-VACL (egress) |
640 |
0 |
16 |
E-RACL (egress) |
256 |
0 |
16 |
NAT |
256 |
0 |
16 |
Licensing Requirements for ACLs
For a complete explanation of Cisco NX-OS licensing recommendations and how to obtain and apply licenses, see the Cisco NX-OS Licensing Guide.
Prerequisites for ACLs
IP ACLs have the following prerequisites:
-
You must be familiar with IP addressing and protocols to configure IP ACLs.
-
You must be familiar with the interface types that you want to configure with ACLs.
VACLs have the following prerequisite:
-
Ensure that the IP ACL that you want to use in the VACL exists and is configured to filter traffic in the manner that you need for this application.
Guidelines and Limitations for ACLs
IP ACLs have the following configuration guidelines and limitations:
-
We recommend that you perform ACL configuration using the Session Manager. This feature allows you to verify ACL configuration and confirm that the resources that are required by the configuration are available before committing them to the running configuration. This is especially useful for ACLs that include more than about 1000 rules.
-
Packets that fail the Layer 3 maximum transmission unit check and therefore require fragmenting.
-
IPv4 packets that have IP options (additional IP packet header fields following the destination address field).
-
To apply an IP ACL to a VLAN interface, you must have enabled VLAN interfaces globally.
-
One VLAN access map can match only one IP ACL.
-
An IP ACL can have multiple permit/deny ACEs.
-
One VLAN can have only one access map applied.
-
Egress RACLs and VACLs should not be applied in warp mode, and it is not supported.
-
Egress ACLs cannot be applied to multicast traffic.
-
Egress ACL Logging not supported on Cisco Nexus 3548 platform.
-
Although Ingress RACLs on SVI are supported for multicast traffic, if the ACL defining the multicast group where the traffic must be sent to or sourced from includes the log keyword, the ingress RACL application on SVI is not supported.
-
To match the Ingress RACL ACEs for multicast traffic on SVI, the ACE should include a match on the multicast DIP. Also, before installing these ACEs, you must enable the RACL-bridging using the hardware profile tcam mcast racl-bridge command.
-
PACL cannot be applied in warp mode.
-
The same ingress RACL on an SVI and on a Layer 3 interface cannot share TCAM resources, and they individually use up TCAM resources. However, they share ACL statistics resources. If the RACL TCAM is almost depleted before upgrade, RACL application may fail after upgrade. If this happens, you can carve the RACL TCAM.
-
ARP ACLs are not supported on the Nexus 3500 platform.
-
Ingress RACL applied to physical or logical Layer 3 interface is supported. For the ingress RACL to be applied to the Layer 3 SVI, you can use the hardware profile tcam mcast racl-bridge configuration as a workaround to match multicast traffic.
-
Upgrade from Cisco NX-OS Release 7.0(3)I7(6) or below, Cisco NX-OS Release 9.3(1) to 9.3(2) or above with default lou threshold config will set lou threshold as 1.
-
In the Cisco Nexus 3548 Series switches, RACL with ACL log option will not take into effect as the sup-redirect ACLs will have higher priority for the traffic destined to SUP.
Default ACL Settings
The following table lists the default settings for IP ACLs parameters.
Parameters |
Default |
---|---|
IP ACLs |
No IP ACLs exist by default. |
ACL rules |
Implicit rules apply to all ACLs . |
Object groups |
No object groups exist by default. |
The following table lists the default settings for VACL parameters.
Parameters |
Default |
---|---|
VACLs |
No IP ACLs exist by default. |
ACL rules |
Implicit rules apply to all ACLs. |