Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does EC2‘s public ip works?

Tags:

amazon-ec2

When I launch an EC2 instance,I will get a private ip and public ip.The public ip can be visited by a dns domain like 'ec2-184-73-237-10.compute-1.amazonaws.com'.When I ping it,I got ip address 184.73.237.10.

My question is: does 184.73.237.10 only belongs to me or it's shared by different instances? If it's shared by different instances,how does it work? As far as I know, each instances(linux) can be accessed by ssh.

Thanks in advance :-)

like image 982
flyingzl Avatar asked Jun 27 '11 03:06

flyingzl


2 Answers

It only belongs to you (there is a 1:1 mapping between public and private IP addresses), but it can change at any time. For this reason, if you need an instance to be permanently accessible by IP they recommend using an Elastic IP Address. EIP is free as long as it's actually associated with an instance.

like image 133
bmatheny Avatar answered Sep 28 '22 04:09

bmatheny


It is recommended to create and associate an Elastic IP (AWS's static IP) to your instance. And this IP will be only yours.

The benefit of Elastic IP, is that, even you can associate it to other instance, restored server from the AMI image of parent instance, thus bring back your site in case of any issues/attacks.

like image 28
Amith Ajith Avatar answered Sep 28 '22 03:09

Amith Ajith