Attacher un internet service à un Net

Vous pouvez attacher un internet service à un Net afin de connecter des machines virtuelles (VM) dans un ou plusieurs Subnets à Internet de manière directe grâce à une route dans leur route table, des règles de security groups et des IP publiques.

Lier un internet service avec Cockpit v2

  1. Dans le dashboard Internet Services, cochez la case de l’internet service que vous souhaitez lier.
    L’internet service est sélectionné.

  2. Cliquez sur IconLink Lier à un Net.
    La boîte de dialogue LIER À UN NET apparaît.

  3. Sélectionnez un Net dans la liste Net.

  4. Cliquez sur Lier.
    L’internet service est lié au Net.

Lier un internet service avec OSC CLI

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

The LinkInternetService command attaches an internet service to a Net.
To enable the connection between the Internet and a Net, you must attach an internet service to this Net.

Request sample
$ osc-cli api LinkInternetService --profile "default" \
    --InternetServiceId "igw-12345678" \
    --NetId "vpc-12345678"

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

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

  • InternetServiceId: The ID of the internet service you want to attach.

  • NetId: The ID of the Net to which you want to attach the internet service.

The LinkInternetService command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Lier un Internet service avec oapi-cli

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

The LinkInternetService command attaches an internet service to a Net.
To enable the connection between the Internet and a Net, you must attach an internet service to this Net.

Request sample
$ oapi-cli --profile "default" LinkInternetService \
    --InternetServiceId "igw-12345678" \
    --NetId "vpc-12345678"

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

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

  • InternetServiceId: The ID of the internet service you want to attach.

  • NetId: The ID of the Net to which you want to attach the internet service.

The LinkInternetService command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Attacher une internet gateway avec AWS CLI

Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

Pour attacher une internet gateway à un VPC, utilisez la commande attach-internet-gateway en suivant cette syntaxe :

Exemple de requête
$ aws ec2 attach-internet-gateway \
    --profile YOUR_PROFILE \
    --internet-gateway-id igw-12345678 \
    --vpc-id vpc-12345678 \
    --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.

  • internet-gateway-id : L’ID d’une internet gateway.

  • vpc-id : L’ID du VPC.

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

L’internet gateway est attachée au VPC spécifié.

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.