VPN ゲートウェイのポリシールーティングを作成します。
操作説明
前提条件
ポリシールーティングを作成する前に、IPsec 接続がすでに作成されていることを確認してください。詳細については、「CreateVpnConnection」をご参照ください。
ポリシールーティングを作成する前に、使用制限やマッチングルールなどの情報を事前にご確認いただくことを推奨します。詳細については、「使用策略路由」をご参照ください。
制限事項
宛先ネットワークセグメントが 0.0.0.0/0 のポリシールーティングの追加はサポートされていません。
宛先ネットワークセグメントが 100.64.0.0/10、100.64.0.0/10 配下のサブネット、または 100.64.0.0/10 を含むネットワークセグメントを指定したポリシールーティングを追加しないでください。このようなポリシールーティングを追加すると、コンソールに IPsec 接続のステータスが表示されなくなったり、IPsec 接続のネゴシエーションが失敗したりする可能性があります。
- CreateVpnPbrRouteEntry API は非同期インターフェイスです。つまり、システムはまずポリシールーティングの情報のみを返却しますが、この時点ではポリシールーティングはまだ作成されておらず、バックグラウンドで作成タスクが継続しています。VPN ゲートウェイインスタンスのステータスを照会することで、ポリシールーティングの作成状況を確認できます。そのためには、DescribeVpnGateway API を呼び出してください。
VPN ゲートウェイインスタンスのステータスが updating の場合、ポリシールーティングが作成中であることを示します。
VPN ゲートウェイインスタンスのステータスが active の場合、ポリシールーティングが正常に作成されたことを示します。
CreateVpnPbrRouteEntry API は、同一の VPN ゲートウェイインスタンスに対して複数のポリシールーティングを並行して作成することをサポートしていません。
今すぐお試しください
テスト
RAM 認証
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
VPC ルートテーブルにポリシールーティングをアドバタイズするかどうかを指定します。有効値:
|
cn-hangzhou |
| ClientToken |
string |
任意 |
ポリシールーティングの説明です。 説明は 1~100 文字で指定し、http:// または https:// で開始することはできません。 |
d7d24a21-f4ba-4454-9173-b3**** |
| VpnGatewayId |
string |
必須 |
トンネリングプロトコルです。Ipsec を指定してください。 |
vpn-bp1a3kqjiiq9legfx**** |
| RouteSource |
string |
必須 |
ポリシールーティングの優先度です。有効値:1~100。デフォルト値:10。 値が小さいほど優先度が高くなります。 |
192.168.1.0/24 |
| RouteDest |
string |
必須 |
レスポンスパラメーターです。 |
10.0.0.0/24 |
| NextHop |
string |
必須 |
ポリシールーティングのネクストホップです。 |
vco-bp15oes1py4i66rmd**** |
| Weight |
integer |
必須 |
ポリシールーティングの重みです。有効値:
|
0 |
| PublishVpc |
boolean |
必須 |
ポリシールーティングの宛先 CIDR ブロックです。 |
true |
| Description |
string |
任意 |
リクエスト ID です。 |
desctest |
| OverlayMode |
string |
任意 |
ポリシールーティングの説明です。 |
Ipsec |
| Priority |
integer |
任意 |
ポリシールーティングのステータスです。有効値:
|
10 |
| DryRun |
boolean |
任意 |
リクエストを事前チェックのみ行うかどうかを指定します。有効値:
|
false |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
ポリシールーティングが作成された時刻です。 この値は UNIX タイムスタンプで、協定世界時 (UTC) 1970 年 1 月 1 日 00:00:00 からの経過ミリ秒数を表します。 |
||
| NextHop |
string |
トンネリングプロトコルです。値は Ipsec です。 |
vco-bp15oes1py4i66rmd**** |
| Weight |
integer |
ポリシールーティングの送信元 CIDR ブロックです。 |
0 |
| RouteDest |
string |
VPN ゲートウェイ ID です。 |
10.0.0.0/24 |
| RequestId |
string |
ポリシールーティングの優先度です。 |
5BE01CD7-5A50-472D-AC14-CA181C5C03BE |
| Description |
string |
ルートの説明です。 |
desctest |
| State |
string |
ポリシールーティングのステータスです。
|
normal |
| CreateTime |
integer |
ポリシールーティングが作成された際に生成されたタイムスタンプです。単位:ミリ秒。 この値は UNIX タイムスタンプで、エポック時刻(協定世界時 (UTC) 1970 年 1 月 1 日 00:00:00)からの経過ミリ秒数を表します。 |
1492747187000 |
| OverlayMode |
string |
トンネリングプロトコルです。値は Ipsec に設定され、IPsec トンネリングプロトコルを示します。 |
Ipsec |
| RouteSource |
string |
ポリシールーティングの送信元 CIDR ブロックです。 |
192.168.1.0/24 |
| VpnInstanceId |
string |
VPN ゲートウェイの ID です。 |
vpn-bp1cmw7jh1nfe43m9**** |
| Priority |
integer |
ポリシールーティングの優先度です。 |
10 |
例
成功レスポンス
JSONJSON
{
"NextHop": "vco-bp15oes1py4i66rmd****",
"Weight": 0,
"RouteDest": "10.0.0.0/24",
"RequestId": "5BE01CD7-5A50-472D-AC14-CA181C5C03BE",
"Description": "desctest",
"State": "normal",
"CreateTime": 1492747187000,
"OverlayMode": "Ipsec",
"RouteSource": "192.168.1.0/24",
"VpnInstanceId": "vpn-bp1cmw7jh1nfe43m9****",
"Priority": 10
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | Resource.QuotaFull | The quota of resource is full | |
| 400 | VpnGateway.FinancialLocked | The specified service is financial locked. | |
| 400 | VpnRouteEntry.AlreadyExists | The specified route entry is already exist. | |
| 400 | VpnRouteEntry.Conflict | The specified route entry has conflict. | |
| 400 | VpnRouteEntry.ConflictSSL | The specified route entry has conflict with SSL client. | |
| 400 | VpnRouteEntry.BackupRoute | Validate backup route entry failed. | |
| 400 | VpnRouteEntry.InvalidWeight | Invalid route entry weight value. | |
| 400 | InvalidNextHop.NotFound | The specified NextHop does not exist. | |
| 400 | IllegalParam.RouteDest | The specified RouteDest is invalid | |
| 400 | OperationFailed.RouteConflict | Operation failed because there is already a route in VPC route table to another VPN on the same network block. | |
| 400 | OperationFailed.InvalidCidrBlock | Operation failed because the specified network block is invalid. | |
| 400 | QuotaExceeded.VpnRouteEntry | The number of route entries to the VPN gateway in the VPC routing table has reached the quota limit. | |
| 400 | VpnPbrRouteEntryPriority.NotSupport | Current version of the VPN does not support setting custom pbr route entry priority. | |
| 400 | TaskConflict | The operation is too frequent, please wait a moment and try again. | |
| 400 | VpnTask.CONFLICT | Vpn task has conflict. | |
| 400 | VpnGateway.Configuring | The specified service is configuring. | |
| 400 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 400 | VpnRouteEntry.SrcDestWeightConflict | The VPN gateway does not support Policy-based routing with the same source CIDR, destination CIDR and weight. | |
| 400 | VpnRouteEntry.SamePriorityPbrRoutePrefixOverlap | The source CIDR and destination CIDR of Policy-based routes with the same priority cannot overlap. | |
| 400 | VpnRouteEntry.SrcDestConflict | The VPN gateway does not support Policy-based routing with the same source CIDR and destination CIDR. | |
| 400 | CreatePbrRoutesQuotaFull.QuotaFull | The number of policy routes exceeds the quota limit. | |
| 400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | |
| 400 | VpnPbrRouteEntry.NotSupport | Current version of the VPN does not support pbr route entry. | |
| 403 | Forbbiden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | |
| 404 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。