Private IP vs Public IP vs Elastic IP – What is the Difference ?

PRIVATE IP

Every EC2 instance that is launched is assigned a primary private IP address from the address range of the subnet. The instances are not reachable over the internet with their private IP address. However, Private IP addresses are useful for communication between instances within the VPC. They remain associated to the instance during restarts. Private IP address allocated to an instance is released only when the instance is terminated.

PUBLIC IP

You can choose to assign a Public IP to an EC2 Instance to allow it to be accessible from the Internet. Public IP addresses are not associated with an AWS account. They are assigned from Amazon’s pool of IP addresses. Public IP addresses are released during Instance termination as well as Instance stops. So every-time you stop the instance and start it again, the public IP address of the Instance changes.


To maintain IP address through instance stop/start cycles, you should use Elastic IP addresses. When an Elastic IP address is associated with an EC2 Instance, the public IP address of that instance is released. And when an Elastic IP address is disassociated from an EC2 Instance, a new public IP address is assigned to the instance.

ELASTIC IP

An Elastic IP address is a static public IP address that you can request to be allocated to your AWS account. They are region specific and the default limit of Elastic IP addresses allocated to an AWS account is 5. However, you can submit a request to increase the limit. You can associate Elastic IP address with any EC2 Instance within the same region. You can also disassociate the Elastic IP address from an EC2 Instance and associate it with another instance.

See also  S3 Concepts - Buckets


AWS does not charge for an Elastic IP as long as it is associated with a running EC2 Instance. AWS charges for the Elastic IP addresses that are not associated to any EC2 Instance or are associated with a stopped EC2 Instance