Create a network interface for your EC2 instance - Amazon Elastic Compute Cloud

Create a network interface for your EC2 instance

You can create a network interface for use by your EC2 instances. When you create a network interface, you specify the subnet for which it is created. You can't move a network interface to another subnet after it's created. You must attach a network interface to an instance in the same Availability Zone. You can detach a secondary network interface from an instance and then attach it to a different instance in the same Availability Zone. You can't detach a primary network interface from an instance. For more information, see Network interface attachments for your EC2 instance.

To create a network interface using the console
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Network Interfaces.

  3. Choose Create network interface.

  4. (Optional) For Description, enter a descriptive name.

  5. For Subnet, select a subnet. The options available in the subsequent steps change depending on the type of subnet you select (IPv4-only, IPv6-only, or dual-stack (IPv4 and IPv6)).

  6. For Private IPv4 address, do one of the following:

    • Choose Auto-assign to allow Amazon EC2 to select an IPv4 address from the subnet.

    • Choose Custom and enter an IPv4 address that you select from the subnet.

  7. (Subnets with IPv6 addresses only) For IPv6 address, do one of the following:

    • Choose None if you do not want to assign an IPv6 address to the network interface.

    • Choose Auto-assign to allow Amazon EC2 to select an IPv6 address from the subnet.

    • Choose Custom and enter an IPv6 address that you select from the subnet.

  8. (Optional) If you’re creating a network interface in a dual-stack or IPv6-only subnet, you have the option to Assign Primary IPv6 IP. This assigns a primary IPv6 global unicast address (GUA) to the network interface. Assigning a primary IPv6 address enables you to avoid disrupting traffic to instances or ENIs. Choose Enable if the instance that this ENI will be attached to relies on its IPv6 address not changing. AWS will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you can't disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.

  9. (Optional) To create an Elastic Fabric Adapter, choose Elastic Fabric Adapter, Enable.

  10. (Optional) Under Advanced settings, for Idle connection tracking timeout, modify the default idle connection timeouts. For more information about these options, see Idle connection tracking timeout.

    • TCP established timeout: Timeout (in seconds) for idle TCP connections in an established state. Min: 60 seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: Less than 432000 seconds.

    • UDP timeout: Timeout (in seconds) for idle UDP flows that have seen traffic only in a single direction or a single request-response transaction. Min: 30 seconds. Max: 60 seconds. Default: 30 seconds.

    • UDP stream timeout: Timeout (in seconds) for idle UDP flows classified as streams which have seen more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 seconds.

  11. For Security groups, select one or more security groups.

  12. (Optional) For each tag, choose Add new tag and enter a tag key and an optional tag value.

  13. Choose Create network interface.

To create a network interface using the command line

Use one of the following commands.