port (port object group view)

Use port to configure a port object.

Use undo port to delete a port object.

Syntax

[ object-id ] port { { eq | lt | gt } port | range port1 port2 | group-object object-group-name }

undo port { { eq | lt | gt } port | range port1 port2 | group-object object-group-name }

undo object-id

Default

No port objects exist.

Views

Port object group view

Predefined user roles

network-admin

mdc-admin

Parameters

object-id: Specifies an object ID in the range of 0 to 4294967294. If you do not specify an object ID, the system automatically assigns the object a multiple of 10 next to the greatest ID being used. For example, if the greatest ID is 22, the system automatically assigns 30.

eq: Configures a port object with a port number equal to the specified port.

lt: Configures a port object with a port number smaller than the specified port.

gt: Configures a port object with a port number greater than the specified port.

port: Specifies a port number in the range of 0 to 65535.

range port1 port2: Configures a port object with a port range. The value range for the port1 and port2 arguments is 0 to 65535.

group-object object-group-name: Specifies a port object group by its name, a case-insensitive string of 1 to 31 characters.

Usage guidelines

This command fails if you use it to configure or change a port object to be identical with an existing object.

This command creates a port object if the specified object ID does not exist. Otherwise, the command overwrites the configuration of the specified object.

When you use the lt port option, follow these guidelines:

When you use the gt port option, follow these guidelines:

When you use the range port1 port2 option, follow these guidelines:

When you use the group-object object-group-name option, follow these guidelines:

Examples

# Configure a port object with a port number of 100.

<Sysname> system-view
[Sysname] object-group port portgroup
[Sysname-obj-grp-port-portgroup] port eq 100

# Configure a port object with a port number smaller than 20.

<Sysname> system-view
[Sysname] object-group port portgroup
[Sysname-obj-grp-port-portgroup] port lt 20

# Configure a port object with a port number greater than 60000.

<Sysname> system-view
[Sysname] object-group port portgroup
[Sysname-obj-grp-port-portgroup] port gt 60000

# Configure a port object with a port number in the range of 1000 to 2000.

<Sysname> system-view
[Sysname] object-group port portgroup
[Sysname-obj-grp-port-portgroup] port range 1000 2000

# Configure a port object using object group portgroup2.

<Sysname> system-view
[Sysname] object-group port portgroup
[Sysname-obj-grp-port-portgroup] port group-object portgroup2