Table Of Contents
Configuring Security Access Control Lists
Overview
ACL Types and Uses
ACL Guidelines
ACL Entry Order
ACL Implicit Deny
Maximum Number of ACL Entries
ACL Configuration Quick Start
Configuring ACLs
Configuring an Extended ACL
Configuring Comments in an Extended ACL
Configuring an EtherType ACL
Resequencing Entries
Applying an ACL to an Interface
Applying an ACL Globally to All Interfaces in a Context
Filtering Traffic with an ACL
ACL Configurational Examples
Examples of Extended ACLs
Inbound and Outbound ACLs
IP Addresses for ACLs with NAT
Examples of Ethertype ACLs
Displaying ACL Configurational Information and Statistics
Displaying ACL Configurational Information
Displaying ACL Statistics
Clearing ACL Statistics
Configuring Security Access Control Lists
This chapter describes security access control lists (ACLs) and how to configure them on your Cisco Application Control Engine (ACE) module. ACLs provide basic security for your network by filtering traffic and controlling network connections. This chapter consists of the following major sections:
•
Overview
•
ACL Configuration Quick Start
•
Configuring ACLs
•
ACL Configurational Examples
•
Displaying ACL Configurational Information and Statistics
•
Clearing ACL Statistics
Overview
An ACL consists of a series of statements called ACL entries that collectively define the network traffic profile. Each entry permits or denies network traffic (inbound and outbound) to the parts of your network specified in the entry. Besides an action element (permit or deny), each entry also contains a filter element based on criteria such as source address, destination address, protocol, protocol-specific parameters, and so on. An implicit deny-all entry exists at the end of every ACL, so you must configure an ACL on every interface where you want to permit connections. Otherwise, the ACE denies all traffic on the interface.
ACLs provide basic security for your network by allowing you to control network connection setups rather than processing each packet. Such ACLs are commonly referred to as security ACLs.
You can configure ACLs as parts of other features (for example, security, network address translation (NAT), server load balancing (SLB), and so on). The ACE merges these individual ACLs into one large ACL called a merged ACL. The ACL compiler then parses the merged ACL and generates the ACL lookup mechanisms. A match on this merged ACL can result in multiple actions.
When you use ACLs, you may want to permit all e-mail traffic on a circuit, but block Telnet traffic. You can also use ACLs to allow one client to access a part of the network and prevent another client from accessing that same area.
When configuring ACLs, you must apply an ACL to an interface to control traffic on that interface. Applying an ACL on an interface assigns the ACL and its entries to that interface.
You can apply only one extended ACL to each direction (inbound or outbound) of an interface. You can also apply the same ACL on multiple interfaces.You can apply ethertype ACLs only in the inbound direction and only on Layer 2 interfaces.
ACL Types and Uses
You can configure two types of ACLs on the ACE. The ACL types and their uses are:
•
Extended—Control network access for IP traffic
•
EtherType—Control network access for non-IP traffic
Note
The ACE does not explicitly support standard ACLs. To configure a standard ACL, specify the destination address as any and do not specify ports in an extended ACL. For details about configuring an extended ACL, see the "Configuring an Extended ACL" section.
ACL Guidelines
This section describes the guidelines to observe when you configure and use ACLs in your network. It contains the following subsections:
•
ACL Entry Order
•
ACL Implicit Deny
•
Maximum Number of ACL Entries
ACL Entry Order
An ACL consists of one or more entries. Depending on the ACL type, you can specify as match criteria the source and destination addresses, the protocol, the ports (for TCP or UDP), the ICMP type, ICMP code, or the EtherType. By default, the ACE appends each ACL entry at the end of the ACL. You can also specify the location of each entry within an ACL.
The order of the entries is important. When the ACE decides whether to accept or refuse a connection, the ACE tests the packet against each ACL entry in the order in which the entries are listed. After it finds a match, the ACE does not check any more entries. For example, if you create an entry at the beginning of an ACL that explicitly permits all traffic, the ACE does not check any further statements in the ACL.
ACL Implicit Deny
All ACLs have an implicit deny entry at the end of the ACL, so, unless you explicitly permit it, traffic cannot pass. For example, if you want to allow all users to access a network through the ACE except for those with particular IP addresses, then you need to deny the particular IP addresses in one entry and then permit all other IP addresses in another entry.
Maximum Number of ACL Entries
The ACE supports a maximum of 64,000 entries. Some ACLs use more memory than others, and these include ACLs that use large port number ranges or overlapping networks (for example one entry specifies 10.0.0.0/8 and another entry specifies 10.1.1.0/24). Depending on the type of ACL, the actual limit the ACE can support may be less than 64,000 entries.
If you exceed the memory limitations of the ACE, the module generates a syslog message and increments the Download Failures counter in the output of the show interface vlan number command. The configuration remains in the running-config and the interface stays enabled. The ACL entries stay the same as they were before the failing configuration was attempted.
For example, if you add a new ACL with 10 entries, but the addition of the sixth entry fails because of memory exhaustion, the ACE removes the five entries that you successfully entered.
ACL Configuration Quick Start
Table 1-1 provides a quick overview of the steps required to configure ACLs. Each step includes the CLI command or a reference to the procedure required to complete the task. For a complete description of each feature and all the options associated with the CLI commands, see the sections following Table 1-1.
Table 1-1 ACL Configuration Quick Start
Task and Command Example
|
1. If you are operating in multiple contexts, observe the CLI prompt to verify that you are operating in the desired context. If necessary, change to the correct context.
The rest of the examples in this table use the Admin context for illustration purposes, unless otherwise specified. For details on creating contexts, refer to the Cisco Application Control Engine Module Virtualization Configuration Guide.
|
2. Enter configuration mode.
host1/Admin# config
host1/Admin(config)#
|
3. Create an ACL.
host1/Admin(config)# access-list INBOUND extended deny ip
192.168.12.0 255.255.255.0 any
|
4. As required by your application, add entries to the ACL using the same access-list name. For example, enter:
host1/Admin(config)# access-list INBOUND extended permit ip any
any
|
5. Apply the ACL to an individual interface.
host1/Admin(config)# interface vlan 10
host1/Admin(config-if)# access-group input INBOUND
|
6. Alternatively, you can apply an ACL globally to all interfaces in a context.
host1/Admin(config)# access-group input INBOUND
|
7. (Optional) If necessary, save your configuration changes to Flash memory.
host1/Admin(config)# exit
host1/Admin# copy running-config startup-config
|
8. (Recommended) Display and verify the ACL configuration information.
host1/Admin# show running-config access-list
|
Configuring ACLs
To configure ACLs on your ACE, use the following procedures:
•
Configuring an Extended ACL
•
Configuring Comments in an Extended ACL
•
Configuring an EtherType ACL
•
Resequencing Entries
•
Applying an ACL to an Interface
•
Applying an ACL Globally to All Interfaces in a Context
•
Filtering Traffic with an ACL
Configuring an Extended ACL
An extended ACL allows you to specify both the source and the destination IP addresses of traffic as well as the following parameters:
•
Protocol
•
TCP or UDP ports
You can specify these parameters directly in the access-list command.
For TCP, UDP, and ICMP connections, you do not need to also apply an ACL on the destination interface to allow returning traffic, because the ACE allows all returning traffic for established connections.
Note
The ACE does not explicitly support standard ACLs. To configure a standard ACL, specify the destination address as any and do not specify the ports in an extended ACL.
Tip
Enter the ACL name in upper case letters so that the name is easy to see in the configuration. You may want to name the ACL for the interface (for example, INBOUND), or for the purpose (for example, NO_NAT or VPN).
To create an extended ACL, use the access-list extended command in configuration mode. There are three major types of extended ACLs:
•
IP
•
TCP or UDP
•
ICMP
You can permit or deny network connections based on IP protocol and source and destination IP addresses. To configure an IP extended ACL, use the following syntax:
access-list name [line number] extended {deny | permit} {protocol}
{src_ip_address netmask | any | host src_ip_address} {dest_ip_address
netmask | any | host dest_ip_address}
In addition to the protocol and IP addresses, you can permit or deny network connections based on TCP or UDP source or destination ports. To configure a TCP or a UDP extended ACL, use the following syntax:
access-list name [line number] extended {deny | permit}{tcp | udp}}
{src_ip_address netmask | any | host src_ip_address} [operator port1
[port2]] {dest_ip_address netmask | any | host dest_ip_address}
[operator port3 [port4]]
Lastly, you can permit or deny network connections based on the ICMP type (for example, echo, echo-reply, unreachable, and so on). To configure an ICMP extended ACL, use the following syntax:
access-list name [line number] extended {deny | permit} icmp
{src_ip_address netmask | any | host src_ip_address | {any | host
dest_ip_address | dest_ip_address netmask} [icmp_type] [code operator
code]
The keywords and arguments are:
•
name—Unique identifier of the ACL. Enter an unquoted text string with a maximum of 64 characters.
•
line number—(Optional) Specifies the line number position where you want the entry you are configuring to appear in the ACL. The position of an entry affects the lookup order of the entries in an ACL. If you do not configure the line number of an entry, the ACE applies a default increment and a line number to the entry and appends it at the end of the ACL.
•
extended—Specifies an extended ACL. Extended ACLs allow you to specify the destination IP address and subnet mask and other parameters not available with a standard ACL.
•
deny—Blocks connections on the assigned interface.
•
permit—Allows connections on the assigned interface.
•
protocol—Name or number of an IP protocol. Enter a protocol name or an integer from 0 to 255 that represents an IP protocol number from the following table:
Protocol Name
|
Protocol Number
|
Description
|
ah
|
51
|
Authentication Header
|
eigrp
|
88
|
Enhanced IGRP
|
esp
|
50
|
Encapsulated Security Payload
|
gre
|
47
|
Generic Routing Encapsulation
|
icmp
|
1
|
Internet Control Message Protocol
|
igmp
|
2
|
Internet Group Management Protocol
|
ip
|
0
|
Internet Protocol
|
ip-in-ip
|
4
|
IP-in-IP Layer 3 Tunneling Protocol
|
ospf
|
89
|
Open Shortest Path First
|
pim
|
103
|
Protocol Independent Multicast
|
tcp
|
6
|
Transmission Control Protocol
|
udp
|
17
|
User Datagram Protocol
|
•
src_ip_address netmask—Specifies traffic from a source defined by the IP address and the network mask. Use these arguments to specify network traffic from a range of source IP addresses.
•
any—Specifies network traffic from any source.
•
host src_ip_address—IP address of the host from which network traffic originates. Use this keyword and argument to specify network traffic from a single IP address.
•
operator—(Optional) Operand used to compare source and destination port numbers for TCP and UDP protocols. The operators are:
–
lt—Less than.
–
gt—Greater than.
–
eq—Equal to.
–
neq—Not equal to.
–
range—An inclusive range of port values. If you enter this operator, enter a second port number value to define the upper limit of the range.
•
port1 [port2]—TCP or UDP source port name or number from which you permit or deny services access. Enter an integer from 0 to 65535. To enter an inclusive range of ports, enter two port numbers. Port2 must be greater than or equal to port1. See Table 1-2 for a list of well-known TCP port names and numbers and Table 1-3 for a list of well-known UDP port names and numbers.
Table 1-2 Well-Known TCP Port Numbers and Key Words
Key Word
|
Port Number
|
Description
|
aol
|
5190
|
America-Online
|
bgp
|
179
|
Border Gateway Protocol
|
chargen
|
19
|
Character Generator
|
citrix-ica
|
1494
|
Citrix Independent Computing Architecture Protocol
|
cmd
|
514
|
Same as exec, with automatic authentication
|
ctiqbe
|
2748
|
Computer Telephony Interface Quick Buffer Encoding
|
daytime
|
13
|
Daytime
|
discard
|
9
|
Discard
|
domain
|
53
|
Domain Name System
|
echo
|
7
|
Echo
|
exec
|
512
|
Exec (RSH
|
finger
|
79
|
Finger
|
ftp
|
21
|
File Transfer Protocol
|
ftp-data
|
20
|
FTP data connections
|
gopher
|
70
|
Gopher
|
h323
|
1720
|
H.323 call signalling
|
hostname
|
101
|
NIC hostname server
|
http
|
80
|
Hyper Text Transfer Protocol
|
https
|
443
|
HTTP over TLS/SSL
|
ident
|
113
|
Ident Protocol
|
imap4
|
143
|
Internet Message Access Protocol, version 4
|
irc
|
194
|
Internet Relay Chat
|
kerberos
|
88
|
Kerberos
|
klogin
|
543
|
Kerberos Login
|
kshell
|
544
|
Kerberos Shell
|
ldap
|
389
|
Lightweight Directory Access Protocol
|
ldaps
|
636
|
LDAP over TLS/SSL
|
login
|
513
|
Login (rlogin)
|
lotusnotes
|
1352
|
IBM Lotus Notes
|
lpd
|
515
|
Printer Service
|
matip-a
|
350
|
Mapping of Airline Traffic over Internet Protocol (MATIP) Type A
|
netbios-ssn
|
139
|
NetBios Session Service
|
nntp
|
119
|
Network News Transport Protocol
|
pcanywhere-data
|
5631
|
PC Anywhere data
|
pim-auto-rp
|
496
|
PIM Auto-RP
|
pop2
|
109
|
Post Office Protocol v2
|
pop3
|
110
|
Post Office Protocol v3
|
pptp
|
1723
|
Point-to-Point Tunneling Protocol, RFC 2637
|
rtsp
|
554
|
Real Time Stream control Protocol
|
sip
|
5060
|
Session Initiation Protocol
|
smtp
|
25
|
Simple Mail Transfer Protocol
|
sqlnet
|
1521
|
Structured Query Language Network
|
ssh
|
22
|
Secure SHell
|
sunrpc
|
111
|
Sun Remote Procedure Call
|
tacacs
|
49
|
Terminal Access Controller Access Control System
|
talk
|
517
|
Talk
|
telnet
|
23
|
Telnet
|
time
|
37
|
Time
|
uucp
|
540
|
Unix-to-Unix Copy Program
|
whois
|
43
|
Nicname
|
www
|
80
|
World Wide Web (HTTP)
|
Table 1-3 Well-Known UDP Port Numbers and Key Words
Key Word
|
Port Number
|
Description
|
biff
|
512
|
Mail notification
|
bootpc
|
68
|
Bootstrap Protocol (BOOTP) client
|
bootps
|
67
|
Bootstrap Protocol (BOOTP) server
|
discard
|
9
|
Discard
|
dnsix
|
195
|
DNSIX Security protocol auditing (dn6-nlm-aud)
|
domain
|
53
|
Domain Name System
|
echo
|
7
|
Echo
|
isakmp
|
500
|
Internet Security Association Key Management Protocol
|
kerberos
|
88
|
Kerberos
|
mobile-ip
|
434
|
Mobile IP registration
|
nameserver
|
42
|
Host Name Server
|
netbios-dgm
|
138
|
NetBios datagram service
|
netbios-ns
|
137
|
NetBios name service
|
netbios-ssn
|
139
|
NetBios Session Service
|
ntp
|
123
|
Network Time Protocol
|
pcanywhere-status
|
5632
|
PC Anywhere status
|
radius
|
1812
|
Remote Authentication Dial-in User Service
|
radius-acct
|
1813
|
RADIUS Accounting
|
rip
|
520
|
Routing Information Protocol (router, in.routed)
|
snmp
|
161
|
Simple Network Management Protocol
|
snmptrap
|
162
|
SNMP Traps
|
sunrpc
|
111
|
Sun Remote Procedure Call
|
syslog
|
514
|
System Logger
|
tacacs
|
49
|
Terminal Access Controller Access Control System
|
talk
|
517
|
Talk
|
tftp
|
69
|
Trivial File Transfer Protocol
|
time
|
37
|
Time
|
who
|
513
|
Who service (rwho)
|
wsp
|
9200
|
Connection-less Wireless Session Protocol
|
wsp-wtls
|
9202
|
Secure Connection-less WSP
|
wsp-wtp
|
9201
|
Connection-based WSP
|
wsp-wtp-wtls
|
9203
|
Secure Connection-based WSP
|
xdmcp
|
177
|
X Display Manager Control Protocol
|
•
dest_ip_address netmask—IP address of the network or host to which the packet is being sent and the network mask bits to be applied to the destination IP address. Use these arguments to specify a range of destination IP addresses.
•
any—Specifies network traffic going to any destination.
•
host destination_address—IP address and subnet mask of the destination of the packets in a flow. Use this keyword and argument to specify network traffic destined to a single IP address.
•
operator—(Optional) Operand used to compare source and destination port numbers for TCP and UDP protocols. The operators are:
–
lt—Less than.
–
gt—Greater than.
–
eq—Equal to.
–
neq—Not equal to.
–
range—An inclusive range of port values. If you enter this operator, enter a second port number value to define the upper limit of the range.
•
port3 [port4]—TCP or UDP destination port name or number to which you permit or deny services access. To enter an optional inclusive range of ports, enter two port numbers. Port4 must be greater than or equal to port3. Refer to Table 1-2 for a list of well-known ports.
•
icmp_type—(Optional) Specifies the type of ICMP messaging. Enter either an integer corresponding to the ICMP code number or one of the ICMP types as described in Table 1-4.
Table 1-4 ICMP Types
ICMP Code Number
|
ICMP Type
|
0
|
echo-reply
|
3
|
unreachable
|
4
|
source-quench
|
5
|
redirect
|
6
|
alternate-address
|
8
|
echo
|
9
|
router-advertisement
|
10
|
router-solicitation
|
11
|
time-exceeded
|
12
|
parameter-problem
|
13
|
timestamp-request
|
14
|
timestamp-reply
|
15
|
information-request
|
16
|
information-reply
|
17
|
mask-request
|
18
|
mask-reply
|
30
|
traceroute
|
31
|
conversion-error
|
32
|
mobile-redirect
|
•
code—(Optional) Specifies that a numeric operator and ICMP code follows.
•
operator—An operator that the ACE applies to the ICMP code that follows. Enter one of the following operators:
–
lt—Less than.
–
gt—Greater than.
–
eq—Equal to.
–
neq—Not equal to.
–
range—An inclusive range of ICMP code values. When you use this operator, specify two code numbers to define the range.
•
code1, code2—Specifies an ICMP code number that corresponds to an ICMP type. See Table 1-4. If you entered the range operator, enter a second ICMP code value to define the upper limit of the range.
For example, to configure a TCP extended ACL, enter:
host1/Admin(config)# access-list INBOUND line 10 extended permit tcp
192.168.12.0 255.255.255.0 gt 1024 172.27.16.0 255.255.255.0 lt 4000
For example, to remove an entry from an extended ACL, enter:
host1/Admin(config)# no access-list INBOUND line 10
To control ping, specify echo (8) (host to ACE).
For example, to allow an external host with IP address 192.168.12.5 to ping a host behind the ACE with an IP address of 10.0.0.5, enter:
host1/Admin(config)# access-list INBOUND permit icmp host 192.168.12.5
host 10.0.0.5 echo
For example, to remove an entry from an ICMP ACL, enter:
host1/Admin(config)# no access-list INBOUND permit icmp host
192.168.12.5 echo
Configuring Comments in an Extended ACL
You can add comments about an extended ACL to clarify the function of the ACL. To add a comment to an ACL, use the access-list name remark command in configuration mode. You can enter only one comment per ACL and the comment always appears at the beginning of the ACL. The syntax of this command is:
access-list name remark text
•
name—Unique identifier of the ACL. Enter an unquoted text string with a maximum of 64 characters.
•
remark text—Specifies any comments you want to include about the nature of the ACL. Comments appear at the top of the ACL. Enter an unquoted text string with a maximum of 100 alphanumeric characters You can enter leading spaces at the beginning of the text. Trailing spaces are ignored.
For example, enter:
host1/Admin(config)# access-list INBOUND remark This is a remark
For example, to remove entry comments from an ACL, enter:
host1/Admin(config)# no access-list INBOUND line 200 remark
If you delete an ACL using the no access-list name command, then all the remarks are also removed.
Configuring an EtherType ACL
You can configure an ACL that controls traffic based on its EtherType. An EtherType is a sub-protocol identifier. EtherType ACLs support Ethernet V2 frames. EtherType ACLs do not support 802.3-formatted frames because they use a length field as opposed to a type field. The only exception is bridge protocol data units (BPDUs), which are SNAP-encapsulated, and the ACE is designed to specifically handle BPDUs.
For example, you can permit or deny BPDUs. By default, all BPDUs are denied. The ACE receives trunk port (Cisco proprietary) BPDUs because ACE ports are trunk ports. Trunk BPDUs have VLAN information inside the payload, so the ACE modifies the payload with the outgoing VLAN if you allow BPDUs. If you configure redundancy, you must allow BPDUs on both interfaces with an EtherType ACL to avoid bridging loops. For details about configuring redundancy, refer to the Cisco Application Control Engine Module Administration Guide.
If you allow MPLS, ensure that Label Distribution Protocol (LDP) and Tag Distribution Protocol (TDP) TCP connections are established through the ACE by configuring both MPLS routers connected to the ACE to use the IP address on the ACE interface as the router-id for LDP or TDP sessions. LDP and TDP allow MPLS routers to negotiate the labels (addresses) used to forward packets.
Note
You can configure an EtherType ACL only on a Layer 2 interface in the inbound direction.
On Cisco IOS routers, enter the appropriate command for your protocol, LDP or TDP. The interface is the interface connected to the ACE:
host1/Admin(config)# mpls ldp router-id interface force
or
host1/Admin(config)# tag-switching tdp router-id interface force
Tip
Enter the ACL name in upper case letters so that the name is easy to see in the configuration. You may want to name the ACL for the interface (for example, INBOUND), or for the purpose (for example, MPLS).
To configure an EtherType ACL, use the access-list ethertype command in configuration mode. The syntax of this command is:
access-list name ethertype {deny | permit} {any | bpdu | ipv6 | mpls}
The keywords and arguments are:
•
name—Unique identifier of the ACL. Enter an unquoted text string with no spaces and a maximum of 64 alphanumeric characters.
•
ethertype—A name that specifies a sub-protocol. Valid values are:
–
deny—Blocks connections on the assigned interface
–
permit—Allows connections on the assigned interface
–
any—Any Ethertype
–
bpdu—Bridge protocol data units
–
ipv6—Internet Protocol version 6
–
mpls—Multi-Protocol Label Switching
Note
When you specify the mpls keyword in an Ethertype ACL, the ACE denies or permits both MPLS-unicast and MPLS-multicast traffic.
For example, to configure an Ethertype ACL for MPLS, enter:
host1/Admin(config)# access-list INBOUND ethertype permit mpls
To remove an entry from an EtherType ACL, enter:
host1/Admin(config)# no access-list INBOUND ethertype permit mpls
Resequencing Entries
To resequence the entries in an ACL with a specific starting number and interval, use the access-list name resequence command in configuration mode. The syntax of this command is:
access-list name resequence [number1][number2]
•
name—Unique identifier of the ACL. Enter an unquoted text string with a maximum of 64 characters.
•
resequence—Keyword that specifies the renumbering of the entries in an ACL.
•
number1—Number assigned to the first entry in the ACL. Enter any integer. The default is 10.
•
number2—Number added to each entry in the ACL after the first entry. Enter any integer. The default is 10.
For example, enter:
host1/Admin(config)# access-list INBOUND resequence 5 15
Applying an ACL to an Interface
Before you can start using a configured ACL, you must apply it to one or more interfaces.
To apply an ACL to the inbound or outbound direction of an interface and make the ACL active, use the access-group command in interface configuration mode. You can apply one ACL of each type (extended and EtherType) to both directions of the interface. See the "Inbound and Outbound ACLs" section for more information about ACL directions.
Note
If you have already applied a global ACL to all interfaces in a context, you cannot apply another ACL to an individual interface in that context. For details about applying an ACL globally, see the "Applying an ACL Globally to All Interfaces in a Context" section.
For connectionless protocols, you need to apply the ACL to the source and destination interfaces if you want traffic to pass in both directions. For example, you can allow BGP in an ACL in transparent mode, and you need to apply the ACL to both interfaces.
The syntax of this command is:
access-group {input | output} acl_name
The keywords and arguments are:
•
input | output—Specifies the direction (inbound or outbound) of the interface in which you want to apply the ACL
•
acl_name—Identifier of an existing ACL that you want to apply to an interface. Enter an unquoted text string with no spaces and a maximum of 64 alphanumeric characters.
For example, enter:
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INBOUND
To remove an ACL from an interface, enter:
host1/Admin(config-if)# no access-group input INBOUND
Applying an ACL Globally to All Interfaces in a Context
You can apply an ACL to all interfaces in a context at once, subject to the following conditions:
•
No interface in the context has an ACL applied to it
•
You can globally apply one Layer 2 and one Layer 3 ACL in the inbound direction only
•
On Layer 2 bridged-group virtual interfaces (BVIs), you can apply both Layer 3 and Layer 2 ACLs
•
On Layer 3 virtual LAN (VLAN) interfaces, you can apply only Layer 3 ACLs
•
In a redundancy configuration, the ACE does not apply a global ACL to the FT VLAN. For details about redundancy, refer to the Cisco Application Control Engine Module Administration Guide.
To apply an ACL globally to all interfaces in a context in the inbound direction, use the access-group command in configuration mode. The syntax of this command is:
access-group input acl_name
For the acl_name argument, enter the identifier of an existing ACL as an unquoted text string with no spaces and a maximum of 64 alphanumeric characters.
You can use this command to allow all traffic on all interfaces in a context by applying an ACL similar to the following example:
host1/Admin(config)# access-list ALL_ACCESS permit ip any any
Then, apply the ACL globally, by entering:
host1/Admin(config)# access-group input ALL_ACCESS
To remove the ACL from all interfaces in the context, enter:
host1/Admin(config)# no access-group input ALL_ACCESS
Filtering Traffic with an ACL
You can use an ACL to filter interesting traffic and instruct the ACE to either permit or deny the traffic based on the action in the ACL. To filter traffic using an ACL, use the match access-list command in a Layer 3 and Layer 4 class map.
When a packet matches an entry in an ACL, and if it is a permit entry, the ACE allows the matching result. If it is a deny entry, the ACE blocks the matching result. For details about configuring a Layer 3 and Layer 4 class map and policy map, refer to the Cisco Application Control Engine Module Administration Guide.
ACL Configurational Examples
This section provide examples of the different types of ACLs available in the ACE. It includes the following subsections:
•
Examples of Extended ACLs
•
Examples of Ethertype ACLs
Examples of Extended ACLs
This section provides examples of extended ACLs. Use extended ACLs when you want to specify both the source IP address and the destination IP address (IP), ports (TCP or UDP), and ICMP types. For details about configuring extended ACLs, see the "Configuring an Extended ACL" section.
The following ACL allows all hosts (on the interface to which you apply the ACL) to go through the ACE:
host1/Admin(config)# access-list ACL_IN extended permit ip any any
The following ACL prevents hosts on 192.168.1.0/24 from accessing the 209.165.201.0/27 network. All other addresses are permitted:
host1/Admin(config)# access-list ACL_IN extended deny tcp 192.168.1.0
255.255.255.0 209.165.201.0 255.255.255.224
host1/Admin(config)# access-list ACL_IN extended permit ip any any
If you want to restrict access to only some hosts, then enter a limited permit entry. By default, all other traffic is denied unless explicitly permitted.
host1/Admin(config)# access-list ACL_IN extended permit ip 192.168.1.0
255.255.255.0 209.165.201.0 255.255.255.224
For a list of permitted keywords and well-known port assignments, refer to Table 1-2. DNS, Discard, Echo, Ident, NTP, RPC, SUNRPC, and Talk each require one definition for TCP and one for UDP. TACACS+ requires one definition for port 49 on TCP.
The following ACL example restricts all hosts (on the interface to which you apply the ACL) from accessing a website at address 209.165.201.29. All other traffic is allowed.
host1/Admin(config)# access-list ACL_IN extended deny tcp any host
209.165.201.29 eq www
host1/Admin(config)# access-list ACL_IN extended permit ip any any
The following ACLs allow all inside hosts to communicate with the outside network, but only specific outside hosts to access the inside network:
host1/Admin(config)# access-list OUT extended permit ip any any
host1/Admin(config)# access-list IN extended permit ip host
209.168.200.3 any
host1/Admin(config)# access-list IN extended permit ip host
209.168.200.4 any
The following examples illustrate ICMP ACLs. For details about configuring ICMP ACLs, see the "Configuring an Extended ACL" section.
host1/Admin(config)# access-list INBOUND extended permit icmp any any
echo
host1/Admin(config)# access-list INBOUND extended permit icmp host
10.0.0.1 host 20.0.0.1 unreachable code range 0 3
Inbound and Outbound ACLs
Traffic flowing across an interface in the ACE can be controlled in two ways:
•
Traffic that enters the ACE can be controlled by attaching an inbound ACL to the source interface
•
Traffic that exits the ACE can be controlled by attaching an outbound ACL to the destination interface
To allow any traffic to enter the ACE, you must attach an inbound permit ACL to an interface; otherwise, the ACE automatically refuses all traffic that enters that interface. By default, traffic can exit the ACE on any interface unless you restrict it using an outbound ACL, which adds restrictions to those already configured in the inbound ACL.
Note
Inbound and outbound refer to the application of an ACL on an interface, either to traffic entering the ACE on an interface or traffic exiting the ACE on an interface. These terms do not refer to the movement of traffic from a lower security interface to a higher security interface, commonly known as inbound, or from a higher to lower interface, commonly known as outbound.
You may want to use an outbound ACL to simplify your ACL configuration. For example, if you want to allow three inside networks on three different interfaces to access each other, you can create a simple inbound ACL that allows all traffic on each inside interface. (See Figure 1-1.)
Figure 1-1 Inbound ACLs
See the following commands for this example:
host1/Admin(config)# access-list INSIDE extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
host1/Admin(config)# access-list HR extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
host1/Admin(config)# access-list ENG extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
Then, if you want to allow only certain hosts on the inside networks to access a web server on the outside network, you can create a more restrictive ACL that allows only the specified hosts and apply it to the outbound direction of the outside interface (see Figure 1-2). For information about NAT and IP addresses, see the "IP Addresses for ACLs with NAT" section. The outbound ACL prevents any other hosts from reaching the outside network.
See the following commands for this example:
host1/Admin(config)# access-list INSIDE extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
host1/Admin(config)# access-list HR extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
host1/Admin(config)# access-list ENG extended permit ip any any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
host1/Admin(config)# access-list OUTSIDE extended permit tcp host
209.165.201.4 host 209.165.200.225 eq www
host1/Admin(config)# access-list OUTSIDE extended permit tcp host
209.165.201.6 host 209.165.200.225 eq www
host1/Admin(config)# access-list OUTSIDE extended permit tcp host
209.165.201.8 host 209.165.200.225 eq www
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group output OUTSIDE
Figure 1-2 Outbound ACL
IP Addresses for ACLs with NAT
When you use NAT, the IP addresses you specify for an ACL depend on the interface to which the ACL is attached. You need to use addresses that are valid on the network that is connected to the interface. This guideline applies for both inbound and outbound ACLs: the direction does not determine the address used, only the interface does.
For example, suppose that you want to apply an ACL to the inbound direction of the interface. You configure the ACE to perform NAT on the inside source addresses when they access outside addresses. Because the ACL is applied to the inside interface, the source addresses are the original untranslated addresses. Because the outside addresses are not translated, the destination address used in the ACL is the real address (see Figure 1-3).
Figure 1-3 IP Addresses in ACLs: NAT Used for Source Addresses
See the following commands for this example:
host1/Admin(config)# access-list INSIDE extended permit ip 10.1.1.0
255.255.255.0 host 209.165.200.225
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
If you want to allow an outside host to access an inside host, you can apply an inbound ACL on the outside interface. You need to specify the translated address of the inside host in the ACL because that address is the address that can be used on the outside network. (See Figure 1-4.)
Figure 1-4 IP Addresses in ACLs: NAT used for Destination Addresses
See the following commands for this example:
host1/Admin(config)# access-list OUTSIDE extended permit ip host
209.165.200.225 host 209.165.201.5
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input OUTSIDE
If you perform NAT on both interfaces, then keep in mind the addresses that are visible to a given interface. In Figure 1-5, an outside server uses static NAT so that a translated address appears on the inside network.
Figure 1-5 IP Addresses in ACLs: NAT used for Source and Destination Addresses
See the following commands for this example:
host1/Admin(config)# access-list INSIDE extended permit ip 10.1.1.0
255.255.255.0 host 10.1.1.56
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input INSIDE
For an example of IP addresses used in outbound ACLs, see Figure 1-2.
Examples of Ethertype ACLs
This section provides examples of Ethertype ACLs. For details about configuring an EtherType ACL, see the "Configuring an EtherType ACL" section.
For example, the following sample ACL allows common EtherTypes originating on the inside interface:
host1/Admin(config)# access-list ETHER ethertype permit ipv6
host1/Admin(config)# access-list ETHER ethertype permit bpdu
host1/Admin(config)# access-list ETHER ethertype permit mpls
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group output ethertype ETHER
The following ACL allows some EtherTypes through the ACE, but denies IPX:
host1/Admin(config)# access-list ETHER ethertype deny ipx
host1/Admin(config)# access-list ETHER ethertype permit bpdu
host1/Admin(config)# access-list ETHER ethertype permit mpls
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input ethertype ETHER
The following ACL denies traffic with EtherType bpdu but allows all others on both interfaces:
host1/Admin(config)# access-list nonIP ethertype deny bpdu
host1/Admin(config)# access-list nonIP ethertype permit any
host1/Admin(config)# interface vlan 100
host1/Admin(config-if)# access-group input ethertype nonIP
Displaying ACL Configurational Information and Statistics
This section describes the show commands you can use to display ACL configurations and statistics. It includes the following subsections:
•
Displaying ACL Configurational Information
•
Displaying ACL Statistics
Displaying ACL Configurational Information
To display all ACL configurational information, including the interfaces on which you applied the ACLs, use the show running-config command. The syntax of this command is:
show running-config
To display only the ACLs and their entries, use the show running-config access-list command in Exec mode. The syntax of this command is:
show running-config access-list
Displaying ACL Statistics
To display ACL statistics for a particular ACL, use the show access-list command. The syntax of this command is:
show access-list name
For the name argument, enter the name of an existing ACL as an unquoted text string with no spaces and a maximum of 64 alphanumeric characters.
Table 1-5 describes the fields in the show access-list command output.
Table 1-5 Field Descriptions for the show access-list Command Output
Field
|
Description
|
Access-list
|
Name of the security ACL
|
Elements
|
Number of entries in the ACL
|
Status
|
Displays the current status of the ACL: active when the ACL is associated with at least one interface or not active when the ACL is not associated with at least one interface
|
Remark
|
Configured comments describing the ACL
|
Entries and Hitcounts
|
Full text of all entries in the ACL and their respective hit counts
|
Clearing ACL Statistics
To clear ACL statistics (hit counts for ACL entries), use the clear access-list command in Exec mode. The syntax of this command is:
clear access-list name
The name argument identifies an existing ACL. Enter an unquoted text string with no spaces and a maximum of 64 alphanumeric characters.
For example, enter:
host1/Admin# clear access-list acl1
Note
If you have redundancy configured, then you need to explicitly clear ACL statistics (hit counts) on both the active and the standby ACEs. Clearing statistics on the active module alone will leave the standby module's statistics at the old value.