Attaching an FNI to an Instance

You can attach flexible network interfaces (FNIs) to an instance of the same Virtual Private Cloud (VPC), placed in any subnet of the same Availability Zone (AZ) as the FNI. Attaching FNIs to an instance partitions its network.

This action updates the state of the FNI from available to in-use. For more information, see About FNIs > FNIs Attachment to Instances.

The number of maximum FNIs you can attach to an instance depends on the used instance type used. For more information, see Instance Types.

Attaching an FNI to an Instance Using Cockpit v1

  1. Click Network/Security > Flexible Network Interfaces.

  2. Click the FNI you want to attach to an instance.
    The FNI is selected.

  3. Click Attach .
    The ATTACH INSTANCE TO FNI dialog box appears.

  4. From the Instance list, select the instance you want to attach the FNI to.

  5. In the Device field, type the device index for the FNI attachment (between 1 and 7, both included).

  6. Click Attach to validate.
    The FNI is attached to the selected instance.

If you are attaching an FNI to a running instance, the network interface may not automatically be configured inside the instance. Therefore, you must either restart the instance, or configure the network interface manually as follows:

  1. Connect to the instance. For more information, see Accessing Your Instances.

  2. Enable the network interface by typing the following command in a terminal of the instance:

    $ sudo ip link set NI_NAME up
  3. Configure the network interface using the Dynamic Host Configuration Protocol (DHCP) by typing the following command in a terminal of the instance:

    $ sudo dhclient NI_NAME

Linking a NIC to a VM Using Cockpit v2-beta

  1. Click inside the NICs dashboard to make checkboxes appear.

  2. Check the box of the NIC you want to link to a VM.
    The NIC is selected and an action menu appears.

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

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

  5. In the Device field, type the device index for the NIC link (between 1 and 7, both included).

  6. Click Link.
    The NIC is linked to the VM.

If you are linking a NIC to a running VM, the network interface may not automatically be configured inside the VM. Therefore, you must either restart the VM, or configure the network interface manually as follows:

  1. Connect to the VM. For more information, see Accessing Your Instances.

  2. Enable the network interface by typing the following command in a terminal of the VM:

    $ sudo ip link set NI_NAME up
  3. Configure the network interface using the Dynamic Host Configuration Protocol (DHCP) by typing the following command in a terminal of the VM:

    $ sudo dhclient NI_NAME

Linking a NIC to a VM Using OSC CLI

See the LinkNic command sample in the documentation of the OUTSCALE API.

Attaching an FNI to an Instance Using AWS CLI

To attach a FNI to an instance, use the attach-network-interface command following this syntax:

Request sample
$ aws ec2 attach-network-interface \
    --profile YOUR_PROFILE \
    --network-interface-id eni-12345678 \
    --instance-id i-87654321 \
    --device-index 2 \
    --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.

  • network-interface-id: The ID of the FNI to attach.

  • instance-id: The ID of the instance to which you want to attach the FNI.

  • device-index: The device index for the FNI attachment (between 1 and 7, both included).

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

The attach-network-interface command returns the following element:

  • AttachmentId: The ID of the attachment operation.

Result sample
{
    "AttachmentId": "eni-attach-1234abcd"
}

The FNI is attached to the specified instance.

If you are attaching an FNI to a running instance, the network interface may not automatically be configured inside the instance. Therefore, you must either restart the instance, or configure the network interface manually as follows:

  1. Connect to the instance. For more information, see Accessing Your Instances.

  2. Enable the network interface by typing the following command in a terminal of the instance:

    $ sudo ip link set NI_NAME up
  3. Configure the network interface using the Dynamic Host Configuration Protocol (DHCP) by typing the following command in a terminal of the instance:

    $ sudo dhclient NI_NAME

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.