Add Local Source IP Port Translation

Last updated: 2019-11-29 19:30:35

    1. API Description

    This API (CreateLocalSourceIPPortTranslationNatRule) is used to add local source IP port translation for Direct Connect gateway.
    Domain for API request:vpc.api.qcloud.com

    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 183.63.0.1-183.63.0.10) 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

    Input

    https://vpc.api.qcloud.com/v2/index.php?Action=CreateLocalSourceIPPortTranslationNatRule
    &vpcId=vpc-csnmo39l
    &directConnectGatewayId=dcg-mm01ughx
    &localSourceIPPortTranslation.0.translationIPPool=183.12.63.0-183.12.63.20
    &localSourceIPPortTranslation.0.description=barttest
    &Common request parameters
    

    Output

    {
        "code":"0",
        "message":"",
        "data":{
            "taskId":"17922"
        },
        "codeDesc":"Success"
    }

    Was this page helpful?

    Was this page helpful?

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