Attaching an Internet Service to a Net

You can attach an internet gateway to a Net in order to connect virtual machines (VMs) in one or more Subnets directly to the internet thanks to a route in their route table, security group rules and public IPs.

Linking an Internet Service Using Cockpit v2

  1. In the Internet Services dashboard, check the box of the internet service you want to link.
    The internet service is selected.

  2. Click IconLink Link to a Net.
    The LINK TO A NET dialog box appears.

  3. Select a Net from the Net list.

  4. Click Link.
    The internet service is linked to the Net.

Linking an Internet Service Using OSC CLI

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"
  }
}

Linking an Internet Service Using oapi-cli

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"
  }
}

Attaching an Internet Gateway Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To attach an internet gateway to a VPC, use the attach-internet-gateway command following this syntax:

Request sample
$ 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

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

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • internet-gateway-id: The ID of the internet gateway.

  • vpc-id: The ID of the VPC.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The internet gateway is attached to the specified VPC.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.