Associating an EIP with an Instance or a Network Interface

You can associate an External IP (EIP) with an instance or a network interface, either in the public Cloud or in a Virtual Private Cloud (VPC).

In the public Cloud, the EIP replaces the public IP of the instance. In a VPC, it attaches a public IP to the instance or the network interface. For more information, see About EIPs > EIP Association.

You can also associate an EIP with a NAT gateway. However, you can do so only when creating the NAT gateway. For more information, see Creating a NAT Gateway.

Associating an EIP Using Cockpit v1

Associating an External IP at Once

Before you begin: To associate an EIP with an instance or a network interface in a VPC, ensure that the VPC has an Internet gateway attached. For more information, see Attaching an Internet Gateway to a VPC.

  1. Click Network/Security > External IPs.

    You can also associate an EIP with an Instance in the Compute > Instances page.

  2. Click the EIP you want to associate with an instance or a network interface.
    The EIP is selected.

  3. Click Associate Instance or Associate FNI .
    The ASSOCIATE INSTANCE XXX or ASSOCIATE XXX dialog box appears.

  4. From the list, select the instance or the network interface you want to associate the EIP with.

  5. Click Associate to validate.
    The EIP is associated with the instance or the network interface.

Auto-Associating an External IP at Every Instance Restart

Before you begin: To associate an EIP with an instance or a network interface in a VPC, ensure that the VPC has an Internet gateway attached. For more information, see Attaching an Internet Gateway to a VPC.

  1. Click Compute > Instances.

  2. Click the instance you want to associate with an EIP.
    The instance is selected.

  3. Click Associate EIP .
    The ASSOCIATE TO XXX dialog box appears.

  4. From the list, select the EIP you want to associate with your instance.

  5. Select the Auto associate the selected IP box.

  6. Click Associate to validate.

    A tag is added to the instance with osc.fcu.eip.auto-attach as Key and your EIP as Value. The EIP is associated to your instance every time it is restarted. For more information, see Configuring an Instance with User Data and OUTSCALE Tags.

Linking a Public IP Using Cockpit v2-beta

Linking a Public IP to a VM

Before you begin: To link a public IP to a VM, ensure that the Net has an Internet service attached. For more information, see Attaching an Internet Gateway to a VPC.

  1. Click inside the Public IPs dashboard to make checkboxes appear.

    You can also link a public IP to a VM in the VMs dashboard.

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

  3. Click IconLink Link to VM.
    The LINK TO VM dialog box appears.

  4. From the list, select the VM you want to link the public IP to.

  5. (optional) Select the Auto-link the selected VM box to automatically link the public IP to the selected VM at every VM restart.

    A tag is added to the VM with osc.fcu.eip.auto-attach as Key and your public IP as Value. The public IP is linked to your VM every time it is restarted. For more information, see Configuring an Instance with User Data and OUTSCALE Tags.

  6. Click Link to VM to validate.
    The public IP is linked to the VM.

Linking a Public IP to a NIC

Before you begin: To link a public IP to a NIC, ensure that the Net has an Internet service attached. For more information, see Attaching an Internet Gateway to a VPC.

  1. Click inside the Public IPs dashboard to make checkboxes appear.

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

  3. Click IconLink Link to NIC.
    The LINK TO NIC dialog box appears.

  4. From the list, select the NIC you want to link the public IP to.

  5. Click Link to NIC to validate.
    The public IP is linked to the NIC.

Associating an EIP Using AWS CLI

Before you begin: To associate an EIP with an instance or a network interface in a VPC, ensure that the VPC has an Internet gateway attached. For more information, see Attaching an Internet Gateway to a VPC.

To associate an EIP with an instance or a network interface, use the associate-address command following this syntax:

Request sample
$ aws ec2 associate-address \
    --profile YOUR_PROFILE \
    --allocation-id eipalloc-12345678 \
    [--public-ip NOT_SPECIFIED] \
    [--allow-reassociation | --no-allow-reassociation] \
    --instance-id i-12345678 \
    [--network-interface-id NOT_SPECIFIED] \
    --private-ip-address 10.0.0.0 \
    --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.

  • (optional) allocation-id: The allocation ID of the EIP in your account.

  • (optional) public-ip: The EIP.

    • In the public Cloud, you need to specify the public-ip attribute.

    • In a VPC, you need to specify the allocation-id attribute.

  • (optional) allow-reassociation | no-allow-reassociation: If set to allow-reassociation, the EIP is disassociated from any current instance or network interface and reassociated with the specified one. If set to no-allow-reassociation, an error message is returned if you try to reassociate an EIP that is already associated.

    By default, this attribute is set to allow-reassociation in the public Cloud, and to no-allow-reassociation in a VPC.

  • (optional) instance-id: The ID of the instance you want to associate the EIP with, if the instance has only one network interface.

  • (optional) network-interface-id: The ID of the network interface you want to associate the EIP with, if the instance has several network interfaces.

    • In the public Cloud, you need to specify the instance-id attribute.

    • In a VPC, you need to specify the instance-id attribute if the instance has only one network interface. If the instance has more than one network interface attached, you need to specify the network-interface-id attribute instead.

  • (optional) private-ip-address: The primary or secondary private IP of the specified network interface (by default, the primary private IP).

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

In the public Cloud, the associate-address command returns no element. In a VPC, it returns the following element:

  • (VPC only) AssociationId: The ID of the association of the EIP with the instance or the network interface.

Result sample
{
    "AssociationId": "eipassoc-12345678"
}

A tag is added to the instance with osc.fcu.eip.auto-attach as Key and your EIP as Value. The EIP is associated to your instance every time it is restarted. For more information, see Configuring an Instance with User Data and OUTSCALE Tags.

Related Pages

Corresponding API Method

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