華為云計算 云知識 創(chuàng)建VPN連接CreateVpnConnection
創(chuàng)建VPN連接CreateVpnConnection

 

功能介紹

創(chuàng)建VPN連接,連接VPN網(wǎng)關(guān)與對端網(wǎng)關(guān)。

URI

POST /v5/{project_id}/vpn-connection

表1 參數(shù)說明

名稱

類型

是否必選

說明

project_id

String

項目ID,可以通過獲取項目ID獲取項目ID。

請求消息

  • 請求參數(shù)
    表2 請求參數(shù)

    名稱

    類型

    是否必選

    描述

    vpn_connection

    CreateVpnConnectionRequestBodyContent object

    vpn_connection對象

    表3 CreateVpnConnectionRequestBodyContent

    名稱

    類型

    是否必選

    描述

    name

    String

    • 功能說明:VPN連接名稱,不填時會自動生成格式為vpn-****的名稱。例如:vpn-13be。
    • 取值范圍:1-64個字符,支持?jǐn)?shù)字、英文字母、中文(\u4e00 - \u9fa5)、_(下劃線)、-(中劃線)。

    vgw_id

    String

    • 功能說明:VPN網(wǎng)關(guān)ID
    • 約束:36位UUID,當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,VPN網(wǎng)關(guān)必須已導(dǎo)入過VPN網(wǎng)關(guān)證書。

    可以通過查詢VPN網(wǎng)關(guān)列表查看VPN網(wǎng)關(guān)的ID。

    vgw_ip

    String

    • 功能說明:

      當(dāng)VPN網(wǎng)關(guān)的network_type配置為public時,vgw_ip為VPN網(wǎng)關(guān)EIP的ID。

      當(dāng)VPN網(wǎng)關(guān)的network_type配置為private時,vgw_ip為VPN網(wǎng)關(guān)使用的接入私網(wǎng)IP。

    • 約束:36位UUID或點分十進制IPv4地址(如192.168.45.7)

    可以通過查詢VPN網(wǎng)關(guān)查看VPN網(wǎng)關(guān)所使用的EIP的ID或接入私網(wǎng)IP。

    style

    String

    • 功能說明:連接模式
    • 取值范圍:

      policy: 策略模式

      static: 靜態(tài)路由模式

      bgp: bgp路由模式

    • 默認(rèn)值:static

    cgw_id

    String

    • 功能說明:對端網(wǎng)關(guān)ID
    • 約束:36位UUID,當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,對端網(wǎng)關(guān)必須已導(dǎo)入過對端網(wǎng)關(guān)證書。

    peer_subnets

    Array of String

    • 功能說明:對端子網(wǎng)
    • 約束:

      VPN網(wǎng)關(guān)的關(guān)聯(lián)模式為er并且style字段為policy或bgp時不填,其他場景必填。

      部分網(wǎng)段是VPC預(yù)留網(wǎng)段,不能作為對端子網(wǎng),比如100.64.0.0/10,214.0.0.0/8。

      每個VPN連接最多填寫50個對端子網(wǎng)。

    tunnel_local_address

    String

    • 功能說明:路由模式下配置在VPN網(wǎng)關(guān)上的tunnel接口地址。例如:169.254.76.1/30。
    • 約束:

      前16位必須是169.254,不能使用169.254.195.xxx;

      掩碼長度必須是30。必須和tunnel_peer_address在同一個30掩碼范圍。

      應(yīng)填寫網(wǎng)段中的主機地址。

    tunnel_peer_address

    String

    • 功能說明:路由模式下配置在用戶側(cè)設(shè)備上的tunnel接口地址。例如:169.254.76.2/30。
    • 約束:

      前16位必須是169.254,不能使用169.254.195.xxx;

      掩碼長度必須是30。必須和tunnel_local_address在同一個30掩碼范圍。

      應(yīng)填寫網(wǎng)段中的主機地址。

    enable_nqa

    Boolean

    • 功能說明:開啟NQA檢測
    • 取值范圍:true,false
    • 默認(rèn)值:false
    • 約束:當(dāng)style為static時填寫,否則不填。

    psk

    String

    • 功能說明:預(yù)共享密鑰

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,此字段不用填寫,否則必填。

    • 約束:8-128個字符,只能包含大寫字母、小寫字母、數(shù)字和特殊字符(~!@#$%^()-_+={ },./:;)且至少包含四種字符的三種。

    policy_rules

    Array of PolicyRule objects

    • 功能說明:策略模式的策略規(guī)則組
    • 約束:最多填寫5個。style為policy時填寫,為static或bgp時不填。

    ikepolicy

    IkePolicy object

    ike策略對象

    ipsecpolicy

    IpsecPolicy object

    ipsec策略對象

    ha_role

    String

    • 功能說明:雙活模式VPN網(wǎng)關(guān)下創(chuàng)建連接可不填,主備模式VPN網(wǎng)關(guān)下創(chuàng)建連接時,'master'表示主連接,'slave'表示備連接。
    • 默認(rèn)值:master
    • 約束:雙活模式VPN網(wǎng)關(guān)在主EIP或者主私網(wǎng)地址建立的連接必須填'master',在主EIP2或者主私網(wǎng)地址2建立的連接必須填'slave'。
    表4 PolicyRule

    名稱

    類型

    是否必選

    描述

    rule_index

    Integer

    • 功能說明:規(guī)則ID,用于區(qū)分配置的策略規(guī)則順序。建議不填。
    • 取值范圍:0-50
    • 約束:不能與其他PolicyRule下的rule_index相同,ResponseVpnConnection中的rule_index可能與該值不同,因為 vpn服務(wù)會將多個destination拆成不同rule。

    source

    String

    • 功能說明:源地址網(wǎng)段。
    • 約束:不能與其他PolicyRule下的source相同。

    destination

    Array of String

    • 功能說明:目的地址網(wǎng)段。

      單個網(wǎng)段格式示例:192.168.52.0/24。

    • 約束:每個PolicyRule最多填寫50個。
    表5 IkePolicy

    名稱

    類型

    是否必選

    描述

    ike_version

    String

    • 功能說明:IKE版本號
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為v1;

      其他場景下取值范圍為v1,v2。

    • 默認(rèn)值:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,默認(rèn)值為v1;

      其他場景下,默認(rèn)值為v2。

    phase1_negotiation_mode

    String

    • 功能說明:協(xié)商模式
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為main;

      其他場景下取值范圍為main,aggressive。

      main:主模式,協(xié)商過程安全性高

      aggressive:野蠻模式,協(xié)商快速且協(xié)商成功率高

    • 默認(rèn)值:main
    • 約束:IKE版本為v1時填寫,為v2時不填

    authentication_algorithm

    String

    • 功能說明:認(rèn)證算法
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為sm3;

      其他場景下取值范圍為sha2-512,sha2-384,sha2-256,sha1,md5。

      其中,sha1和md5安全性較低,請慎用。

    • 默認(rèn)值:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,默認(rèn)值為sm3;

      其他場景下,默認(rèn)值為sha2-256。

    encryption_algorithm

    String

    • 功能說明:加密算法
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為sm4;

      其他場景下取值范圍為aes-256-gcm-16,aes-128-gcm-16,aes-256,aes-192,aes-128,3des。

      其中,3des安全性較低,請慎用。

    • 默認(rèn)值:

    dh_group

    String

    • 功能說明:第一階段密鑰交換使用的DH組

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 取值范圍:group1,group2,group5,group14,group15,group16,group19,group20,group21。

      其中,group1,group2,group5,group14安全性較低,請慎用。

    • 默認(rèn)值:group15

    authentication_method

    String

    • 功能說明:ike協(xié)商時的認(rèn)證方法
    • 取值范圍:

      pre-share:預(yù)共享密鑰

      digital-envelope-v2:國密數(shù)字信封

    • 默認(rèn)值:pre-share

    lifetime_seconds

    Integer

    • 功能說明:表示SA的生存周期,當(dāng)該生存周期超時后IKE SA將自動更新。
    • 取值范圍:60-604800,單位:秒。
    • 默認(rèn)值:86400

    local_id_type

    String

    • 功能說明:本端ID類型

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 取值范圍:ip,fqdn。
    • 默認(rèn)值:ip

    local_id

    String

    • 功能說明:本端ID

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 約束:最大長度255個字符,只能由大小寫字母、數(shù)字和特殊符號組成,不支持以下特殊字符:&、<、>、[、]、\、空格、?,區(qū)分大小寫。當(dāng)local_id_type為fqdn時填寫,需要和對端設(shè)備的peer_id一致。

    peer_id_type

    String

    • 功能說明:對端ID類型

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 取值范圍:ip,fqdn。
    • 默認(rèn)值:ip

    peer_id

    String

    • 功能說明:對端ID

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 約束:最大長度255個字符,只能由大小寫字母、數(shù)字和特殊符號組成,不支持以下特殊字符:&、<、>、[、]、\、空格、?,區(qū)分大小寫。當(dāng)peer_id_type為為fqdn時填寫,需要和對端設(shè)備的local_id一致。

    dpd

    Dpd object

    對等體存活檢測對象

    表6 Dpd

    名稱

    類型

    是否必選

    描述

    timeout

    Integer

    • 功能說明:對等體存活檢測報文重傳間隔
    • 取值范圍:2-60,單位:秒。
    • 默認(rèn)值:15

    interval

    Integer

    • 功能說明:對等體存活檢測空閑時間
    • 取值范圍:10-3600,單位:秒。
    • 默認(rèn)值:30

    msg

    String

    • 功能說明:對等體存活檢測報文格式
    • 取值范圍:

      seq-hash-notify:指定DPD報文中的載荷順序是hash-notify。

      seq-notify-hash:指定DPD報文中的載荷順序是notify-hash。

    • 默認(rèn)值:seq-hash-notify
    表7 IpsecPolicy

    名稱

    類型

    是否必選

    描述

    authentication_algorithm

    String

    • 功能說明:認(rèn)證算法
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為sm3;

      其他場景下取值范圍為sha2-512,sha2-384,sha2-256,sha1,md5。

      其中,sha1和md5安全性較低,請慎用

    • 默認(rèn)值:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,默認(rèn)值為sm3;

      其他場景下,默認(rèn)值為sha2-256。

    encryption_algorithm

    String

    • 功能說明:加密算法
    • 取值范圍:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,取值范圍為sm4;

      其他場景下取值范圍為aes-256-gcm-16,aes-128-gcm-16,aes-256,aes-192,aes-128,3des。

      其中,3des安全性較低,請慎用。

    • 默認(rèn)值:

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,默認(rèn)值為sm4;

      其他場景下,默認(rèn)值為aes-128。

    pfs

    String

    • 功能說明:PFS使用的DH密鑰組

      當(dāng)VPN網(wǎng)關(guān)的flavor配置為GM時,該字段不用填寫。

    • 取值范圍:group1,group2,group5,group14,group15,group16,group19,group20,group21,disable。

      其中,group1,group2,group5,group14安全性較低,請慎用。

    • 默認(rèn)值:group15

    transform_protocol

    String

    • 功能說明:傳輸協(xié)議
    • 取值范圍:

      esp:封裝安全協(xié)議

    • 默認(rèn)值:esp

    lifetime_seconds

    Integer

    • 功能說明:表示配置IPSec連接建立的隧道以時間為基準(zhǔn)的生存周期。
    • 取值范圍:30-604800,單位:秒
    • 默認(rèn)值:3600

    encapsulation_mode

    String

    • 功能說明:報文封裝模式
    • 取值范圍:

      tunnel:隧道模式

    • 默認(rèn)值:tunnel
  • 請求樣例
    1. 創(chuàng)建靜態(tài)路由模式連接。
      POST https://{Endpoint}/v5/{project_id}/vpn-connection
      
      {
          "vpn_connection": {
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": [
                  "192.168.44.0/24"
              ],
              "psk": "abcd****"
          }
      }
    2. 創(chuàng)建策略模式連接。
      POST https://{Endpoint}/v5/{project_id}/vpn-connection
      
      {
          "vpn_connection": {
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "style": "policy",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": [
                  "192.168.44.0/24"
              ],
              "psk": "abcd****",
              "policy_rules": [{
                  "rule_index": 1,
                  "source": "10.0.0.0/24",
                  "destination": [
                      "192.168.0.0/24"
                  ]
              }]
          }
      }
    3. 創(chuàng)建bgp路由模式連接。
      POST https://{Endpoint}/v5/{project_id}/vpn-connection
      
      {
          "vpn_connection": {
              "name": "vpn-1655",
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "style": "bgp",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": [
                  "192.168.44.0/24"
              ],
              "tunnel_local_address": "169.254.56.225/30",
              "tunnel_peer_address": "169.254.56.226/30",
              "psk": "abcd****",
              "ikepolicy": {
                  "ike_version": "v2",
                  "authentication_algorithm": "sha2-512",
                  "encryption_algorithm": "aes-256",
                  "dh_group": "group16",
                  "lifetime_seconds": 172800,
                  "local_id_type": "fqdn",
                  "local_id": "123***",
                  "peer_id_type": "fqdn",
                  "peer_id": "456***",
                  "dpd": {
                      "timeout": 30,
                      "interval": 60,
                      "msg": "seq-notify-hash"
                  }
              },
              "ipsecpolicy": {
                  "authentication_algorithm": "sha2-512",
                  "encryption_algorithm": "aes-256",
                  "pfs": "group16",
                  "transform_protocol": "esp",
                  "lifetime_seconds": 7200,
                  "encapsulation_mode": "tunnel"
              }
          }
      }

響應(yīng)消息

  • 響應(yīng)參數(shù)

    返回狀態(tài)碼為 201: successful operation。

    表8 響應(yīng)Body參數(shù)列表

    名稱

    類型

    描述

    vpn_connection

    ResponseVpnConnection object

    vpn_connection對象

    request_id

    String

    請求ID

    表9 ResponseVpnConnection

    名稱

    類型

    描述

    id

    String

    • 功能說明:VPN連接ID
    • 格式:36位UUID

    name

    String

    • 功能說明:VPN連接名稱,不填時會自動生成。
    • 取值范圍:1-64個字符,支持?jǐn)?shù)字、英文字母、中文(\u4e00 - \u9fa5)、_(下劃線)、-(中劃線)。

    vgw_id

    String

    • 功能說明:VPN網(wǎng)關(guān)ID
    • 格式:36位UUID

    vgw_ip

    String

    • 功能說明: VPN網(wǎng)關(guān)EIP的ID或接入私網(wǎng)IP
    • 格式:36位UUID或點分十進制IPv4地址(如192.168.45.7)

    style

    String

    • 功能說明:連接模式
    • 取值范圍:

      POLICY: 策略模式

      STATIC: 靜態(tài)路由模式

      BGP: bgp路由模式

    cgw_id

    String

    • 功能說明:對端網(wǎng)關(guān)ID
    • 格式:36位UUID

    peer_subnets

    Array of String

    對端子網(wǎng)。當(dāng)VPN網(wǎng)關(guān)的關(guān)聯(lián)模式為ER并且style字段為BGP或POLICY時不返回。

    tunnel_local_address

    String

    路由模式下配置在VPN網(wǎng)關(guān)上的tunnel接口地址。僅當(dāng)style為STATIC或BGP時有效。

    tunnel_peer_address

    String

    路由模式下配置在用戶側(cè)設(shè)備上的tunnel接口地址。僅當(dāng)style為STATIC或BGP時有效。

    enable_nqa

    Boolean

    • 功能說明:開啟NQA檢測。僅當(dāng)style為STATIC時返回。
    • 取值范圍:true,false。

    policy_rules

    Array of PolicyRule objects

    策略模式的策略規(guī)則組。當(dāng)style為POLICY時返回實際的策略規(guī)則組,當(dāng)style為STATIC或BGP時不返回。

    ikepolicy

    IkePolicy object

    ike策略對象

    ipsecpolicy

    IpsecPolicy object

    ipsec策略對象

    created_at

    String

    創(chuàng)建時間

    updated_at

    String

    最后一次更新時間

    enterprise_project_id

    String

    • 功能說明:企業(yè)項目ID
    • 格式:36位UUID。與vgw_id所標(biāo)識VPN網(wǎng)關(guān)的企業(yè)項目ID一致。

    connection_monitor_id

    String

    • 功能說明:VPN連接監(jiān)控ID
    • 格式:36位UUID

    ha_role

    String

    • 功能說明:主備模式VPN網(wǎng)關(guān)下的連接時,'master'表示主連接,'slave'表示備連接。雙活模式下的連接ha_role都是'master'。
    • 默認(rèn)值:master
    表10 PolicyRule

    名稱

    類型

    描述

    rule_index

    Integer

    • 功能說明:規(guī)則ID
    • 取值范圍:0-50

    source

    String

    源地址網(wǎng)段

    destination

    Array of String

    目的地址網(wǎng)段。單個網(wǎng)段格式示例:192.168.52.0/24。每個PolicyRule最多返回50個。

    表11 IkePolicy

    名稱

    類型

    描述

    ike_version

    String

    • 功能說明:IKE版本號
    • 取值范圍:v1, v2

    phase1_negotiation_mode

    String

    • 功能說明:協(xié)商模式。僅當(dāng)IKE版本為v1時返回。
    • 取值范圍:

      main:主模式,協(xié)商過程安全性高。

      aggressive:野蠻模式,協(xié)商快速且協(xié)商成功率高。

    authentication_algorithm

    String

    • 功能說明:認(rèn)證算法
    • 取值范圍:sha2-512,sha2-384,sha2-256,sha1,md5,sm3。

    encryption_algorithm

    String

    • 功能說明:加密算法
    • 取值范圍:aes-256-gcm-16,aes-128-gcm-16,aes-256,aes-192,aes-128,3des,sm4。

    dh_group

    String

    • 功能說明:第一階段密鑰交換使用的DH組,當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。
    • 取值范圍:group1,group2,group5,group14,group15,group16,group19,group20,group21。

    authentication_method

    String

    • 功能說明:ike協(xié)商時的認(rèn)證方法
    • 取值范圍:

      pre-share:預(yù)共享密鑰

      digital-envelope-v2:國密數(shù)字信封

    lifetime_seconds

    Integer

    • 功能說明:表示SA的生存周期,當(dāng)該生存周期超時后IKE SA將自動更新。
    • 取值范圍:60-604800,單位:秒。

    local_id_type

    String

    • 功能說明:本端ID類型,當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。
    • 取值范圍:ip,fqdn。

    local_id

    String

    本端ID。當(dāng)local_id_type為ip時返回VPN連接所使用的網(wǎng)關(guān)IP;當(dāng)local_id_type為fqdn時返回創(chuàng)建或更新VPN連接時指定的本端ID。

    當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。

    peer_id_type

    String

    • 功能說明:對端ID類型,當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。
    • 取值范圍:ip,fqdn。

    peer_id

    String

    對端ID。當(dāng)peer_id_type為ip時返回對端網(wǎng)關(guān)的IP;當(dāng)peer_id_type為fqdn時返回創(chuàng)建或更新VPN連接時指定的對端ID。

    當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。

    dpd

    Dpd object

    對等體存活檢測對象

    表12 Dpd

    名稱

    類型

    描述

    timeout

    Integer

    • 功能說明:對等體存活檢測報文重傳間隔
    • 取值范圍:2-60,單位:秒。

    interval

    Integer

    • 功能說明:對等體存活檢測空閑時間
    • 取值范圍:10-3600,單位:秒。

    msg

    String

    • 功能說明:對等體存活檢測報文格式
    • 取值范圍:

      seq-hash-notify:指定DPD報文中的載荷順序是hash-notify。

      seq-notify-hash:指定DPD報文中的載荷順序是notify-hash。

    表13 IpsecPolicy

    名稱

    類型

    描述

    authentication_algorithm

    String

    • 功能說明:認(rèn)證算法
    • 取值范圍:sha2-512,sha2-384,sha2-256,sha1,md5,sm3。

    encryption_algorithm

    String

    • 功能說明:加密算法
    • 取值范圍:aes-256-gcm-16,aes-128-gcm-16,aes-256,aes-192,aes-128,3des,sm4。

    pfs

    String

    • 功能說明:PFS使用的DH密鑰組,當(dāng)VPN網(wǎng)關(guān)flavor為GM時不返回。
    • 取值范圍:group1,group2,group5,group14,group15,group16,group19,group20,group21,disable。

    transform_protocol

    String

    • 功能說明:傳輸協(xié)議
    • 取值范圍:

      esp:封裝安全協(xié)議

    lifetime_seconds

    Integer

    • 功能說明:表示配置IPSec連接建立的隧道以時間為基準(zhǔn)的生存周期。
    • 取值范圍:30-604800,單位:秒

    encapsulation_mode

    String

    • 功能說明:報文封裝模式
    • 取值范圍:

      tunnel:隧道模式

  • 響應(yīng)樣例
    1. 創(chuàng)建靜態(tài)路由模式連接的響應(yīng)。
      {
          "vpn_connection": {
              "id": "98c5af8a-6ee2-4482-99a2-ae2280a6f4c3",
              "name": "vpn-b2cb",
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "style": "STATIC",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": ["192.168.44.0/24"],
              "tunnel_local_address": "169.254.56.225/30",
              "tunnel_peer_address": "169.254.56.226/30",
              "enable_nqa": false,
              "ikepolicy": {
                  "ike_version": "v2",
                  "authentication_algorithm": "sha2-256",
                  "encryption_algorithm": "aes-128",
                  "dh_group": "group15",
                  "authentication_method": "pre-share",
                  "lifetime_seconds": 86400,
                  "local_id_type": "ip",
                  "local_id": "10.***.***.134",
                  "peer_id_type": "ip",
                  "peer_id": "88.***.***.164",
                  "dpd": {
                      "timeout": 15,
                      "interval": 30,
                      "msg": "seq-hash-notify"
                  }
              },
              "ipsecpolicy": {
                  "authentication_algorithm": "sha2-256",
                  "encryption_algorithm": "aes-128",
                  "pfs": "group15",
                  "transform_protocol": "esp",
                  "lifetime_seconds": 3600,
                  "encapsulation_mode": "tunnel"
              },
              "created_at": "2022-11-26T13:41:34.626Z",
              "updated_at": "2022-11-26T13:41:34.626Z",
              "enterprise_project_id": "0",
              "ha_role":"master"
          },
          "request_id": "f91082d4-6d49-479c-ad1d-4e552a9f5cae"
      }
    2. 創(chuàng)建策略模式連接的響應(yīng)。
      {
          "vpn_connection": {
              "id": "98c5af8a-****-****-****-ae2280a6f4c3",
              "name": "vpn-799d",
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "style": "POLICY",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": ["192.168.44.0/24"],
              "tunnel_local_address": "169.254.56.225/30",
              "tunnel_peer_address": "169.254.56.226/30",
              "policy_rules": [{
                  "rule_index": 1,
                  "source": "10.0.0.0/24",
                  "destination": [
                      "192.168.44.0/24"
                  ]
              }],
              "ikepolicy": {
                  "ike_version": "v2",
                  "authentication_algorithm": "sha2-256",
                  "encryption_algorithm": "aes-128",
                  "dh_group": "group15",
                  "authentication_method": "pre-share",
                  "lifetime_seconds": 86400,
                  "local_id_type": "ip",
                  "local_id": "10.***.***.134",
                  "peer_id_type": "ip",
                  "peer_id": "88.***.***.164",
                  "dpd": {
                      "timeout": 15,
                      "interval": 30,
                      "msg": "seq-hash-notify"
                  }
              },
              "ipsecpolicy": {
                  "authentication_algorithm": "sha2-256",
                  "encryption_algorithm": "aes-128",
                  "pfs": "group15",
                  "transform_protocol": "esp",
                  "lifetime_seconds": 3600,
                  "encapsulation_mode": "tunnel"
              },
              "created_at": "2022-11-26T13:41:34.626Z",
              "updated_at": "2022-11-26T13:41:34.626Z",
              "enterprise_project_id": "0",
              "ha_role":"master"
          },
          "request_id": "f91082d4-6d49-479c-ad1d-4e552a9f5cae"
      }
    3. 創(chuàng)建bgp路由模式連接的響應(yīng)。
      {
          "vpn_connection": {
              "id": "98c5af8a-****-****-****-ae2280a6f4c3",
              "name": "vpn-1655",
              "vgw_id": "b32d91a4-****-****-****-e907174eb11d",
              "vgw_ip": "0c464dad-****-****-****-c22bb0eb0bde",
              "style": "BGP",
              "cgw_id": "5247ae10-****-****-****-dd36659a7f5d",
              "peer_subnets": ["192.168.44.0/24"],
              "tunnel_local_address": "169.254.56.225/30",
              "tunnel_peer_address": "169.254.56.226/30",
              "ikepolicy": {
                  "ike_version": "v2",
                  "authentication_algorithm": "sha2-512",
                  "encryption_algorithm": "aes-256",
                  "dh_group": "group16",
                  "authentication_method": "pre-share",
                  "lifetime_seconds": 172800,
                  "local_id_type": "fqdn",
                  "local_id": "123***",
                  "peer_id_type": "fqdn",
                  "peer_id": "456***",
                  "dpd": {
                      "timeout": 30,
                      "interval": 60,
                      "msg": "seq-notify-hash"
                  }
              },
              "ipsecpolicy": {
                  "authentication_algorithm": "sha2-512",
                  "encryption_algorithm": "aes-256",
                  "pfs": "group16",
                  "transform_protocol": "esp",
                  "lifetime_seconds": 7200,
                  "encapsulation_mode": "tunnel"
              },
              "created_at": "2022-11-26T13:41:34.626Z",
              "updated_at": "2022-11-26T13:41:34.626Z",
              "enterprise_project_id": "0",
              "ha_role":"master"
          },
          "request_id": "f91082d4-6d49-479c-ad1d-4e552a9f5cae"
      }

狀態(tài)碼

請參見狀態(tài)碼