match destination-port

Configures matching based on UDP or TCP destination port for a route-map sequence number.

Syntax

match destination-port { eq | gt | lt } port-num-1
match destination-port neq port-num-1 [ ... port-num-32 ]
match destination-port range port-num-1 port-num-2
no match destination-port { eq | gt | lt } port-num-1
no match destination-port neq port-num-1 [ ... port-num-32 ]
no match destination-port range port-num-1 port-num-2

Command Default

Matching based on destination port is not configured.

Parameters

eq port-num-1
Specifies that matching occurs when the packet destination port is equal to the specified port number, which must be a valid UDP or TCP port number in the range from 0 through 65535.
gt port-num-1
Specifies that matching occurs when the packet destination port is greater than the specified port number, which must be a valid UDP or TCP port number in the range from 0 through 65535.
lt port-num-1
Specifies that matching occurs when the packet destination port is less than the specified port number, which must be a valid UDP or TCP port number in the range from 0 through 65535.
neq port-num-1 [ ... port-num-32 ]
Specifies that matching occurs when the packet destination port is not equal to all of the specified ports. You can specify a maximum of 32 ports. Specified ports must be valid UDP or TCP port numbers in the range from 0 through 65535.
range port-num-1 port-num-2
Specifies that matching occurs when the packet destination port is within the specified range of port numbers, which must be valid UDP or TCP port numbers in the range from 0 through 65535.

Modes

Route-map configuration mode

Usage Guidelines

When match protocol and 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 destination-port statements are allowed per route-map sequence number for the following options:
  • eq
  • range

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

Only one match destination-port 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 destination port number 45 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 destination-port eq 45

The following example shows how to configure matching based on destination port for sequence number 4 in a route-map named rm; a match occurs when traffic destination port 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 destination-port neq 34 56 67