All Products
Search
Document Center

Anti-DDoS:CreateNetworkRules

Last Updated:Feb 25, 2026

Creates a port forwarding rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

NetworkRules

string

Yes

The details of the port forwarding rule. This parameter is a JSON string. The string contains the following fields:

  • InstanceId: the ID of the instance. This field is required and must be of the STRING type.

  • Protocol: the forwarding protocol. This field is required and must be of the STRING type. Valid values: tcp and udp.

  • FrontendPort: the forwarding port. This field is required and must be of the INTEGER type.

  • BackendPort: the port of the origin server. This field is required and must be of the INTEGER type.

  • RealServers: the IP addresses of the origin server. This field is required and must be a JSON array. You can specify up to 20 IP addresses.

[{"InstanceId":"ddoscoo-cn-mp91j1ao****","Protocol":"tcp","FrontendPort":8080,"BackendPort":8080,"RealServers":["1.1.1.1","2.2.2.2"]}]

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

ADCA45A5-D15C-4B7D-9F81-138B0B36D0BD

Examples

Success response

JSON format

{
  "RequestId": "ADCA45A5-D15C-4B7D-9F81-138B0B36D0BD"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.