Launch the instance using a supported version of the Linux kernel and
a supported distribution, so that ENA enhanced networking is enabled for
your instance automatically. For more information, see ENA Linux Kernel Driver Release Notes.

If you have important data on the instance that you want to preserve, you
should back that data up now by creating an AMI from your instance. Updating
kernels and kernel modules, as well as enabling the enaSupport
attribute, might render incompatible instances or operating systems
unreachable; if you have a recent backup, your data will still be retained
if this happens.

Testing Whether Enhanced Networking Is Enabled

To test whether enhanced networking is already
enabled, verify that the ena module
is installed on your instance and that
the enaSupport attribute is set. If
your instance satisfies these two conditions, then the ethtool -i
ethn command should show that the
module is in use on the network interface.

Kernel Module (ena)

To verify that the ena module is installed, use the
modinfo command as follows:

Use the following command to verify that the ena module is
being used on a particular interface, substituting the interface name that you
wish to check. If you are using a single interface (default), it will be
eth0.

In this case, the ena module is loaded and at the
minimum recommended version. This instance has enhanced networking properly
configured.

Enabling Enhanced Networking on the Amazon Linux AMI

Amazon Linux 2 and the latest versions of the Amazon Linux AMI have the module required
for
enhanced networking installed and have the required enaSupport
attribute set. Therefore, if you launch an instance with an HVM version of Amazon
Linux on a
supported instance type, enhanced networking is already enabled for your
instance. For more information, see Testing Whether Enhanced Networking Is Enabled.

If you launched your instance using an older Amazon Linux AMI and it does not
have enhanced networking enabled already, use the following procedure to enable
enhanced networking.

To enable enhanced networking on Amazon Linux AMI

Connect to your instance.

From the instance, run the following command to update your instance with
the newest kernel and kernel modules, including
ena:

[ec2-user ~]$ sudo yum update

From your local computer, reboot your instance using the Amazon EC2 console or
one of the following commands: reboot-instances
(AWS CLI), Restart-EC2Instance (AWS Tools for Windows PowerShell).

[EBS-backed instance] From your local computer, stop the instance using the Amazon
EC2 console or one
of the following commands: stop-instances (AWS CLI),
Stop-EC2Instance (AWS Tools for Windows PowerShell). If your instance
is managed by AWS OpsWorks, you should stop the instance in the AWS OpsWorks console
so that the instance state remains in
sync.

(Optional) Create an AMI from the instance, as described in Creating an Amazon EBS-Backed Linux AMI. The AMI
inherits the enhanced networking enaSupport attribute
from the instance. Therefore, you can use this AMI to launch another
instance with enhanced networking enabled by default.

From your local computer, start the instance using the Amazon EC2 console or
one of the following commands: start-instances
(AWS CLI), Start-EC2Instance (AWS Tools for Windows PowerShell). If your instance is managed by
AWS OpsWorks, you should start the instance in the AWS OpsWorks console so that the
instance state remains in sync.

Follow the previous procedure until the step where you stop the instance. Create a
new AMI as described
in Creating an Instance Store-Backed Linux AMI,
making sure to enable the enhanced networking attribute when you register the AMI.

Enabling Enhanced Networking on Ubuntu

The latest Ubuntu HVM AMIs have the module required for enhanced networking with
ENA installed and have the required enaSupport attribute set.
Therefore, if you launch an instance with the latest Ubuntu HVM AMI on a supported
instance type, enhanced networking is already enabled for your instance.
For more information, see Testing Whether Enhanced Networking Is Enabled.

If you launched your instance using an older AMI and it does not have enhanced
networking enabled already, you can install the linux-aws
kernel package to get the latest enhanced networking drivers and update the
required attribute.

To install the linux-aws kernel package

Connect to your instance.

Update the package cache and packages.

ubuntu:~$ sudo apt-get update && sudo apt-get upgrade -y linux-aws

Important

If during the update process you are prompted to install
grub, use /dev/xvda to
install grub onto, and then choose to keep the
current version of /boot/grub/menu.lst.

[EBS-backed instance] From your local computer, stop the instance using the Amazon
EC2 console or one
of the following commands: stop-instances (AWS CLI),
Stop-EC2Instance (AWS Tools for Windows PowerShell). If your instance
is managed by AWS OpsWorks, you should stop the instance in the AWS OpsWorks console
so that the instance state remains in
sync.

(Optional) Create an AMI from the instance, as described in Creating an Amazon EBS-Backed Linux AMI. The AMI inherits the enhanced networking enaSupport
attribute from the instance. Therefore, you can use this AMI to launch another instance
with
enhanced networking enabled by default.

From your local computer, start the instance using the Amazon EC2 console or
one of the following commands: start-instances
(AWS CLI), Start-EC2Instance (AWS Tools for Windows PowerShell). If your instance is managed by
AWS OpsWorks, you should start the instance in the AWS OpsWorks console so that the
instance state remains in sync.

Follow the previous procedure until the step where you stop the instance. Create a
new AMI as described
in Creating an Instance Store-Backed Linux AMI,
making sure to enable the enhanced networking attribute when you register the AMI.

Enabling Enhanced Networking on Linux

The following procedure provides the general steps for enabling enhanced
networking on a Linux distribution other than Amazon Linux AMI or Ubuntu, such as
SUSE Linux Enterprise Server, Red Hat Enterprise Linux, or CentOS. Before you
begin, see Testing Whether Enhanced Networking Is Enabled to check if your instance is
already enabled for enhanced networking. For more information, such as detailed
syntax for commands, file locations, or package and tool support, see the specific
documentation for your Linux distribution.

Update initramfs on your instance to ensure that the
new module loads at boot time. For example, if your distribution supports
dracut, you can use the following command:

dracut -f -v

Determine if your system uses predictable network interface names by
default. Systems that use systemd or
udev versions 197 or greater can rename Ethernet
devices and they do not guarantee that a single network interface will be
named eth0. This behavior can cause problems connecting
to your instance. For more information and to see other configuration
options, see Predictable Network Interface Names on the freedesktop.org
website.

You can check the systemd or
udev versions on RPM-based systems with the
following command:

[EBS-backed instance] From your local computer, stop the instance using the Amazon
EC2 console or one
of the following commands: stop-instances (AWS CLI),
Stop-EC2Instance (AWS Tools for Windows PowerShell). If your instance
is managed by AWS OpsWorks, you should stop the instance in the AWS OpsWorks console
so that the instance state remains in
sync.

(Optional) Create an AMI from the instance, as described in Creating an Amazon EBS-Backed Linux AMI
. The AMI
inherits the enhanced networking enaSupport attribute from
the instance. Therefore, you can use this AMI to launch another instance
with enhanced networking enabled by default.

Important

If your instance operating system contains an
/etc/udev/rules.d/70-persistent-net.rules
file, you must delete it before creating the AMI. This file
contains the MAC address for the Ethernet adapter of the original
instance. If another instance boots with this file, the operating
system will be unable to find the device and eth0
might fail, causing boot issues. This file is regenerated at the next
boot cycle, and any instances launched from the AMI create their
own version of the file.

From your local computer, start the instance using the Amazon EC2 console or
one of the following commands: start-instances
(AWS CLI), Start-EC2Instance (AWS Tools for Windows PowerShell). If your instance is managed by
AWS OpsWorks, you should start the instance in the AWS OpsWorks console so that the
instance state remains in sync.

(Optional) Connect to your instance and verify that the module is installed.

Follow the previous procedure until the step where you stop the instance. Create a
new AMI as described
in Creating an Instance Store-Backed Linux AMI,
making sure to enable the enhanced networking attribute when you register the AMI.