What is an Elastic IP?
An Elastic IP address is a reserved public address that can assign to EC2 instance in a specific region until we release it.
Elastic IP addresses are used by AWS to manage its dynamic cloud computing services.
When we are going to stop and then again start instance our public IP address is changed. To overcome this problem we assign Elastic IP address because Elastic IP address does not change even we stop and start the instance.
How to Assign an Elastic IP to EC2 Instance
STEP 1: Log in to AWS Management Console
- Login to “AWS management console”
- Search for “EC2” in the services of AWS.
Fig 5.0: Searching EC2 in services
STEP 2: Goto EC2 Dashboard
- Go to the “EC2 dashboard”.
- Here first we are going to launch the EC2 instance.
- Click on “Instances”.
- Click on “Lunch instance”.
Fig 5.1: Launch instance page
STEP 3: Select AMI
- Select “AMI”, “general purpose”.
- Add “storage”, “tags” and “create security groups”.
- Then click on “Review” and “launch instance”.
- Create the keypairs and download and then click on “launch”.
Fig 5.2: Creating keypair and launching an instance
STEP 4: EC2 Launched
- Successfully our instance is launched.
- In Fig 5.3 Elastic IPs not assigned.
Fig 5.3: instance with no Elastic IP
STEP 5: EC2 Dashboard – Network & Security – Elastic IP
- Go to “EC2 Dashboard”.
- In the left corner we can “Network & Security” there we have Elastic IPs.
- Click on “Elastic IPs”.
Fig 5.4: EC2 dashboard
STEP 6: Allocate Elastic IP Address
- Click on “Allocate Elastic IP address”.
Fig 5.5: Showing Elastic IP address page
STEP 7: Amazon Pool IPv4 Addresses
- Select “Amazon pool IPv4 addresses”.
- Then click on “Allocate”.
- An elastic IP address is successfully allocated which was shown in “Fig 5.7″
Fig 5.6: Allocating Elastic IP
Fig 5.7: Showing Elastic IP address successfully allocated
STEP 8: Assign Elastic IP to EC2 Machine
- Click on “Actions”.
- there we can see the option “Associate Elastic IP address”
- Click on “Associate Elastic IP address”.
Fig 5.8 Shows how to allocate IP to EC2 instance.
STEP 9: EC2 Instance selection
- A select instance which is existed.
- Then click on “Allocate”.
- An elastic IP address is assigned successfully which was shown in Fig 5.9
Fig 5.8: Choosing Instance
Fig 5.9: Elastic IP address association
STEP 10: Elastic IP confirmation for (ASSIGN ELASTIC IP TO EC2 MACHINE)
- Go back to our instances.
- Click on the description of that instance.
- Confirm Elastic IP status
Fig 5.10: Elastic IP assigned successfully
Assign Elastic IP to EC2 Machine is a very simple step. Keep in mind if you allocate Elastic IP and not associate it with any EC2 machine then Amazon will charge. Always release the Elastic IP if not associated with any EC2 machine.