Suraj Shrestha
Suraj Shrestha

Reputation: 839

get random ephemeral external IP address in my google cloud compute instances

Every time I destroy my compute instance and create new one, the same ephemeral external IP address is assigned. I haven't used static ip. But always same set of ip addresses is being assigned. How do I get completely random external ip on my instances?

P.S. I use default network interface which is already there in the cloud console.

Upvotes: 2

Views: 1370

Answers (1)

Rahi
Rahi

Reputation: 775

If an instance is stopped, any ephemeral external IP addresses assigned to the instance are released back into the general Compute Engine pool and become available for use by other projects. When a stopped instance is started again, a new ephemeral external IP address is assigned to the instance. There is no guarantee that you will get a specific IP every time or will get completely different IP address always. You may get the same IP or even could get a completely new IP from the pool. You can find detail at this link.

If your use case is to assign multiple external IP addresses to a single instance, you can set up multiple forwarding rules to point to a single target instance using protocol forwarding.

Upvotes: 1

Related Questions