Créer une connexion VPN

Vous pouvez créer une connexion VPN entre votre réseau d’entreprise et un de vos Nets dans le Cloud OUTSCALE.

Cette action crée un tunnel VPN sécurisé entre une client gateway et une virtual gateway. La connexion VPN reste dans l’état pending jusqu’à ce que du trafic soit généré à partir de la client gateway. Pour en savoir plus, voir À propos des connexions VPN.

Une fois la connexion VPN créée, vous devez la configurer. Pour en savoir plus, voir Tutoriel : Mettre en place une connexion VPN.

Créer une connexion VPN avec Cockpit v2

Avant de commencer :

  1. Dans le dashboard VPN Connections, cliquez sur IconAddFull Créer une connexion VPN.
    La boîte de dialogue CRÉER UNE CONNEXION VPN apparaît.

  2. Spécifiez les informations suivantes :

    1. Dans le champ Nom, tapez un nom pour la connexion VPN.

      Cette action ajoute un tag Name de 255 caractères maximum. Vous pouvez utiliser tous les caractères, y compris les lettres accentuées.

    2. Dans la liste ID de la client gateway, sélectionnez l’ID de la client gateway que vous voulez utiliser.

    3. Dans la liste ID de la virtual gateway, sélectionnez l’ID de la virtual gateway que vous voulez utiliser.

    4. Dans la liste Routage, sélectionnez le type de routage que vous voulez utiliser. Pour en savoir plus, voir À propos des configurations de routage des connexions VPN > Routages statique et dynamique et Gérer les routes pour vos connexions VPN.

      Si vous sélectionnez le routage statique, vous pouvez créer des routes pour la connexion VPN. Si vous sélectionnez le routage dynamique, la création de nouvelles routes n’est pas nécessaire. Pour en savoir plus, voir Créer une route pour une connexion VPN.

  3. Cliquez sur Créer une connexion VPN.
    La connexion VPN est créée.

    Pour télécharger les informations de configuration au format XML, sélectionnez la connexion VPN et cliquez sur IconSetting Configuration.

Créer une connexion VPN avec OSC CLI

Avant de commencer :

À ce jour, cette section est disponible en anglais uniquement.

The CreateVpnConnection command creates a VPN connection between a specified virtual gateway and a specified client gateway.
You can create only one VPN connection between a virtual gateway and a client gateway.

This action can be done only if the virtual gateway is in the available state.

For more information, see About VPN Connections.

Request sample
$ osc-cli api CreateVpnConnection --profile "default" \
    --ClientGatewayId "cgw-12345678" \
    --VirtualGatewayId "vgw-12345678" \
    --ConnectionType "ipsec.1" \
    --StaticRoutesOnly True

This command contains the following attributes that you need to specify:

  • ClientGatewayId: The ID of the client gateway.

  • ConnectionType: The type of VPN connection (always ipsec.1).

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • StaticRoutesOnly: (optional) By default or if false, the VPN connection uses dynamic routing with Border Gateway Protocol (BGP). If true, routing is controlled using static routes. For more information about how to create and delete static routes, see CreateVpnConnectionRoute and DeleteVpnConnectionRoute.

  • VirtualGatewayId: The ID of the virtual gateway.

The CreateVpnConnection command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • VpnConnection: Information about a VPN connection.

    • ClientGatewayConfiguration: Example configuration for the client gateway.

    • ClientGatewayId: The ID of the client gateway used on the client end of the connection.

    • ConnectionType: The type of VPN connection (always ipsec.1).

    • Routes: Information about one or more static routes associated with the VPN connection, if any.

      • DestinationIpRange: The IP range used for the destination match, in CIDR notation (for example, 10.0.0.0/24).

      • RouteType: The type of route (always static).

      • State: The current state of the static route (pending | available | deleting | deleted).

    • State: The state of the VPN connection (pending | available | deleting | deleted).

    • StaticRoutesOnly: If false, the VPN connection uses dynamic routing with Border Gateway Protocol (BGP). If true, routing is controlled using static routes. For more information about how to create and delete static routes, see CreateVpnConnectionRoute and DeleteVpnConnectionRoute.

    • Tags: One or more tags associated with the VPN connection.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • VgwTelemetries: Information about the current state of one or more of the VPN tunnels.

      • AcceptedRouteCount: The number of routes accepted through BGP (Border Gateway Protocol) route exchanges.

      • LastStateChangeDate: The date and time (UTC) of the latest state update.

      • OutsideIpAddress: The IP on the OUTSCALE side of the tunnel.

      • State: The state of the IPSEC tunnel (UP | DOWN).

      • StateDescription: A description of the current state of the tunnel.

    • VirtualGatewayId: The ID of the virtual gateway used on the OUTSCALE end of the connection.

    • VpnConnectionId: The ID of the VPN connection.

    • VpnOptions: Information about the VPN options.

      • Phase1Options: Information about Phase 1 of the Internet Key Exchange (IKE) negotiation. When Phase 1 finishes successfully, peers proceed to Phase 2 negotiations.

        • DpdTimeoutAction: The action to carry out after a Dead Peer Detection (DPD) timeout occurs.

        • DpdTimeoutSeconds: The maximum waiting time for a Dead Peer Detection (DPD) response before considering the peer as dead, in seconds.

        • IkeVersions: The Internet Key Exchange (IKE) versions allowed for the VPN tunnel.

        • Phase1DhGroupNumbers: The Diffie-Hellman (DH) group numbers allowed for the VPN tunnel for phase 1.

        • Phase1EncryptionAlgorithms: The encryption algorithms allowed for the VPN tunnel for phase 1.

        • Phase1IntegrityAlgorithms: The integrity algorithms allowed for the VPN tunnel for phase 1.

        • Phase1LifetimeSeconds: The lifetime for phase 1 of the IKE negotiation process, in seconds.

        • ReplayWindowSize: The number of packets in an IKE replay window.

        • StartupAction: The action to carry out when establishing tunnels for a VPN connection.

      • Phase2Options: Information about Phase 2 of the Internet Key Exchange (IKE) negotiation.

        • Phase2DhGroupNumbers: The Diffie-Hellman (DH) group numbers allowed for the VPN tunnel for phase 2.

        • Phase2EncryptionAlgorithms: The encryption algorithms allowed for the VPN tunnel for phase 2.

        • Phase2IntegrityAlgorithms: The integrity algorithms allowed for the VPN tunnel for phase 2.

        • Phase2LifetimeSeconds: The lifetime for phase 2 of the Internet Key Exchange (IKE) negociation process, in seconds.

        • PreSharedKey: The pre-shared key to establish the initial authentication between the client gateway and the virtual gateway. This key can contain any character except line breaks and double quotes (").

      • TunnelInsideIpRange: The range of inside IPs for the tunnel. This must be a /30 CIDR block from the 169.254.254.0/24 range.

Result sample
{
  "VpnConnection": {
    "Routes": [],
    "Tags": [],
    "ClientGatewayConfiguration": "...",
    "StaticRoutesOnly": true,
    "VirtualGatewayId": "vgw-12345678",
    "ConnectionType": "ipsec.1",
    "ClientGatewayId": "cgw-12345678",
    "State": "pending",
    "VgwTelemetries": [
      {
        "StateDescription": "IPSEC IS DOWN",
        "AcceptedRouteCount": 0,
        "LastStateChangeDate": "2017-05-10T12:34:56.789Z",
        "OutsideIpAddress": "192.0.2.0"
      }
    ],
    "VpnConnectionId": "vpn-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Créer une connexion VPN avec AWS CLI

Avant de commencer :

Pour créer une connexion VPN, utilisez la commande create-vpn-connection en suivant cette syntaxe :

Exemple de requête
$ aws ec2 create-vpn-connection \
    --profile YOUR_PROFILE \
    --customer-gateway-id cgw-f491f6d9 \
    --vpn-gateway-id vgw-00ac2c82 \
    --type ipsec.1 \
    --options {\"StaticRoutesOnly\":true} \
    --endpoint https://fcu.eu-west-2.outscale.com

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • customer-gateway-id : L’ID de la customer gateway que vous voulez utiliser. Pour en savoir plus, voir Gérer vos client gateways.

  • vpn-gateway-id : L’ID de la virtual private gateway que vous voulez utiliser. Pour en savoir plus, voir Gérer vos virtual gateways.

  • type : Le type de connexion VPN (toujours ipsec.1). Pour en savoir plus, voir À propos des connexions VPN.

  • (optionnel) options : Informations à propos du routage de la connexion VPN. Cet attribut contient les éléments suivants que vous devez spécifier :

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête.

La commande create-vpn-connection renvoie les éléments suivants :

  • VpnConnection : Informations à propos de la connexion VPN. Cet élément contient les informations suivantes :

    • VpnConnectionId : L’ID de la connexion VPN.

    • Tags : Un ou plusieurs tags associés à la connexion VPN. Cet élément contient les informations suivantes :

      • Key : La clé du tag.

      • Value : La valeur du tag.

    • CustomerGatewayConfiguration : Exemple de configuration pour la customer gateway, au format XML. Pour en savoir plus, voir Tutoriel : Mettre en place une connexion VPN.

    • Routes : Informations à propos des routes statiques associées à la connexion, le cas échéant. Cet élément contient les informations suivantes :

      • DestinationCidrBlock : La plage d’IP de destination de la route, en notation CIDR.

      • Source : Le type de route (toujours static).

      • State : L’état de la route statique (pending | available | deleting | deleted).

    • VgwTelemetry : Informations à propos de l’état du tunnel VPN. Cet élément contient les informations suivantes :

      • Status : L’état du tunnel VPN (UP | DOWN). Pour en savoir plus, voir À propos des connexions VPN.

      • AcceptedRouteCount : Le nombre de routes acceptées dans les échanges Border Gateway Protocol (BGP).

      • OutsideIpAddress : L’IP sur la face externe de la virtual private gateway.

      • LastStatusChange : La date et l’heure du dernier changement d’état du tunnel VPN.

      • StatusMessage : Une description de l’état actuel du tunnel VPN.

    • State : L’état de la connexion VPN (pending | available | deleting | deleted). Pour en savoir plus, voir À propos des connexions VPN.

    • VpnGatewayId : L’ID de la virtual private gateway du côté OUTSCALE de la connexion VPN.

    • CustomerGatewayId : L’ID de la customer gateway de votre côté de la connexion VPN.

    • Type : Le type de connexion VPN (toujours ipsec.1).

    • Options : Informations à propos du routage de la connexion VPN. Cet élément contient les informations suivantes :

Exemple de résultat
 {
    "VpnConnection": {
        "VpnConnectionId": "vpn-c750ea06",
        "Tags": [],
        "CustomerGatewayConfiguration": CONFIGURATION_INFORMATION,
        "Routes": [],
        "VgwTelemetry": [
            {
                "Status": "DOWN",
                "AcceptedRouteCount": 0,
                "OutsideIpAddress": "171.33.67.245",
                "LastStatusChange": "2017-02-01T14:08:51.649Z",
                "StatusMessage": "IPSEC IS DOWN"
            }
        ],
        "State": "pending",
        "VpnGatewayId": "vgw-00ac2c82",
        "CustomerGatewayId": "cgw-f491f6d9",
        "Type": "ipsec.1",
        "Options": {
            "StaticRoutesOnly": false
        }
    }
}

La connexion VPN est créée.

Pages connexes

Méthodes API correspondantes

AWS™ et Amazon Web Services™ sont des marques de commerce d’Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.