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. Click inside the Internet Services dashboard to make checkboxes appear.

  2. Check the box of the Internet service you want to link.
    The Internet service is selected and an action menu appears.

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

  4. Select a Net from the Net list.

  5. 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.

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

Attaching an Internet Gateway Using 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.

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.