DNAT テーブルに DNAT エントリを追加します。
操作説明
各 DNAT エントリは、次のパラメーターで構成されます:ExternalIp、ExternalPort、IpProtocol、InternalIp、および InternalPort。DNAT エントリを追加すると、NAT ゲートウェイは指定されたプロトコルを使用して、ExternalIp:ExternalPort から受信したパケットを InternalIp:InternalPort に転送し、応答を同じ経路で返送します。
この操作を呼び出す際は、以下の制限事項にご注意ください。
-
CreateForwardEntry は非同期操作です。リクエストを送信すると、システムはリクエスト ID を返し、タスクをバックグラウンドで実行します。DescribeForwardTableEntries 操作を呼び出して、タスクのステータスをクエリできます。
DNAT エントリのステータスが Pending の場合、システムは DNAT エントリを追加中です。この状態では、DNAT エントリをクエリすることのみ可能で、他の操作は実行できません。
DNAT エントリのステータスが Available の場合、DNAT エントリが正常に追加されています。
-
特定の期間内に、CreateForwardEntry 操作を繰り返し呼び出して DNAT エントリを追加することはできません。
-
DNAT エントリで使用される ExternalIp、ExternalPort、および IpProtocol のすべての組み合わせは一意である必要があります。同一のソース IP アドレスから送信され、同一のポートで受信され、かつ同一のプロトコルを使用するリクエストを複数の Elastic Compute Service (ECS) インスタンスに分散することはできません。
-
IpProtocol、InternalIp、および InternalPort の組み合わせも一意である必要があります。
-
DNAT テーブル内のいずれかの DNAT エントリが Pending または Modifying のステータスである場合、その DNAT テーブルに DNAT エントリを追加することはできません。
-
1 つの DNAT テーブルに追加できる DNAT エントリの上限は 100 個です。
-
インターネット NAT ゲートウェイで使用されるエラスティック IP アドレス (EIP) または VPC NAT ゲートウェイで使用される NAT IP アドレスについては、以下の制限事項にご注意ください。IP アドレスに対して IP マッピングが有効になっており、かつその IP アドレスが DNAT エントリで指定されている場合、その IP アドレスを別の DNAT エントリまたは SNAT エントリで使用することはできません。
今すぐお試しください
テスト
RAM 認証
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
NAT ゲートウェイが配置されているリージョン ID です。 DescribeRegions 操作を呼び出して、リージョン ID を取得できます。 |
cn-hangzhou |
| ForwardTableId |
string |
必須 |
DNAT テーブルの ID です。 |
ftb-bp1mbjubq34hlcqpa**** |
| ExternalIp |
string |
必須 |
|
116.28.XX.XX |
| ExternalPort |
string |
必須 |
|
8080 |
| InternalIp |
string |
必須 |
|
192.168.XX.XX |
| InternalPort |
string |
必須 |
|
80 |
| IpProtocol |
string |
必須 |
プロトコルです。有効値:
|
TCP |
| ForwardEntryName |
string |
任意 |
DNAT エントリの名前です。 名前の長さは 2 ~ 128 文字で、先頭は英字である必要があります。 |
ForwardEntry-1 |
| ClientToken |
string |
任意 |
リクエストのべき等性を保証するために使用されるクライアントトークンです。 クライアント側でトークンを生成できますが、異なるリクエスト間でトークンが一意になるようにする必要があります。トークンには ASCII 文字のみを使用できます。 説明
このパラメーターを指定しない場合、システムは自動的に リクエスト ID を クライアントトークン として使用します。ただし、各リクエストの リクエスト ID は異なる可能性があります。 |
0c593ea1-3bea-11e9-b96b-88e9fe6**** |
| PortBreak |
boolean |
任意 |
ポートブレークスルーを有効にするかどうかを指定します。値:
説明
DNAT エントリと SNAT エントリの両方が同一のパブリック IP アドレスを使用しており、かつ 1024 を超えるポート番号を設定する必要がある場合は、PortBreak を true に設定する必要があります。 |
false |
| DryRun |
boolean |
任意 |
リクエストのドライランを実行するかどうかを示します。値:
|
false |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| ForwardEntryId |
string |
DNAT エントリの ID です。 |
fwd-119smw5tkasdf**** |
| RequestId |
string |
リクエスト ID です。 |
A4AEE536-A97A-40EB-9EBE-53A6948A6928 |
例
成功レスポンス
JSONJSON
{
"ForwardEntryId": "fwd-119smw5tkasdf****",
"RequestId": "A4AEE536-A97A-40EB-9EBE-53A6948A6928"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | UnsupportedFeature.PrivateLinkEnabled | The feature of PrivateLinkEnabled is not supported. | |
| 400 | UnsupportedFeature.PortSegment | The feature of PortSegment is not supported. | |
| 400 | ExclusiveParam.%sAnd%s | The param of %s and %s are mutually exclusive. | |
| 400 | DuplicatedParam.InternalPort | The param of %s is duplicated. | |
| 400 | DuplicatedParam.ExternalPort | The param of %s is duplicated. | |
| 400 | OperationFailed.AnyPortConfig | Operation failed because any port correspondence any protocol | |
| 400 | OperationUnsupported.ForwardEntry | Duplicated destination ip port is unsupported. | |
| 400 | InvalidIp.NotInNatgw | The specified Ip not belong to natgateway. | |
| 400 | QuotaExceeded.ForwardEntry | The quota of %s is exceeded, usage %s/%s. | |
| 400 | IncorrectStatus.NatIp | The status of %s [%s] is incorrect. | |
| 400 | Forbidden.IpHasBeenUsedInSnat | The source ip can't be used. Because it has been used in snat. | |
| 400 | InvalidExternalIp.Malformed | The specified ExternalIp is not a valid IP address. | |
| 400 | InvalidInternalIp.Malformed | The specified InternalIp is not a valid IP address. | |
| 400 | InvalidExternalPort.Malformed | The specified ExternalPort is not a valid port. | |
| 400 | InvalidInternalPort.Malformed | The specified InternalPort is not a valid port. | |
| 400 | Forbidden.DestnationIpOutOfVpcCIDR | The specified Internal Ip is Out of VPC CIDR. | |
| 400 | Forbidden.DestinationIpOutOfVswitchCIDR | The specified Internal Ip is Out of VSwitch CIDR. | |
| 400 | InvalidProtocal.ValueNotSupported | The specified IpProtocol does not support. | |
| 400 | IncorretForwardEntryStatus | Some Forward entry status blocked this operation.. | |
| 400 | ForwardEntry.Duplicated | The specified ExternalIp, IpProtocol, ExternalPort,InternalIp, InternalPort is duplicated | |
| 400 | Forbidden.ExternalIp.UsedInSnatTable | The specified ExternalIp is already used in SnatTable | |
| 400 | Forbindden | The specified Instance already bind eip | |
| 400 | Forbidden.InternalIpOutOfVpcCIDR | The specified Internal Ip is Out of VPC CIDR. | |
| 400 | Invalid.natgwNotExist | The specified natgateway not exist. | |
| 400 | MissingParameter | Missing mandatory parameter | |
| 400 | AnyPort.PortMustBeZero | any port port must be zero. | |
| 400 | InvalidParameter.Name.Malformed | The specified Name is not valid. | |
| 400 | IncorrectStatus.ForwardEntry | The status of %s [%s] is incorrect. | |
| 400 | Duplicated.DestinationPort | The specified param DestinationPort is duplicated. | |
| 400 | OperationUnsupported.EipInBinding | Create snat entry with eip in associating status is unsupported. | |
| 400 | QuotaExceeded.ForwardEntrySessionManytoOne | The dnat session quota is exceed. | |
| 400 | TaskConflict | The operation is too frequent, please wait a moment and try again. | |
| 400 | OperationFailed.DnatPortRangeLimit | The maximum number of port ranges that can be specified is exceeded. | |
| 400 | IncorrectStatus.NATGW | NATGW status is invalid. | |
| 400 | OperationFailed.ForwardEntryNotAllowSrcIpEqualDstIp | The source IP of forward entry is not allowed to equal destination IP. | |
| 500 | System.Error | ERROR SYSTEM ERROR. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 404 | ResourceNotFound.NatIp | The specified resource of %s is not found. | |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | |
| 404 | InvalidForwardTableId.NotFound | Specified forward table does not exist. | |
| 404 | InvalidExternalIp.NotFound | Specified External Ip address does not found on the VRouter |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。