Do EC2 instances change the IP address for your instance each time you stop/start the instance? Is there a way to keep the IP address constant?
Yes, there is a way: Elastic IP Addressing.
AWS instances are launched with a dynamic IP address by default, which means that the IP address changes every time the server is stopped and restarted. In many cases, this is not desired and so, users also have the option to assign the server a static IP address (also known as an “elastic IP”).3
According to Amazon 1, 2:
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address is associated with your AWS account. With an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account.
And:
You can have one Elastic IP (EIP) address associated with a running instance at no charge. If you associate additional EIPs with that instance, you will be charged for each additional EIP associated with that instance per hour on a pro rata basis. Additional EIPs are only available in Amazon VPC.
To configure a static IP address:
For more details on setting it up, see Allocating an Elastic IP Address and Configure a static IP address.
There is a charge a small hourly charge if an Elastic IP address is not associated with a running instance, or if it is associated with a stopped instance or an unattached network interface. The charge is prorated and depends on the region; details can be found on Amazon EC2 Pricing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With