EN21CS301695 SARTHAK KHANDELWAL
EXPERIMENT:9
Aim: Assigning Elastic IP Address to instance (Static IP Address)
Theory: Once you create a new EC2 Instance your instance will get
a new public IP address. But this IP address is not static so it will
change or a new IP will get assigned to your instance when certain
actions are made on your instance like restarting your instance.
If you have your public IP address configured in your DNS A record,
that particular IP address can change anytime. So, when a new IP
address is assigned to your instance your visitor cannot see your
website because it points to the old IP address which you don’t have
control anymore.
To overcome this issue Elastic IP comes in which is a static IPv4
address designed for dynamic cloud computing. With the Elastic IP
you can rapidly remap the address to any instance in your account.
Prerequisites
● A running EC2 Instance.
To allocate an Elastic IP address and assign it to an instance using
the console
1. Open the Amazon VPC console at
2. Create Elastic IP Address.
3. Choose Allocate new address.
4. Choose Allocate.
Note
If your account supports EC2-Classic, first choose VPC.
5. Select the Elastic IP address from the list, choose Actions, and then
choose Associate address.
EN21CS301695 SARTHAK KHANDELWAL
6. Choose Instance or Network interface, and then select either the
instance or network interface ID. Select the private IP address with
which to associate the Elastic IP address, and
then choose Associate.
Create Elastic IP address
Login to your AWS management console and navigate to Compute
>> EC2 and under Network and security click Elastic Ips
In this screen click Allocate Elastic IP address.
EN21CS301695 SARTHAK KHANDELWAL
Now a new IPv4 address will get allocated.
Associate Elastic IP address
Once an IP is allocated you need to associate it with the EC2 Instance.
To do so check the checkbox of your IP address and click Actions and
choose Associate Elastic IP address.
In the Resource type choose Instance and choose the instance from
the dropdown on the Instance field.
If you have any other Elastic IP address assigned before and you need
to re-associate you can enable the checkbox in Reassociation Click
Associate.
EN21CS301695 SARTHAK KHANDELWAL
Release Elastic IP address
If you wish to no longer use the allocated IP address you can release it
to prevent any unnecessary billings.
To do so check the checkbox of your IP address and click Actions
and choose Release Elastic IP address.