Add Local Source IP Port Translation

Last updated: 2020-06-04 18:28:04


    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (CreateLocalSourceIPPortTranslationNatRule) is used to add local source IP port translation for Direct Connect gateway.
    Domain for API

    1) The source IP port within the VPC is mapped to specified IP pool. A random port of random IP is used to access actively. Only NAT Direct Connect gateways are supported.
    2) The translated IP pool cannot be in the VPC network segment. IP pool supports a single IP, IP segment (such as and CIDR format.

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is CreateLocalSourceIPPortTranslationNatRule.

    Parameter Name Required Type Description
    vpcId Yes String The Virtual Private Cloud ID assigned by the system. Both the vpcId before upgrading, and the upgraded unVpcId are supported. For example: vpc-dgd45.
    directConnectGatewayId Yes String Direct Connect gateway ID assigned by the system, for example: dcg-dgd454d.
    localSourceIPPortTranslation.n Yes Array local source address translation array.
    localSourceIPPortTranslation.n.translationIPPool Yes String Translated IP pool.
    localSourceIPPortTranslation.n.description No String Note.

    3. Output Parameters

    Parameter Name Type Description
    code Int Common error code. A value of 0 indicates success, and other values indicate failure. For more information, please refer to Common Error Codes on the Error Code page.
    message String Module error message description depending on API.
    data Array Returned data
    data.taskId Int Task ID. The operation result can be queried with taskId.
    codeDesc String Error code

    4. Error Code Table

    The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

    Error code Description
    InvalidVpc.NotFound Invalid VPC. VPC resource does not exist. Please verify that the resource information you entered is correct. This can be queried via the Query Virtual Private Cloud List (DescribeVpcEx) API.
    InvalidDirectConnectGateway.NotFound Invalid Direct Connect gateway. Direct Connect gateway resource does not exist. Please verify that the resource information you entered is correct. This can be queried via the Query Direct Connect Gateway (DescribeDirectConnectGateway) API.
    InvalidTranslationIPPool.NotInVpcCidr Invalid translated IP pool. The translated IP pool is not in the VPC network segment.
    InvalidTranslationIP.Duplicate Invalid translated IP pool. Duplication of translated IP pool. The translated IP pool has already existed in the local source IP port translation rules of the gateway. The translated IP pool must be unique.
    LocalSourceIPPortTranslationLimitExceeded The local source IP port translation rules you added have reached the upper limit. Please contact customer service for more resources. For more information on VPC resource restrictions, refer to VPC Usage Restrictions.

    5. Example

    &Common request parameters



    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback