Direkt zum Inhalt

Lightsail IP address randomly changed??

0

I have a few Lightsail servers. One of them a 2 CPU 4GB mem I attempted to ssh this mroning and it just timed out. I made a couple API calls to a service that is running on the box and they responded. A little slow, but the did respond.

So I rebooted the box and still couldn't connect so I STOPPED the box then started it. It came back up and I noticed that in the AWS window, it now has a totally new IP address. Is this normal or is it a fluke? I cant randomly keep changing DNS Ip addresses if that is normal.

Any help would be appreciated.

gefragt vor 6 Monaten124 Aufrufe
1 Antwort
0
Akzeptierte Antwort
What you experienced is actually normal behavior for Amazon Lightsail instances, but there's a solution to prevent this from happening in the future.

By default, Lightsail instances are assigned a dynamic public IPv4 address. This address can change when you stop and start your instance (not just reboot). It's important to note that a reboot (restart) is different from a stop-start operation and doesn't cause the IP address to change.

In your case, when you stopped and then started your instance, it was assigned a new public IP address. This is expected behavior for instances without a static IP address.

To prevent this from happening and to maintain a consistent IP address for your instance, you should create and attach a static IP address to your Lightsail instance. A static IP address remains the same even when you stop and start your instance, which is crucial for maintaining consistent DNS records and ensuring uninterrupted access to your services.

Creating a static IP in Lightsail is straightforward and doesn't incur additional costs as long as it's attached to an instance. You can create one through the Lightsail console and attach it to your instance. Once attached, this IP address will remain constant, solving the issue you encountered.

For your use case, where you need to maintain consistent DNS records, using a static IP is highly recommended. This way, you won't have to update your DNS settings every time you stop and start your instance.
  

Sources
Lightsail and IPv4 address costs | AWS re:Post
View and manage IP addresses for Lightsail resources - Amazon Lightsail
Create and attach a static IP to your Lightsail instance - Amazon Lightsail
Static IP addresses in Lightsail - Amazon Lightsail

beantwortet vor 6 Monaten
EXPERTE
überprüft vor 6 Monaten
  • After you create the static IP address, how do you get the instance to start using it

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.