Enabling ENA support on your AWS EC2
Tags: aws, devops, webdev
Published: 2019-10-12 14:33:38

---
title: Enabling ENA support on your AWS EC2
published: true
description: Enabling ENA support on your AWS EC2 with the aws-cli with 5 easy steps
tags: aws, devops, webdev
cover_image: https://res.cloudinary.com/idr/image/upload/v1570889896/dev.to/aws-ena-error_glfjez.jpg
---

AWS provides a wide range of EC2 instance types for different purposes. I wanted to change one of my EC2 instances type from m4 to t3. Generally, EC2 instance type can be changed directly from the AWS console after you stop your instance. When I tried the same, guess what? I ran into this error 
> Enhanced networking with the Elastic Network Adapter (ENA) is required for the 't3.2xlarge' instance type. Ensure that your instance 'i-XXXXXXXXXXXXXXXXX' is enabled for ENA

As I am not an expert in networking, I did not know what is this all about. After reading out some of the [AWS guide pages](https://aws.amazon.com/premiumsupport/knowledge-center/enable-configure-enhanced-networking/), I got to know that Enhanced networking provides higher bandwidth, higher packet-per-second (PPS) performance, and consistently lower inter-instance latencies. And in order to move to the latest available instance types, ENA has to be installed and enabled.

I quickly started looking for ways to enable ENA on my m4 instance so that I can move to t3 instance type. But as always, I got confused reading AWS documentation for the same. Later, was able to convert it and thought of sharing these easy steps for the needy to quickly achieve the result.

**:blue_book: NOTE** 
There are multiple ways of enabling ENA on EC2 instance, I will be using `aws-cli` for the same. Check [configuring aws-cli](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) to set up aws-cli on your local machine

### 1. Make sure you have installed `aws-cli` on `your local machine` and have required permission on your AWS secret to modify the EC2 instances


### 2. Stop the instance
```bash
$ aws ec2 stop-instances --instance-ids <your-instance-id> --region <your-region>  
```

### 3. Check if ENA is already enabled on your EC2
```bash
$ aws ec2 describe-instances --instance-id <your-instance-id> --query "Reservations[].Instances[].EnaSupport" --region <your-region>

# if it is enabled, then you will get the following output
[
    true
]

#if it is not enabled, you will get an empty array
[]
```

### 4. If ENA is not enabled, then run following command to enable it
```bash
# Note: following command won't return any response
$ aws ec2 modify-instance-attribute --instance-id <your-instance-id> --ena-support --region <your-region>

# Verify if above command was a success
$ aws ec2 describe-instances --instance-id <your-instance-id> --query "Reservations[].Instances[].EnaSupport" --region <your-region>  
[
    true
]
```

### 5. Voila! Now change your instance type if not already changed from aws console, and start the instance
```bash
$ aws ec2 start-instances --instance-ids <your-instance-id> --region <your-region>
```


Congratulations! :clap: You have successfully enabled ENA support on your EC2 instance with these easy steps. Leave a comment if you face any issues.

See ya! until my next post :yum: