Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::IpsecServer

Última atualização: Jun 27, 2026

O recurso ALIYUN::VPC::IpsecServer cria um servidor IPsec-VPN.

Sintaxe

{
  "Type": "ALIYUN::VPC::IpsecServer",
  "Properties": {
    "LocalSubnet": String,
    "EffectImmediately": Boolean,
    "ClientIpPool": String,
    "VpnGatewayId": String,
    "IpsecConfig": Map,
    "Psk": String,
    "IkeConfig": Map,
    "IpsecServerName": String,
    "PskEnabled": Boolean
  }
}

Propriedades

PropriedadeTipoObrigatórioEditávelDescriçãoRestrição
LocalSubnetStringSimSimBloco CIDR local. Corresponde ao bloco CIDR da Virtual Private Cloud (VPC) usada para conexão com o cliente.Separe vários blocos CIDR com vírgulas (,). Exemplo: 192.168.1.0/24,192.168.2.0/24.
EffectImmediatelyBooleanNãoSimDefina se o túnel IPsec atual será excluído e as negociações reiniciadas.Valor padrão: false. Valores válidos:
  • true: inicia as negociações após a conclusão da configuração.
  • false: inicia as negociações ao detectar tráfego de entrada.
VpnGatewayIdStringSimNãoID do gateway VPN.Nenhuma
IpsecConfigMapNãoSimConfigurações das negociações da Fase 2.Para mais informações, consulte Propriedades de IpsecConfig.
IkeConfigMapNãoSimConfigurações das negociações da Fase 1.Para mais informações, consulte Propriedades de IkeConfig.
ClientIpPoolStringSimSimBloco CIDR alocado à interface de rede virtual do cliente. Diferente do bloco CIDR onde o cliente reside.Quando o cliente acessa o servidor por meio de uma conexão SSL-VPN, o gateway VPN seleciona um endereço IP do bloco CIDR especificado e o atribui ao cliente.

Este bloco CIDR não pode entrar em conflito com o bloco CIDR especificado em LocalSubnet.

IpsecServerNameStringNãoSimNome da conexão IPsec-VPN.O nome deve ter entre 2 e 128 caracteres e pode conter letras, dígitos, pontos (.), sublinhados (_) e hifens (-). Deve começar com uma letra e não pode iniciar com http:// ou https://.
PskStringNãoSimChave pré-compartilhada.Usada para autenticação entre o gateway VPN e o gateway do cliente.

Especifique uma chave ou use a chave padrão gerada aleatoriamente pelo sistema.

A chave pode ter até 100 caracteres.
PskEnabledBooleanNãoSimIndica se a autenticação por chave pré-compartilhada está ativada.Valores válidos:
  • true: autenticação por chave pré-compartilhada ativada.
  • false: autenticação por chave pré-compartilhada desativada.

Sintaxe de IpsecConfig

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

Propriedades de IpsecConfig

PropriedadeTipoObrigatórioEditávelDescriçãoRestrição
IpsecPfsStringNãoSimAlgoritmo de troca de chaves Diffie-Hellman usado nas negociações da Fase 2. Se definido, o sistema encaminha pacotes de todos os protocolos.Valor padrão: group2. Valores válidos:
  • group1
  • group2
  • group5
  • group14
  • group24
IpsecEncAlgStringNãoSimAlgoritmo de criptografia usado nas negociações da Fase 2.Valor padrão: aes. Valores válidos:
  • aes
  • aes192
  • aes256
  • des
  • 3des
IpsecAuthAlgStringNãoSimAlgoritmo de autenticação usado nas negociações da Fase 2.Valor padrão: sha1. Valores válidos:
  • md5
  • sha1
IpsecLifetimeIntegerNãoSimTempo de vida da Associação de Segurança (SA) resultante das negociações da Fase 2.Valores válidos: 0 a 86400.

Unidade: segundos.

Valor padrão: 86400.

Sintaxe de IkeConfig

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

Propriedades de IkeConfig

PropriedadeTipoObrigatórioEditávelDescriçãoRestrição
IkeAuthAlgStringNãoSimAlgoritmo de autenticação usado nas negociações da Fase 1.Valor padrão: sha1. Valores válidos:
  • md5
  • sha1
LocalIdStringNãoSimID do gateway VPN.O ID pode ter até 100 caracteres. O valor padrão é o endereço IP público do gateway VPN.
IkeEncAlgStringNãoSimAlgoritmo de criptografia usado nas negociações da Fase 1.Valor padrão: aes. Valores válidos:
  • aes
  • aes192
  • aes256
  • des
  • 3des
IkeVersionStringNãoSimVersão do protocolo Internet Key Exchange (IKE).Valor padrão: ikev2. Valores válidos:
  • ikev1
  • ikev2
IkeModeStringNãoSimModo de negociação IKE.Valor padrão: main. Valores válidos:
  • main
  • aggressive
IkeLifetimeIntegerNãoSimTempo de vida da SA resultante das negociações da Fase 1.Valores válidos: 0 a 86400.

Unidade: segundos.

Valor padrão: 86400.
RemoteIdStringNãoSimID do gateway do cliente.O ID pode ter até 100 caracteres. O valor padrão é o endereço IP público do gateway do cliente.
IkePfsStringNãoSimAlgoritmo de troca de chaves Diffie-Hellman usado nas negociações da Fase 1.Valor padrão: group2. Valores válidos:
  • group1
  • group2
  • group5
  • group14
  • group24

Parâmetros de resposta

Fn::GetAtt

  • IpsecServerId: ID do servidor IPsec-VPN.

  • IpsecServerName: nome do servidor IPsec-VPN.

Exemplos

Formato JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "LocalSubnet": {
      "Type": "String",
      "Description": "The local network segment refers to the network segment on the VPC side that needs to be interconnected with the client network segment. Use half-width commas (,) to separate multiple network segments, for example: 192.168.1.0/24,192.168.2.0/24."
    },
    "EffectImmediately": {
      "Type": "Boolean",
      "Description": "true: Apply the new configuration and trigger a reconnection immediately. \nfalse: Trigger a reconnection only when network traffic occurs. (The reconnection may cause the network to be unavailable for a brief moment)",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "ClientIpPool": {
      "Type": "String",
      "Description": "Client network segment refers to the address segment that assigns access addresses to the virtual network card of the client. Note: The client network segment cannot conflict with the VPC side network segment."
    },
    "VpnGatewayId": {
      "Type": "String",
      "Description": "VPN gateway instance ID."
    },
    "IpsecConfig": {
      "Type": "Json",
      "Description": "Negotiation parameter configuration in the second phase."
    },
    "Psk": {
      "Type": "String",
      "Description": "Pre-Shared key. Used for identity authentication between the VPN gateway and the client. A 16-bit random string is randomly generated by default, or you can manually specify the key. The length is limited to 100 characters."
    },
    "IkeConfig": {
      "Type": "Json",
      "Description": "Negotiation parameter configuration in the first phase."
    },
    "IpsecServerName": {
      "Type": "String",
      "Description": "The value must be 2 to 128 characters in length and start with a letter or Chinese character. It can contain digits, underscores (_), and hyphens (-)."
    },
    "PskEnabled": {
      "Type": "Boolean",
      "Description": "Whether to enable the pre-shared key authentication method. Only the value is true, which means that the pre-shared key authentication mode is enabled.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    }
  },
  "Resources": {
    "IpsecServer": {
      "Type": "ALIYUN::VPC::IpsecServer",
      "Properties": {
        "LocalSubnet": {
          "Ref": "LocalSubnet"
        },
        "EffectImmediately": {
          "Ref": "EffectImmediately"
        },
        "ClientIpPool": {
          "Ref": "ClientIpPool"
        },
        "VpnGatewayId": {
          "Ref": "VpnGatewayId"
        },
        "IpsecConfig": {
          "Ref": "IpsecConfig"
        },
        "Psk": {
          "Ref": "Psk"
        },
        "IkeConfig": {
          "Ref": "IkeConfig"
        },
        "IpsecServerName": {
          "Ref": "IpsecServerName"
        },
        "PskEnabled": {
          "Ref": "PskEnabled"
        }
      }
    }
  },
  "Outputs": {
    "IpsecServerId": {
      "Description": "IPsec server ID.",
      "Value": {
        "Fn::GetAtt": [
          "IpsecServer",
          "IpsecServerId"
        ]
      }
    },
    "IpsecServerName": {
      "Description": "IPsec server name.",
      "Value": {
        "Fn::GetAtt": [
          "IpsecServer",
          "IpsecServerName"
        ]
      }
    }
  }
}

Formato YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClientIpPool:
    Description: 'Client network segment refers to the address segment that assigns
      access addresses to the virtual network card of the client. Note: The client
      network segment cannot conflict with the VPC side network segment.'
    Type: String
  EffectImmediately:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: "true: Apply the new configuration and trigger a reconnection immediately.\
      \ \nfalse: Trigger a reconnection only when network traffic occurs. (The reconnection\
      \ may cause the network to be unavailable for a brief moment)"
    Type: Boolean
  IkeConfig:
    Description: Negotiation parameter configuration in the first phase.
    Type: Json
  IpsecConfig:
    Description: Negotiation parameter configuration in the second phase.
    Type: Json
  IpsecServerName:
    Description: The value must be 2 to 128 characters in length and start with a
      letter or Chinese character. It can contain digits, underscores (_), and hyphens
      (-).
    Type: String
  LocalSubnet:
    Description: 'The local network segment refers to the network segment on the VPC
      side that needs to be interconnected with the client network segment. Use half-width
      commas (,) to separate multiple network segments, for example: 192.168.1.0/24,192.168.2.0/24.'
    Type: String
  Psk:
    Description: Pre-Shared key. Used for identity authentication between the VPN
      gateway and the client. A 16-bit random string is randomly generated by default,
      or you can manually specify the key. The length is limited to 100 characters.
    Type: String
  PskEnabled:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: Whether to enable the pre-shared key authentication method. Only
      the value is true, which means that the pre-shared key authentication mode is
      enabled.
    Type: Boolean
  VpnGatewayId:
    Description: VPN gateway instance ID.
    Type: String
Resources:
  IpsecServer:
    Properties:
      ClientIpPool:
        Ref: ClientIpPool
      EffectImmediately:
        Ref: EffectImmediately
      IkeConfig:
        Ref: IkeConfig
      IpsecConfig:
        Ref: IpsecConfig
      IpsecServerName:
        Ref: IpsecServerName
      LocalSubnet:
        Ref: LocalSubnet
      Psk:
        Ref: Psk
      PskEnabled:
        Ref: PskEnabled
      VpnGatewayId:
        Ref: VpnGatewayId
    Type: ALIYUN::VPC::IpsecServer
Outputs:
  IpsecServerId:
    Description: IPsec server ID.
    Value:
      Fn::GetAtt:
      - IpsecServer
      - IpsecServerId
  IpsecServerName:
    Description: IPsec server name.
    Value:
      Fn::GetAtt:
      - IpsecServer
      - IpsecServerName