释放生成式AI的无限潜能

100 万免费令牌

降价88%

开始激活

ALIYUN::VPC::VpnConnection

更新时间:2023-12-05 09:58

ALIYUN::VPC::VpnConnection类型用于创建IPsec连接。

语法

{
  "Type": "ALIYUN::VPC::VpnConnection",
  "Properties": {
    "IpsecConfig": Map,
    "Name": String,
    "IkeConfig": Map,
    "HealthCheckConfig": Map,
    "VpnGatewayId": String,
    "CustomerGatewayId": String,
    "RemoteSubnet": String,
    "LocalSubnet": String,
    "EffectImmediately": Boolean,
    "EnableTunnelsBgp": Boolean,
    "RemoteCaCertificate": String,
    "BgpConfig": Map,
    "AutoConfigRoute": Boolean,
    "EnableDpd": Boolean,
    "EnableNatTraversal": Boolean,
    "TunnelOptionsSpecification": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Name

String

IPsec连接的名称。

长度为2~128个字符。必须以英文字母或汉字开头,不能以http://https://开头。可包含英文字母、汉字、数字、英文句点(.)、下划线(_)和短划线(-)。

IkeConfig

Map

第一阶段协商的配置信息。

详情请参见IkeConfig属性

IpsecConfig

Map

第二阶段协商的配置信息。

详情请参见IpsecConfig属性

HealthCheckConfig

Map

健康检查的配置信息。

详情请参见HealthCheckConfig属性

VpnGatewayId

String

VPN网关的ID。

CustomerGatewayId

String

用户网关的ID。

RemoteSubnet

String

本地IDC的网段,用于第二阶段协商。

多个网段之间用半角逗号(,)分隔,例如:192.168.3.0/24,192.168.4.0/24。

LocalSubnet

String

和本地IDC互连的VPC侧的网段,用于第二阶段协商。

多个网段之间用半角逗号(,)分隔,例如:192.168.1.0/24,192.168.2.0/24。

EffectImmediately

Boolean

是否删除当前已协商成功的IPsec隧道并重新发起协商。

取值:

  • true:配置完成后立即进行协商。

  • false(默认值):当有流量进入时进行协商。

EnableTunnelsBgp

Boolean

隧道BGP的开启状态。

取值:

  • true:已开启。

  • false:未开启。

RemoteCaCertificate

String

对端的CA证书。

BgpConfig

Map

隧道的BGP配置信息。

更多信息,请参见BgpConfig属性

AutoConfigRoute

Boolean

是否自动配置路由。 

取值:

  • false:手动配置路由。 

  • true(默认):自动配置路由。 

EnableDpd

Boolean

IPsec连接是否已开启DPD(对等体存活检测)功能。

取值:

  • true:开启DPD功能。

    IPsec发起端会发送DPD报文用来检测对端的设备是否存活,如果在设定时间内未收到正确回应则认为对端已经断线,IPsec将删除ISAKMP SA和相应的IPsec SA,安全隧道同样也会被删除。

  • false:不开启DPD功能,IPsec发起端不会发送DPD探测报文。

EnableNatTraversal

Boolean

隧道是否已开启NAT穿越功能。

取值:

  • false:未开启。

  • true:已开启。

TunnelOptionsSpecification

List

IPsec连接的隧道配置信息。

更多信息,请参见TunnelOptionsSpecification属性

IkeConfig语法

"IkeConfig": {
  "RemoteId": String,
  "Psk": String,
  "IkeVersion": String,
  "IkeMode": String,
  "IkeAuthAlg": String,
  "IkeEncAlg": String,
  "IkePfs": String,
  "IkeLifetime": Integer,
  "LocalId": String
}

IkeConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

RemoteId

String

用户网关的标识。

最大长度为100个字符。默认值为用户网关的公网IP地址。

Psk

String

IPsec VPN网关与用户网关之间的身份认证。

最大长度为100个字符。默认情况下该参数值会随机生成,您也可以手动指定密钥。

IkeVersion

String

IKE协议的版本。

取值:

  • ikev1(默认值)

  • ikev2

IkeMode

String

IKE V1版本的协商模式。

取值:

  • main(默认值)

  • aggressive

IkeAuthAlg

String

第一阶段协商的认证算法。

取值:

  • md5(默认值)

  • sha1

IkeEncAlg

String

第一阶段协商的加密算法。

取值:

  • aes(默认值)

  • aes192

  • aes256

  • des

  • 3des

IkePfs

String

第一阶段协商使用的Diffie-Hellman密钥交换算法。

取值:

  • group1

  • group2(默认值)

  • group5

  • group14

  • group24

IkeLifetime

Integer

第一阶段协商出的SA的生存周期。

取值范围:0~86,400。

默认值:86,400。

LocalId

String

VPN网关的标识。

长度限制为100个字符,默认值为VPN网关的IP地址。

IpsecConfig语法

"IpsecConfig": {
  "IpsecAuthAlg": String,
  "IpsecEncAlg": String,
  "IpsecLifetime": Integer,
  "IpsecPfs": String
}

IpsecConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

IpsecAuthAlg

String

第二阶段协商的认证算法。

取值:

  • md5(默认值)

  • sha1

IpsecEncAlg

String

第二阶段协商的加密算法。

取值:

  • aes(默认值)

  • aes192

  • aes256

  • des

  • 3des

IpsecLifetime

Integer

第二阶段协商出的SA的生存周期。

取值范围:0~86,400。

单位:秒。

默认值:86,400。

IpsecPfs

String

第二阶段协商使用的Diffie-Hellman密钥交换算法。

取值:

  • group1

  • group2(默认值)

  • group5

  • group14

  • group24

HealthCheckConfig语法

"HealthCheckConfig": {
  "Enable": Boolean,
  "Dip": Boolean,
  "Retry": Integer,
  "Sip": String,
  "Interval": Integer,
  "Policy": String 
}   

HealthCheckConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Enable

Boolean

是否开启健康检查。

取值:

  • true

  • false

如果取值为true,则其他参数必须配置。

Interval

Integer

健康检查的重试间隔时间。

单位:秒。

Retry

Integer

健康检查的重试发包次数。

Dip

String

目标IP,即通过IPSec连接可以访问的线下IDC的IP地址。

Sip

String

源IP,即线下IDC通过IPSec连接可以访问的IP地址。

Policy

String

健康检查失败时是否撤销发布的路由。 

BgpConfig语法

"BgpConfig": {
  "TunnelCidr": String,
  "LocalBgpIp": String,
  "EnableBgp": Boolean,
  "LocalAsn": Number
}   

BgpConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

TunnelCidr

String

隧道的BGP网段。

LocalBgpIp

String

隧道本端(阿里云侧)的BGP地址。

EnableBgp

Boolean

指定隧道是否启用BGP特性。 

取值: 

  • true。

  • false。 

默认值:false。

LocalAsn

Number

隧道本端(阿里云侧)的自治系统号。

TunnelOptionsSpecification语法

"TunnelOptionsSpecification": [
  {
    "RemoteCaCertificate": String,
    "CustomerGatewayId": String,
    "TunnelBgpConfig": Map,
    "TunnelIpsecConfig": Map,
    "EnableDpd": Boolean,
    "TunnelIkeConfig": Map,
    "EnableNatTraversal": Boolean,
    "Role": String
  }
]

TunnelOptionsSpecification属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

RemoteCaCertificate

String

隧道对端的CA证书。

仅VPN网关实例的类型为国密型时才会返回当前参数。

CustomerGatewayId

String

隧道关联的用户网关ID。

TunnelBgpConfig

Map

隧道的BGP配置信息。

更多信息,请参见TunnelBgpConfig属性

TunnelIpsecConfig

Map

第二阶段协商的配置。

更多信息,请参见TunnelIpsecConfig属性

EnableDpd

Boolean

IPsec连接是否已开启DPD(对等体存活检测)功能。

取值:

  • true:开启DPD功能。

    IPsec发起端会发送DPD报文用来检测对端的设备是否存活,如果在设定时间内未收到正确回应则认为对端已经断线,IPsec将删除ISAKMP SA和相应的IPsec SA,安全隧道同样也会被删除。

  • false:不开启DPD功能,IPsec发起端不会发送DPD探测报文。

TunnelIkeConfig

Map

第一阶段协商的配置。

更多信息,请参见TunnelIkeConfig属性

EnableNatTraversal

Boolean

IPsec连接是否已开启NAT穿越功能。

取值:

  • true:开启NAT穿越功能。

    开启后,IKE协商过程会删除对UDP端口号的验证过程,同时实现对VPN隧道中NAT网关设备的发现功能。

  • false:不开启NAT穿越功能。

Role

String

隧道的角色。

取值:

  • master:表示当前隧道为主隧道。

  • slave:表示当前隧道为备隧道。

TunnelBgpConfig语法

"TunnelBgpConfig": {
  "TunnelCidr": String,
  "LocalAsn": Number,
  "LocalBgpIp": String
}   

TunnelBgpConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

TunnelCidr

String

隧道的BGP网段。

LocalBgpIp

String

隧道本端(阿里云侧)的BGP地址。

LocalAsn

Number

隧道本端(阿里云侧)的自治系统号。

TunnelIpsecConfig语法

"TunnelIpsecConfig": {
  "IpsecAuthAlg": String,
  "IpsecEncAlg": String,
  "IpsecPfs": String,
  "IpsecLifetime": Integer
}   

TunnelIpsecConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

IpsecAuthAlg

String

IPsec阶段认证算法。

IpsecEncAlg

String

IPsec阶段加密算法。

IpsecPfs

String

IPsec阶段生存时间。

单位:秒。

IpsecLifetime

Integer

隧道本端(阿里云侧)的自治系统号。

TunnelIkeConfig语法

"TunnelIkeConfig": {
  "Psk": String,
  "IkePfs": String,
  "LocalId": String,
  "IkeVersion": String,
  "IkeAuthAlg": String,
  "IkeMode": String,
  "RemoteId": String,
  "IkeLifetime": Integer,
  "IkeEncAlg": String
}   

TunnelIkeConfig属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Psk

String

预共享密钥。

IkePfs

String

IKE阶段DH分组。

LocalId

String

隧道本端(阿里云侧)的标识。

IkeVersion

String

IKE协议版本。

取值:

  • ikev1

  • ikev2

相对于IKEv1版本,IKEv2版本简化了SA的协商过程并且对于多网段的场景提供了更好的支持。

IkeAuthAlg

String

IKE阶段认证算法。

IkeMode

String

IKE协商模式。

物质:

  • main:主模式,协商过程安全性高。

  • aggressive:野蛮模式,协商快速且协商成功率高。

RemoteId

String

隧道对端的标识。

IkeLifetime

Integer

IKE阶段生存时间。

单位:秒。

IkeEncAlg

String

IKE阶段加密算法。

返回值

Fn::GetAtt

  • VpnConnectionId:IPsec连接的ID。

  • Status:IPsec连接的状态。

  • PeerVpnConnectionConfig:对等的VPC连接配置。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  LocalSubnet:
    Type: String
    Description: >-
      A network segment on the VPC side that needs to be interconnected with the
      local IDC for the second phase negotiation.

      Multiple network segments are separated by commas, for example:
      192.168.1.0/24, 192.168.2.0/24.
  EffectImmediately:
    Type: Boolean
    Description: >-
      Whether to delete the currently negotiated IPsec tunnel and re-initiate
      the negotiation. Value:

      True: Negotiate immediately after the configuration is complete.

      False (default): Negotiate when traffic enters.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
    Default: false
  RemoteSubnet:
    Type: String
    Description: >-
      The network segment of the local IDC is used for the second phase
      negotiation.

      Multiple network segments are separated by commas, for example:
      192.168.3.0/24, 192.168.4.0/24.
  CustomerGatewayId:
    Type: String
    Description: The ID of the user gateway.
  VpnGatewayId:
    Type: String
    Description: ID of the VPN gateway.
  IpsecConfig:
    Type: Json
    Description: Configuration information for the second phase negotiation.
  HealthCheckConfig:
    Type: Json
    Description: Whether to enable the health check configuration.
  IkeConfig:
    Type: Json
    Description: Configuration information for the first phase of negotiation.
  Name:
    Type: String
    Description: >-
      The name of the IPsec connection.

      The length is 2-128 characters and must start with a letter or Chinese. It
      can contain numbers, periods (.), underscores (_) and dashes (-), but
      cannot start with http:// or https:// .
    MinLength: 2
    MaxLength: 128
Resources:
  VpnConnection:
    Type: 'ALIYUN::VPC::VpnConnection'
    Properties:
      LocalSubnet:
        Ref: LocalSubnet
      EffectImmediately:
        Ref: EffectImmediately
      RemoteSubnet:
        Ref: RemoteSubnet
      CustomerGatewayId:
        Ref: CustomerGatewayId
      VpnGatewayId:
        Ref: VpnGatewayId
      IpsecConfig:
        Ref: IpsecConfig
      HealthCheckConfig:
        Ref: HealthCheckConfig
      IkeConfig:
        Ref: IkeConfig
      Name:
        Ref: Name
Outputs:
  Status:
    Description: Status of the IPsec connection.
    Value:
      'Fn::GetAtt':
        - VpnConnection
        - Status
  PeerVpnConnectionConfig:
    Description: Peer vpc connection config.
    Value:
      'Fn::GetAtt':
        - VpnConnection
        - PeerVpnConnectionConfig
  VpnConnectionId:
    Description: ID of the IPsec connection.
    Value:
      'Fn::GetAtt':
        - VpnConnection
        - VpnConnectionId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "LocalSubnet": {
      "Type": "String",
      "Description": "A network segment on the VPC side that needs to be interconnected with the local IDC for the second phase negotiation.\nMultiple network segments are separated by commas, for example: 192.168.1.0/24, 192.168.2.0/24."
    },
    "EffectImmediately": {
      "Type": "Boolean",
      "Description": "Whether to delete the currently negotiated IPsec tunnel and re-initiate the negotiation. Value:\nTrue: Negotiate immediately after the configuration is complete.\nFalse (default): Negotiate when traffic enters.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ],
      "Default": false
    },
    "RemoteSubnet": {
      "Type": "String",
      "Description": "The network segment of the local IDC is used for the second phase negotiation.\nMultiple network segments are separated by commas, for example: 192.168.3.0/24, 192.168.4.0/24."
    },
    "CustomerGatewayId": {
      "Type": "String",
      "Description": "The ID of the user gateway."
    },
    "VpnGatewayId": {
      "Type": "String",
      "Description": "ID of the VPN gateway."
    },
    "IpsecConfig": {
      "Type": "Json",
      "Description": "Configuration information for the second phase negotiation."
    },
    "HealthCheckConfig": {
      "Type": "Json",
      "Description": "Whether to enable the health check configuration."
    },
    "IkeConfig": {
      "Type": "Json",
      "Description": "Configuration information for the first phase of negotiation."
    },
    "Name": {
      "Type": "String",
      "Description": "The name of the IPsec connection.\nThe length is 2-128 characters and must start with a letter or Chinese. It can contain numbers, periods (.), underscores (_) and dashes (-), but cannot start with http:// or https:// .",
      "MinLength": 2,
      "MaxLength": 128
    }
  },
  "Resources": {
    "VpnConnection": {
      "Type": "ALIYUN::VPC::VpnConnection",
      "Properties": {
        "LocalSubnet": {
          "Ref": "LocalSubnet"
        },
        "EffectImmediately": {
          "Ref": "EffectImmediately"
        },
        "RemoteSubnet": {
          "Ref": "RemoteSubnet"
        },
        "CustomerGatewayId": {
          "Ref": "CustomerGatewayId"
        },
        "VpnGatewayId": {
          "Ref": "VpnGatewayId"
        },
        "IpsecConfig": {
          "Ref": "IpsecConfig"
        },
        "HealthCheckConfig": {
          "Ref": "HealthCheckConfig"
        },
        "IkeConfig": {
          "Ref": "IkeConfig"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "Status of the IPsec connection.",
      "Value": {
        "Fn::GetAtt": [
          "VpnConnection",
          "Status"
        ]
      }
    },
    "PeerVpnConnectionConfig": {
      "Description": "Peer vpc connection config.",
      "Value": {
        "Fn::GetAtt": [
          "VpnConnection",
          "PeerVpnConnectionConfig"
        ]
      }
    },
    "VpnConnectionId": {
      "Description": "ID of the IPsec connection.",
      "Value": {
        "Fn::GetAtt": [
          "VpnConnection",
          "VpnConnectionId"
        ]
      }
    }
  }
}
  • 本页导读 (1)
  • 语法
  • 属性
  • IkeConfig语法
  • IkeConfig属性
  • IpsecConfig语法
  • IpsecConfig属性
  • HealthCheckConfig语法
  • HealthCheckConfig属性
  • BgpConfig语法
  • BgpConfig属性
  • TunnelOptionsSpecification语法
  • TunnelOptionsSpecification属性
  • TunnelBgpConfig语法
  • TunnelBgpConfig属性
  • TunnelIpsecConfig语法
  • TunnelIpsecConfig属性
  • TunnelIkeConfig语法
  • TunnelIkeConfig属性
  • 返回值
  • 示例
文档反馈
phone 联系我们

立即和Alibaba Cloud在线服务人员进行交谈,获取您想了解的产品信息以及最新折扣。

alicare alicarealicarealicare