What is an IP Address in EC2
- Every EC2 instance needs an IP address to communicate within AWS or with the internet.
- AWS provides two types of IPs:
- Private IP – for internal communication within the same VPC.
- Public IP – for external communication (internet access).
Private IP
Definition
- A private IP is assigned from the subnet’s private range within your VPC.
- Used for communication between resources inside the same VPC (e.g., EC2 to RDS).
- Not accessible from the internet.
Key Points
- Assigned automatically when an instance is launched.
- Remains the same even after stop/start (unless manually changed).
- Each instance has one primary private IP and can have multiple secondary private IPs (for ENI-based setups).
Example
- VPC Subnet:
10.0.1.0/24
- EC2 Instance Private IP:
10.0.1.10
- This instance can communicate with others in the same VPC but not with the internet directly.
Public IP
Definition