match protocol

Configures protocol-based matching for a route-map sequence number.

Syntax

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

Command Default

Protocol-based matching is not configured.

Parameters

eq protocol-1
Specifies that matching occurs when the traffic IP protocol is equal to the specified protocol. The protocol can be specified in either name or number format.
gt protocol-1
Specifies that matching occurs when the traffic IP protocol is greater than the specified protocol. The protocol can be specified in either name or number format.
lt protocol-1
Specifies that matching occurs when the traffic IP protocol is less than the specified protocol. The protocol can be specified in either name or number format.
neq protocol-1 [protocol-32 ]
Specifies that matching occurs when the traffic IP protocol is not equal to all of the specified protocols. You can specify a maximum of 32 protocols. Protocols can be specified in either name or number format.
range protocol-1 protocol-2
Specifies that matching occurs when the traffic IP protocol is within the specified range of protocols. Protocols rotocol can be specified in either name or number format.

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.

When match protocol and match ip icmp-type 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.

When match protocol and match port, match source-port, or match destination-port are specified in the same stanza, the protocol specified by the match protocol command must be either TCP or UDP.

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

When multiple match protocol statements of the same type exist, matching occurs when traffic matches any one of the statements.

Only one match protocol 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 protocol-based matching for sequence number 4 in a route-map named rm; a match occurs when traffic is not equal to 34 and 56 and 67.

device# configure terminal
device(config)# route-map rm permit 4
device(config-route-map-rm/permit/4)# match protocol neq 34 56 67

The following example shows how to configure matching based on a range of protocols (3 through 10) for sequence number 4 in a route-map named rm.

device# configure terminal
device(config)# route-map rm permit 4
device(config-route-map-rm/permit/4)# match protocol range 3 10