icmp
To configure access rules for ICMP traffic that terminates at the Secure Firewall ASA interface, use the icmp command. To remove the configuration, use the no form of this command.
icmp { permit | deny } ip_address net_mask [ icmp_type ] if_name
no icmp { permit | deny } ip_address net_mask [ icmp_type ] if_name
Syntax Description
deny |
Deny access if the conditions are matched. |
icmp_type |
(Optional) ICMP message type (see Table 1-1). |
if_name |
The interface name. |
ip_address |
The IP address of the host sending ICMP messages to the interface. |
net_mask |
The network mask to be applied to the IP address of the host. |
permit |
Permit access if the conditions are matched. |
Command Default
The default behavior of the ASA is to allow all ICMP traffic to the ASA interfaces.
Command Modes
The following table shows the modes in which you can enter the command:
Command Mode |
Firewall Mode |
Security Context |
|||
---|---|---|---|---|---|
Routed |
Transparent |
Single |
Multiple |
||
Context |
System |
||||
Global Configuration |
|
|
|
|
|
Command History
Release |
Modification |
---|---|
7.0(1) |
This command was added. |
Usage Guidelines
The icmp command controls ICMP traffic that terminates on any ASA interface. If no ICMP control list is configured, then the ASA accepts all ICMP traffic that terminates at any interface, including the outside interface. However, by default, the ASA does not respond to ICMP echo requests directed to a broadcast address.
The ASA only responds to ICMP traffic sent to the interface that traffic comes in on; you cannot send ICMP traffic through an interface to a far interface.
VPN access to an interface other than the one from which you entered the ASA is not supported. For example, if your VPN access is located on the outside interface, you can only initiate a connection directly to the outside interface. You should enable VPN on the directly accessible interface of the ASA and use name resolution so that you don’t have to remember multiple addresses.
The icmp deny command disables pinging to an interface, and the icmp permit command enables pinging to an interface. With pinging disabled, the ASA cannot be detected on the network. This is also referred to as configurable proxy pinging.
Use the access-list extended or access-group command for ICMP traffic that is routed through the ASA for destinations on a protected interface.
We recommend that you grant permission for the ICMP unreachable message type (type 3). Denying ICMP unreachable messages disables ICMP path MTU discovery, which can halt IPsec and PPTP traffic. See RFC 1195 and RFC 1435 for details about path MTU discovery.
If an ICMP control list is configured for an interface, then the ASA first matches the specified ICMP traffic and then applies an implicit deny for all other ICMP traffic on that interface. That is, if the first matched entry is a permit entry, the ICMP packet continues to be processed. If the first matched entry is a deny entry or an entry is not matched, the ASA discards the ICMP packet and generates a syslog message. An exception is when an ICMP control list is not configured; in that case, a permit statement is assumed.
The following table lists the supported ICMP type values.
ICMP Type |
Literal |
Description |
---|---|---|
0 |
echo-reply |
The echo reply is the response to an echo request to indicate successful communication. |
3 |
unreachable |
The device could not deliver a package to the final desination. |
8 |
echo |
The echo message that carries the address of the source. This address is the destination for the echo-reply message. |
11 |
time-exceeded |
During processing of a package, the device identifies the Time-To-Live value equal to zero and therefore the package is discarded. |
Examples
The following example denies all ping requests and all incoming ICMP connections in general, except for unreachable messages, at the outside interface:
ciscoasa(config)# icmp permit any unreachable outside
Continue entering the icmp deny any interface command for each additional interface on which you want to deny ICMP traffic.
The following example permits host 172.16.2.15 or hosts on subnet 172.22.1.0/16 to ping the outside interface:
ciscoasa(config)# icmp permit host 172.16.2.15 echo outside
ciscoasa(config)# icmp permit 172.22.1.0 255.255.0.0 echo outside
ciscoasa(config)# icmp permit any unreachable outside