match ip icmp-code

Configures matching based on Internet Control Message Protocol (ICMP) code for a route-map sequence number.

Syntax

match ip icmp-code { eq | gt | lt } icmp-code-1
match ip icmp-code neq icmp-code-1 [icmp-code-32 ]
match ip icmp-code range icmp-code-1 icmp-code-2
no match ip icmp-code { eq | gt | lt } icmp-code-1
no match ip icmp-code neq icmp-code-1 [icmp-code-32 ]
no match ip icmp-code range icmp-code-1 icmp-code-2

Command Default

Matching based on ICMP code is not configured.

Parameters

eq icmp-code-1
Specifies that matching occurs when the packet ICMP code is equal to the specified ICMP code or well-known ICMP code value.
gt icmp-code-1
Specifies that matching occurs when the packet ICMP code is greater than the specified ICMP code or well-known ICMP code value.
lt icmp-code-1
Specifies that matching occurs when the packet ICMP code is less than the specified ICMP code or well-known ICMP code value.
neq icmp-code-1 [icmp-code-32 ]
Specifies that matching occurs when the packet ICMP code is not equal to all of the specified ICMP codes or well-known ICMP code values. You can specify a maximum of 32 codes or code values.
range icmp-code-1 icmp-code-2
Specifies that matching occurs when the packet ICMP code is within the range of specified ICMP codes or well-known ICMP code values.

Modes

Route-map configuration mode

Usage Guidelines

When match protocol and match ip icmp-code are specified in the same stanza, the protocol specified by the match protocol command must be ICMP; specifying any other protocol value using the match protocol command results in the rule being evaluated as false and it becomes inactive.

Up to 128 match ip icmp-code statements are allowed per route-map sequence number for the following options:
  • eq
  • range

When multiple match ip icmp-code statements of the same type exist, matching occurs when traffic matches any one of the statements.

Only one match ip icmp-code statement is allowed per route-map sequence number for the following options:
  • lt
  • gt
  • neq
Note

Note

Configuring the range option may create a lot of TCAM entries (due to rule expansion).

The no form of the command disables the configuration.

Examples

The following example shows how to configure matching based on ICMP codes in the range from 3 through 5.

device# configure terminal
device(config)# route-map rm permit 4
device(config-route-map-rm/permit/4)# match ip icmp-code range 3 5