All Products
Search
Document Center

Anti-DDoS:ModifyNetworkRuleAttribute

Last Updated:Dec 16, 2025

Modifies the session persistence and DDoS mitigation policy settings for 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-ddoscoo:ModifyNetworkRuleAttribute

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the Anti-DDoS Pro or Anti-DDoS Premium instance.

Note

Call DescribeInstanceIds to query the IDs of all Anti-DDoS Pro and Anti-DDoS Premium instances.

ddoscoo-cn-mp91j1ao****

ForwardProtocol

string

Yes

The forwarding protocol. Valid values:

  • tcp

  • udp

tcp

FrontendPort

integer

Yes

The forwarding port.

8080

Config

string

Yes

The advanced settings for the port forwarding rule. Specify the settings as a JSON string. The structure is described below. The structure of `TcpConfig` is as follows:

  • PersistenceTimeout: An integer. This parameter is required. The timeout period for session persistence. Unit: seconds. Valid values: 30 to 3600. The default value is 0, which disables session persistence.

  • Synproxy: A string. This parameter is required. The status of the False Source setting for the DDoS mitigation policy. Valid values: `off` and `on`.

  • NodataConn: A string. This parameter is required. The status of the Empty Connection setting for the DDoS mitigation policy. Valid values: `off` and `on`.

  • Sla: A struct. This parameter is required. The configuration for destination rate limiting. For more information, see the `Sla` section below.

  • Slimit: A struct. This parameter is required. The configuration for source rate limiting. For more information, see the `Slimit` section below.

  • PayloadLen: A struct. This parameter is required. The packet length filter configuration. For more information, see the `PayloadLen` section below.

The structure of `Sla` is as follows:

  • Cps: An integer. This parameter is required. The maximum number of new connections per second to a destination IP address. Valid values: 100 to 100,000.

  • Maxconn: An integer. This parameter is required. The maximum number of concurrent connections to a destination IP address. Valid values: 1,000 to 1,000,000.

  • CpsEnable: An integer. This parameter is required. Specifies whether to enable the limit on new connections. Valid values: 0 (disabled) and 1 (enabled). The default value is 1.

  • MaxconnEnable: An integer. This parameter is required. Specifies whether to enable the limit on concurrent connections. Valid values: 0 (disabled) and 1 (enabled). The default value is 1.

The structure of `Slimit` is as follows:

  • Cps: An integer. This parameter is required. The maximum number of new connections per second from a source IP address. Valid values: 1 to 50,000.

  • Maxconn: An integer. This parameter is required. The maximum number of concurrent connections from a source IP address. Valid values: 1 to 50,000.

  • CpsEnable: An integer. This parameter is required. Specifies whether to enable the limit on new connections. Valid values: 0 (disabled) and 1 (enabled). The default value is 1.

  • MaxconnEnable: An integer. This parameter is required. Specifies whether to enable the limit on concurrent connections. Valid values: 0 (disabled) and 1 (enabled). The default value is 1.

  • CpsMode: An integer. This parameter is required. The mode for the new connection rate limit from a source IP address. Valid values: 1 (off) and 2 (auto).

The structure of `PayloadLen` is as follows:

  • Min: An integer. This parameter is required. The minimum packet length. Valid values: 0 to 1,500.

  • Max: An integer. This parameter is required. The maximum packet length. Valid values: 0 to 1,500.

{"Slimit":{"CpsEnable":1,"MaxconnEnable":1,"Cps":1,"Maxconn":1},"Sla":{"CpsEnable":1,"MaxconnEnable":1,"Cps":100,"Maxconn":1000},"PayloadLen":{"Min":0,"Max":1500}}

Module

string

No

The module for Layer 7 port support. The default value is sla. Valid value:

sla: Speed Limit for Destination

sla

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc

Examples

Success response

JSON format

{
  "RequestId": "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.