icon picker
IP Addresses

Amazon EC2 instances can be assigned three types of IP addresses, each with distinct characteristics and uses. These types include Public IP addresses, Private IP addresses, and Elastic IP addresses. Below is a detailed explanation of each type and their specific attributes.

Public IP Address

Description:
Public IP addresses are automatically assigned to instances in public subnets.
They are accessible from the internet.
Public IP addresses are retained when an instance is restarted but lost when the instance is stopped.
Characteristics:
Automatically assigned in public subnets.
Reassigned if the instance is stopped/started.
No charge for usage.
Associated with a private IP address on the instance.
Cannot be moved between instances.

Private IP Address

Description:
Private IP addresses are automatically assigned to all instances, whether they are in public or private subnets.
They are used for internal communication within a VPC.
Characteristics:
Retained when the instance is stopped.
Used in both public and private subnets.
No charge for usage.
Remains attached to the network interface if detached or reassigned to another instance.

Elastic IP Address

Description:
Elastic IP addresses are static public IP addresses that can be remapped between instances.
Designed for dynamic cloud computing.
Characteristics:
Retained when the instance is stopped.
Limited to 5 per region by default (can request a limit increase).
Charges apply when not in use.
Associated with a single private IP address on the instance.
Can be moved between instances and Elastic Network Adapters.
Can be assigned custom tags for categorisation.
Requires configuration of DNS records via a form submission.

Additional IP Address Features

Secondary IP Addresses

Description:
Instances can have multiple private IP addresses.
Useful for applications like hosting multiple websites on a single server or redirecting traffic for high availability (HA).
Characteristics:
Secondary IP addresses can be reassigned.
Elastic IP association is maintained when reassigned.
When a secondary private address is unassigned, its associated Elastic IP address is also disassociated.

Bring Your Own IP (BYOIP)

Description:
Allows you to bring your own publicly routable IPv4 or IPv6 address range from your on-premises network to AWS.
AWS advertises these addresses on the internet.
Characteristics:
The address range appears in your AWS account as an address pool.
Not available in all regions or for all resources.
You continue to own the address range.

Managing IP Addresses

Modifying IP Addresses:
You can assign or remove IP addresses from EC2 instances while they are running or stopped.
All IP addresses (IPv4 and IPv6) remain attached to the network interface when detached or reassigned.
Instance Reassignment:
When you stop and start an EC2 instance, it may be moved to different underlying hardware.
You can stop and start an instance to move it to a different physical host if EC2 status checks fail or if there is planned maintenance.
Attributes Modifiable When Stopped:
Instance type.
User data.
Kernel.
RAM disk.


Summary Table
Name
Description
1
Public IP Address
Lost when the instance is stopped. Used in public subnets. No charge. Associated with a private IP address. Cannot be moved between instances.
2
Private IP Address
Retained when the instance is stopped. Used in both public and private subnets.
3
Elastic IP Address
Static public IP address. Charges apply if not used. Associated with a private IP address. Can be moved between instances and network adapters.
There are no rows in this table
image.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.