Skip to content
CCNA Certification: All about Access Control Lists(ACLs) Show
In preparation of our CCNA exam, we want to make sure we cover the various concepts that we could see on our Cisco CCNA exam. So to assist you, below we will discuss Access Control Lists. You can configure network security by using ACLs by either using the Cluster Management Suite (CMS) or through the command-line interface (CLI). You can also use the security wizard to filter inbound traffic on the Catalyst 2950 switches. Filtering can be based on network addresses or TCP/UDP applications. You can choose whether to drop or forward packets that meet the filtering criteria. To use this wizard, you must know how the network is designed and how interfaces are used on the filtering device. Understanding ACLsPacket filtering can limit network traffic and restrict network use by certain users or devices. ACLs can filter traffic as it passes through a switch and permit or deny packets from crossing specified interfaces. An ACL is a sequential collection of permit and deny conditions that apply to packets. When a packet is received on an interface, the switch compares the fields in the packet against any applied ACLs to verify that the packet has the required permissions to be forwarded, based on the criteria specified in the access lists. The switch tests the packet against the conditions in an access list one by one. The first match determines whether the switch accepts or rejects the packet. Because the switch stops testing conditions after the first match, the order of conditions in the list is critical. If no conditions match, the switch rejects the packet. If there are no restrictions, the switch forwards the packet; otherwise, the switch drops the packet. You configure access lists on a Layer 2 switch to provide basic security for your network. If you do not configure ACLs, all packets passing through the switch could be allowed onto all parts of the network. You can use ACLs to control which hosts can access different parts of a network or to decide which types of traffic are forwarded or blocked at switch interfaces. For example, you can allow e-mail traffic to be forwarded but not Telnet traffic. ACLs can be configured to block inbound traffic. An ACL contains an ordered list of access control entries (ACEs). Each ACE specifies permit or deny and a set of conditions the packet must satisfy in order to match the ACE. The meaning of permit or deny depends on the context in which the ACL is used. The switch supports these types of ACLs:
ACLsYou can apply ACLs on management VLANs, and on physical Layer 2 interfaces. ACLs are applied on interfaces for inbound directions.
The switch examines access lists associated with features configured on a given interface and a direction. As packets enter the switch on an interface, ACLs associated with all inbound features configured on that interface are examined. ACLs permit or deny packet forwarding based on how the packet matches the entries in the ACL. For example, you can use ACLs to allow one host to access a part of a network, but to prevent another host from accessing the same part. In Figure 12-1, ACLs applied at the switch input allow Host A to access the Human Resources network, but prevent Host B from accessing the same network. Figure 12-1 Using ACLs to Control Traffic to a Network Handling Fragmented and Unfragmented TrafficIP packets can be fragmented as they cross the network. When this happens, only the fragment containing the beginning of the packet contains the Layer 4 information, such as TCP or UDP port numbers, ICMP type and code, and so on. All other fragments are missing this information. Some ACEs do not check Layer 4 information and therefore can be applied to all packet fragments. ACEs that do test Layer 4 information cannot be applied in the standard manner to most of the fragments in a fragmented IP packet. When the fragment contains no Layer 4 information and the ACE tests some Layer 4 information, the matching rules are modified:
Consider access list 102, configured with these commands, applied to three fragmented packets: Switch (config)# access-list 102 permit tcp any host 10.1.1.1 eq smtp Note In the first and second ACEs in the examples, the eq keyword after the destination address means to test for the TCP-destination-port well-known numbers equaling Simple Mail Transfer Protocol (SMTP) and Telnet, respectively.
Understanding Access Control ParametersBefore configuring ACLs on the Catalyst 2950 switches, you must have a thorough understanding of the Access Control Parameters (ACPs). ACPs are referred to as masks in the switch CLI commands, output, and CMS. Each ACE has a mask and a rule. The Classification Field or mask is the field of interest on which you want to perform an action. The specific values associated with a given mask are called rules. Packets can be classified on these Layer 2, Layer 3, and Layer 4 fields.
Note A mask can be a combination of either multiple Layer 3 and Layer 4 fields or of multiple Layer 2 fields. Layer 2 fields cannot be combined with Layer 3 or Layer 4 fields. There are two types of masks:
Switch (config-ext-nacl)# permit tcp any any Note In an IP extended ACL (both named and numbered), a Layer 4 system-defined mask cannot precede a Layer 3 user-defined mask. For example, a Layer 4 systemdefined mask such as permit tcp any any or deny udp any any cannot precede a Layer 3 user-defined mask such as permit ip 10.1.1.1 any. If you configure this combination, the ACL is not configured. All other combinations of system-defined and user-defined masks are allowed in security ACLs. The Catalyst 2950 switch ACL configuration is consistent with other Cisco Catalyst switches. However, there are significant restrictions as well as differences for ACL configurations on the Catalyst 2950 switches. Guidelines for Configuring ACLs on the Catalyst 2950 SwitchesThese configuration guidelines apply to ACL filters:
Switch (config)#ip access-list extended acl2 In this example, the first ACE permits all the TCP packets coming from the host 10.1.1.1 with a destination TCP port number of 80. The second ACE permits all TCP packets coming from the host 20.1.1.1 with a destination TCP port number of 23. Both the ACEs use the same mask; therefore, a Catalyst 2950 switch supports this ACL.
Table 12-1 lists a summary of the ACL restrictions on Catalyst 2950 switches. Table 12-1 Summary of ACL Restrictions Configuring ACLsConfiguring ACLs on Layer 2 or Layer 3 management VLAN interfaces is the same as configuring ACLs on Cisco routers. The process is briefly described here. Unsupported FeaturesThe Catalyst 2950 switch does not support these IOS router ACL-related features:
This section describes how to create switch IP ACLs. An ACL is a sequential collection of permit and deny conditions. The switch tests packets against the conditions in an access list one by one. The first match determines whether the switch accepts or rejects the packet. Because the switch stops testing conditions after the first match, the order of the conditions is critical. If no conditions match, the switch denies the packet. Use these steps to use ACLs: Step 1 Create an ACL by specifying an access list number or name and access conditions. Step 2 Apply the ACL to interfaces or terminal lines. The software supports these styles of ACLs or IP access lists:
The next sections describe access lists and the steps for using them. ACL NumbersThe number you use to denote your ACL shows the type of access list that you are creating. Table 12-2 lists the access list number and corresponding type and shows whether or not they are supported by the switch. The Catalyst 2950 switch supports IP standard and IP extended access lists, numbers 1 to 199 and 1300 to 2699. Table 12-2 Access List Numbers Note In addition to numbered standard and extended ACLs, you can also create standard and extended named IP ACLs by using the supported numbers. That is, the name of a standard IP ACL can be 1 to 99; the name of an extended IP ACL can be 100 to 199. The advantage of using named ACLs instead of numbered lists is that you can delete individual entries from a named list. Creating a Numbered Standard ACL Beginning in privileged EXEC mode, follow these steps to create a numbered standard ACL: Use the no access-list access-list-number global configuration command to delete the entire ACL. You cannot delete individual ACEs from numbered access lists. Note When creating an ACL, remember that, by default, the end of the ACL contains an implicit deny statement for all packets that it did not find a match for before reaching the end. With standard access lists, if you omit the ask from an associated IP host address ACL specification, 0.0.0.0 is assumed to be the mask. This example shows how to create a standard ACL to deny access to IP host 171.69.198.102, permit access to any others, and display the results. Switch (config)# access-list 2 deny host 171.69.198.102 Although standard ACLs use only source addresses for matching, you can use an extended ACL source and destination addresses for matching operations and optional protocol type information for finer granularity of control. Some protocols also have specific parameters and keywords that apply to that protocol. These IP protocols are supported (protocol keywords are in parentheses in bold): Internet Protocol (ip), Transmission Control Protocol (tcp), or User Datagram Protocol (udp). Supported parameters can be grouped into these categories:
Table 12-3 lists the possible filtering parameters for ACEs for each protocol type. Table 12-3 Filtering Parameter ACEs Supported by Different IP Protocols For more details on the specific keywords relative to each protocol, refer to the Cisco IP and IP Routing Command Reference for IOS Release 12.1. Note The Catalyst 2950 switch does not support dynamic or reflexive access lists. It also does not support filtering based on the minimize-monetary-cost type of service (TOS) bit. When creating ACEs in numbered extended access lists, remember that after you create the list, any additions are placed at the end of the list. You cannot reorder the list or selectively add or remove ACEs from a numbered list. Beginning in privileged EXEC mode, follow these steps to create an extended ACL: Use the no access-list access-list-number global configuration command to delete the entire access list. You cannot delete individual ACEs from numbered access lists. This example shows how to create and display an extended access list to deny Telnet access from any host in network 171.69.198.0 to any host in network 172.20.52.0 and permit any others. (The eq keyword after the destination address means to test for the TCP destination port number equaling Telnet.) Switch(config)# accesslist After an ACL is created, any additions (possibly entered from the terminal) are placed at the end of the list. You can add ACEs to an ACL, but deleting any ACE deletes the entire ACL. Note When creating an ACL, remember that, by default, the end of the access list contains an implicit deny statement for all packets if it did not find a match before reaching the end. After creating an ACL, you must apply it to a line or interface. Creating Named Standard and Extended ACLsYou can identify IP ACLs with an alphanumeric string (a name) rather than a number. You can use named ACLs to configure more IP access lists on a switch than if you use numbered access lists. If you identify your access list with a name rather than a number, the mode and command syntax are slightly different. However, not all commands that use IP access lists accept a named ACL. Note The name you give to a standard ACL or extended ACL can also be a number in the supported range of access list numbers. That is, the name of a standard IP ACL can be 1 to 99; the name of an extended IP ACL can be 100 to 199. The advantage of using named ACLs instead of numbered lists is that you can delete individual entries from a named list. Consider these guidelines and limitations before configuring named ACLs:
Beginning in privileged EXEC mode, follow these steps to create a standard access list using names: Beginning in privileged EXEC mode, follow these steps to create an extended ACL using names: When making the standard and extended ACL, remember that, by default, the end of the ACL contains an implicit deny statement for everything if it did not find a match before reaching the end. For standard ACLs, if you omit the mask from an associated IP host address access list specification, 0.0.0.0 is assumed to be the mask. After you create an ACL, any additions are placed at the end of the list. You cannot selectively add ACEs to a specific ACL. However, you can use no permit and no deny commands to remove ACEs from a named ACL. This example shows how you can delete individual ACEs from a named ACL: Switch(config)# ip access-list extended border-list Being able to selectively remove lines from a named ACL is one reason you might use named ACLs instead of numbered ACLs. After creating an ACL, you must apply it to a line or interface. Including Comments About Entries in ACLsYou can use the remark command to include comments (remarks) about entries in any IP standard or extended ACL. The remarks make the ACL easier for you to understand and scan. Each remark line is limited to 100 characters. The remark can go before or after a permit or deny statement. You should be consistent about where you put the remark so that it is clear which remark describes which permit or deny statement. For example, it would be confusing to have some remarks before the associated permit or deny
statements and some remarks after the associated statements. For IP numbered standard or extended ACLs, use the access-list access-list number remark remark global configuration command to include a comment about an access list. In this example, the workstation belonging to Jones is allowed access, and the workstation belonging to Smith is not allowed access: Switch(config)# access-list 1 remark Permit only Jones workstation
through For an entry in a named IP ACL, use the remark access-list global configuration command. To remove the remark, use the no form of this command. In this example, the Jones subnet is not allowed to use outbound Telnet: Switch(config)# ip access-list extended
telnetting After you create an ACL, you can apply it to one or more interfaces or terminal lines. ACLs can be applied on inbound interfaces. This section describes how to accomplish this task for both terminal lines and network interfaces. Note these guidelines:
Beginning in privileged EXEC mode, follow these steps to restrict incoming connections between a virtual terminal line and the addresses in an ACL: Beginning in privileged EXEC mode, follow these steps to control access to a Layer 2 or Layer 3 interface: This example shows how to apply access list 2 on Gigabit Ethernet interface 0/3 to filter packets entering the interface: Switch(config)# interface gigabitethernet0/3 Note The ip access-group interface configuration command is only valid when applied to an management interface, a Layer 2 interface, or a Layer 3 interface. If applied to a Layer 3 interface, the interface must have been configured with an IP address. ACLs cannot be applied to interface port-channels. For inbound ACLs, after receiving a packet, the switch checks the packet against the ACL. If the ACL permits the packet, the switch continues to process the packet. If the ACL rejects the packet, the switch discards the packet. When you apply an undefined ACL to an interface, the switch acts as if the ACL has not been applied to the interface and permits all packets. Remember this behavior if you use undefined ACLs for network security. Displaying ACLsYou can display existing ACLs by using show commands. Beginning in privileged EXEC mode, follow these steps to display access lists: This example displays all standard and extended ACLs: Switch# show access-lists This example displays only IP standard and extended ACLs. Switch# show ip access-lists Displaying Access GroupsYou use the ip access-group interface configuration command to apply ACLs to a Layer 3 interface. When IP is enabled on an interface, you can use the show ip interface interface-id privileged EXEC command to view the input and output access lists on the interface, as well as other interface characteristics. If IP is not enabled on the interface, the access lists are not shown. This example shows how to view all access groups configured for VLAN 1 and for Gigabit Ethernet interface 0/2: Switch# show ip interface vlan 1 < information truncated> Switch# show ip interface f0/9 The only way to ensure that you can view all configured access groups under all circumstances is to use the show running-config privileged EXEC command. To display the ACL configuration of a single interface, use the show running-config interface interface-id command. This example shows how to display the ACL configuration of Gigabit Ethernet interface 0/1: Switch# show running-config interface gigabitethernet0/1 Current configuration :112 bytes Examples for Compiling ACLsFor detailed information about compiling ACLs, refer to the Security Configuration Guide and the “IP Services” chapter of the Cisco IOS IP and IP Routing Configuration Guide for IOS Release 12.1. Figure 12-2 shows a small networked office with a stack of Catalyst 2950 switches that are connected to a Cisco router. A host is connected to the network through the Internet using a WAN link. Use switch ACLs to do these:
Figure 12-2 Using Switch ACLs to Control Traffic This example uses a standard ACL to allow access to a specific Internet host with the address 172.20.128.64. Switch(config)# access-list 6 permit 172.20.128.64 0.0.0.0 This example uses an extended ACL to deny traffic from port 80 (HTTP). It permits all other types of traffic. Switch(config)# access-list 106 deny tcp any any eq 80 This example shows that the switch accepts addresses on network 36.0.0.0 subnets and denies all packets coming from 56.0.0.0 subnets. The ACL is then applied to packets entering Gigabit Ethernet interface 0/1. Switch(config)# access-list 2 permit 36.0.0.0 0.255.255.255 In this example of using an extended ACL, you have a network connected to the Internet, and you want any host on the network to be able to form TCP Telnet and SMTP connections to any host on the Internet. Switch(config)# access-list
102 permit tcp any 128.88.0.0 0.0.255.255 eq 23 SMTP uses TCP port 25 on one end of the connection and a random port number on the other end. The same port numbers are used throughout the life of the connection. Mail packets coming in from the Internet have a destination port of 25. Because the secure system behind the switch always accepts mail connections on port 25, the incoming services are controlled. Named ACL ExampleThe Marketing_group ACL allows any TCP Telnet traffic to the destination address and wildcard 171.69.0.0 0.0.255.255 and denies any other TCP traffic. It permits any other IP traffic. Switch(config)# ip access-list extended marketing_group Switch(config)# interface gigabitethernet0/1 In this example of a numbered ACL, the workstation belonging to Jones is allowed access, and the workstation belonging to Smith is not allowed access: Switch(config)# access-list 1 remark Permit only Jones workstation through In this example of a numbered ACL, the Winter and Smith workstations are not allowed to browse the Web: Switch(config)# accesslist In this example of a named ACL, the Jones subnet is not allowed access: Switch(config)# ip access-list standard prevention In this example of a named ACL, the Jones subnet is not allowed to use outbound Telnet: Switch(config)# ip access-list extended telnetting Creating Named MAC Extended ACLsYou can filter Layer 2 traffic on a physical Layer 2 interface by using MAC addresses and named MAC extended ACLs. The procedure is similar to that of configuring other extended named access lists. Note Named MAC extended ACLs are used as a part of the mac access-group privileged EXEC command. Note Though visible in the command-line help strings, appletalk is not supported as a matching condition for the deny and permit MAC access-list configuration mode commands, nor is matching on any SNAP-encapsulated packet with a non-zero Organizational Unique Identifier (OUI). Beginning in privileged EXEC mode, follow these steps to create a named MAC extended ACL: Use the no mac access-list extended name global configuration command to delete the entire ACL. You can also delete individual ACEs from named MAC extended ACLs. This example shows how to create and display an access list named mac1, denying only EtherType DECnet Phase IV traffic, but permitting all other types of traffic. Switch(config)# mac access-list extended mac1 Creating MAC Access GroupsBeginning in privileged EXEC mode, follow these steps to create MAC access groups: This example shows how to apply ACL 2 on Gigabit Ethernet interface 0/1 to filter packets entering the interface: Switch(config)# interface gigabitethernet0/1 Note The mac access-group interface configuration command is only valid when applied to an a Layer 2 interface. If applied to a Layer 3 interface, the interface must have been configured with an IP address. For inbound ACLs, after receiving a packet, the switch checks the packet against the ACL. If the ACL permits the packet, the switch continues to process the packet. If the ACL rejects the packet, the switch discards the packet. The MAC ACL applies to both IP as well as non-IP packets. When you apply an undefined ACL to an interface, the switch acts as if the ACL has not been applied to the interface and permits all packets. Remember this behavior if you use undefined ACLs as a means of network security. I hope you found this article to be of use and it helps you prepare for your Cisco CCNA certification. I am sure you will quickly find out that hands-on real world experience is the best way to cement the CCNA concepts in your head to help you pass your CCNA exam! Page load linkWhich command is used to determine if an ip access list is enabled on a particular interface Show Show Lists B show interface C show interface ip Show List access access?Solution(By Examveda Team)
The show ip interface command will show you if any outbound or inbound interfaces have an access list set.
What router command allows you to determine whether ip access list is enabled on a particular interface?Answer: The show ip interface command is used to determine if an IP access list is enabled on a particular interface. Answer: The show ip interface command is used to determine if an IP access list is enabled on a particular interface.
What command is used to apply an access list to an interface?Explanation: To apply an access list, the proper command is ip access-group 101 in.
Which of the following commands will show only the ip access lists configured on the router?Access List Commands. |