The service protocol command adds items to a user-defined service set of the object type.
The undo service command deletes items from a user-defined service set.
Add items for the service object.
For TCP, SCTP or UDP:
service [ id ] protocol protocol [ source-port { src-port-number-1 [ to src-port-number-2 ] } &<1-64> | destination-port { dst-port-number-1 [ to dst-port-number-2 ] } &<1-64> ] * [ description description ]
For ICMP:
service [ id ] protocol protocol [ icmp-type { icmp-type-name | icmp-type-number { icmp-code [ to icmpv-code1 ] } &<1-64> } ] [ description description ]
For ICMPv6:
service [ id ] protocol protocol [ icmpv6-type { icmpv6-type-name | icmpv6-type-number { icmpv6-code [ to icmpv6-code1 ] } &<1-64> } ] [ description description ]
For other protocols:
service [ id ] protocol protocol [ description description ]
Delete items for the service object.
undo service id [ protocol { udp | tcp | sctp } { source-port { src-port-number-1 [ to src-port-number-2 ] } &<1-64> | destination-port { dst-port-number-1 [ to dst-port-number-2 ] } &<1-64> } * ]
| Parameter | Description | Value |
|---|---|---|
| id | Specifies the ID of an item in a user-defined service set. | The value is an integer. For the range value, see
|
| protocol protocol | Specifies the protocol by protocol name or protocol number. |
It can be an integer ranging from 0 to 255 or a string, such as icmp, icmpv6, tcp, udp, and sctp, with the protocol ID being 1, 58, 6, 17, and 132. |
| udp | Indicates the User Datagram Protocol (UDP). | - |
| tcp | Indicates the Transmission Control Protocol (TCP). | - |
| sctp | Indicates the Stream Control Transmission Protocol (SCTP). | - |
| source-port { src-port-number-1 [ to src-port-number-2 ] } | Indicates the source port range. |
|
| destination-port { dst-port-number-1 [ to dst-port-number-2 ] } | Indicates the destination port range. |
|
| description description | Specifies the description of the item in the user-defined service set. | The value is a string of 1 to 64 characters without spaces. |
| icmp-type icmp-type-name | Specifies the ICMP packet type name. This parameter applies only to ICMP. If no parameters are set, all ICMP messages will be matched. | For icmp-type-name values, see Table 1. |
| icmp-type icmp-type-number icmp-code [ to icmpv-code1 ] | Specifies the ICMP packet type number and ICMP message code or code range. This parameter applies only to ICMP. If no parameters are set, all ICMP messages will be matched. | For icmp-type-number and icmp-code values, see Table 1. |
| icmpv6-type icmpv6-type-name | Specifies the ICMPv6 packet type name. This parameter applies only to ICMPv6. If no parameters are set, all ICMPv6 messages will be matched. | For icmp-type-name values, see Table 2. |
| icmpv6-type icmpv6-type-number icmpv6-code [ to icmpv6-code1 ] | Specifies the ICMPv6 packet type number and ICMPv6 message code or code range. This parameter applies only to ICMPv6. If no parameters are set, all ICMPv6 messages will be matched. | For icmp-type-number and icmp-code values, see Table 2. |
icmp-type-name |
icmp-type-number |
icmp-code |
|---|---|---|
Echo |
8 |
0 |
Echo-reply |
0 |
0 |
Parameter-problem |
12 |
0 |
Port-unreachable |
3 |
3 |
Protocol-unreachable |
3 |
2 |
Reassembly-timeout |
11 |
1 |
Source-quench |
4 |
0 |
Source-route-failed |
3 |
5 |
Timestamp-reply |
14 |
0 |
Timestamp-request |
13 |
0 |
Ttl-exceeded |
11 |
0 |
Fragmentneed-DFset |
3 |
4 |
Host-redirect |
5 |
1 |
Host-tos-redirect |
5 |
3 |
Host-unreachable |
3 |
1 |
Information-reply |
16 |
0 |
Information-request |
15 |
0 |
Net-redirect |
5 |
0 |
Net-tos-redirect |
5 |
2 |
Net-unreachable |
3 |
0 |
icmpv6-type-name |
icmpv6-type-number |
icmpv6-code |
|---|---|---|
Redirect |
137 |
0 |
Echo |
128 |
0 |
Echo-reply |
129 |
0 |
Err-Header-field |
4 |
0 |
Frag-time-exceeded |
3 |
1 |
Hop-limit-exceeded |
3 |
0 |
Host-admin-prohib |
1 |
1 |
Host-unreachable |
1 |
3 |
Neighbor-advertisement |
136 |
0 |
Neighbor-solicitation |
135 |
0 |
Network-unreachable |
1 |
0 |
Packet-too-big |
2 |
0 |
Port-unreachable |
1 |
4 |
Router-advertisement |
134 |
0 |
Router-solicitation |
133 |
0 |
Unknown-ipv6-opt |
4 |
2 |
Unknown-next-hdr |
4 |
1 |
An ID is the unique identifier of an item in a service set. If no ID is specified, the system automatically assigns an ID to each item.
# Add an item to user-defined service set set1 and configure the protocol, source port number, and destination port number for the item.
<sysname> system-view [sysname] ip service-set set1 type object [sysname-object-service-set-set1] service protocol tcp source-port 8000 destination-port 7000