This section describes how to create an S2C VPN gateway by calling an API.
The token obtained through IAM is valid for only 24 hours. When using a token for authentication, cache it to avoid frequent calling.
Parameter |
Description |
Example Value |
|---|---|---|
vpc_id |
Specifies the ID of the VPC to which the VPN gateway connects. |
cb4a631d-demo-a8df-va86-ca3fa348c36c |
local_subnets |
Specifies the local CIDR block. |
192.168.0.0/24,192.168.1.0/24 |
connect_subnet |
Specifies the ID of the VPC subnet used by the VPN gateway. |
f5741286-demo-a8df-va86-2c82bd9ee114 |
eip1.id |
Specifies the ID of the active EIP used by the VPN gateway. |
cff40e5e-demo-a8df-va86-7366077bf097 |
eip2.id |
Specifies the ID of the standby EIP used by the VPN gateway. |
d290f1ee-demo-a8df-va86-d701748f0851 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | { "vpn_gateway": { "vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "local_subnets": [ "192.168.0.0/24", "192.168.1.0/24" ], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "eip1": { "id": "cff40e5e-demo-a8df-va86-7366077bf097" }, "eip2": { "id": "d290f1ee-demo-a8df-va86-d701748f0851" } } } |
{
"vpn_gateway": {
"id": "620d99b8-demo-a8df-va86-200b868f2d7d",
"name": "vpngw-3caf",
"network_type": "public",
"attachment_type": "vpc",
"vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c",
"local_subnets": ["192.168.0.0/24", "192.168.1.0/24"],
"connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114",
"bgp_asn": 64512,
"access_vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c",
"access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114",
"flavor": "Professional1",
"used_connection_number": 0,
"used_connection_group": 0,
"enterprise_project_id": "0"
},
"request_id": "4a739f5c-edb7-4122-b31f-b77fb1b94857"
}
{
"vpn_gateway": {
"id": "620d99b8-demo-a8df-va86-200b868f2d7d",
"name": "vpngw-3caf",
"network_type": "public",
"status": "ACTIVE",
"attachment_type": "vpc",
"vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c",
"local_subnets": [
"192.168.0.0/24", "192.168.1.0/24"
],
"connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114",
"access_vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c",
"access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114",
"bgp_asn": 64512,
"flavor": "Professional1",
"availability_zone_ids": [
"eu-de-01", "eu-de-02"
],
"used_connection_number": 0,
"used_connection_group": 0,
"enterprise_project_id": "0",
"eip1": {
"id": "cff40e5e-demo-a8df-va86-7366077bf097",
"ip_version": 4,
"type": "5_bgp",
"ip_address": "88.***.***.8",
"charge_mode": "bandwidth",
"bandwidth_id": "593a1a79-demo-a8df-va86-64ec45fb23f6",
"bandwidth_size": 300,
"bandwidth_name": "vpngw-bandwidth-1391"
},
"eip2": {
"id": "d290f1ee-demo-a8df-va86-d701748f0851",
"ip_version": 4,
"type": "5_bgp",
"ip_address": "88.***.***.6",
"charge_mode": "bandwidth",
"bandwidth_id": "0abb9d55-demo-a8df-va86-b7500ac2a338",
"bandwidth_size": 300,
"bandwidth_name": "vpngw-bandwidth-1392"
},
"created_at": "2025-06-15T08:56:09.386Z",
"updated_at": "2022-06-15T11:13:13.677Z"
},
"request_id": "d099a7dc-ea71-45a6-a75b-dccbfe17d438"
}