Allocate, associate, and release Floating IPs
Allocate a Floating IP, associate it with an instance or a port, move it to another instance, disassociate it, and release it in the console.
Allocate public IPv4 addresses for your project, associate them with instances, and release them when you no longer need them. For how Floating IPs work, see What is Floating IPs?.
Before you begin
- You need the Owner or Contributor role on the subscription or on the project, or a custom role with Manage access to Networking.
- The subscription's quota and the project's allocation need room for one more Floating IP. See Quotas.
- To associate an address with an instance, the instance's subnet must be attached to a router whose external gateway is on the Floating IP's pool. See Internet access: SNAT and Floating IPs.
Allocate a Floating IP
In the console, go to NetworkingFloating IPs.
Select Acquire IP.
Under Allocation, check the Pool. If your project can use several pools, select one. If the field shows No external network available, your project can't allocate Floating IPs in this region.
To associate the address right away, select an instance under Associate to (optional). Keep — Leave unassociated — to allocate the address only.
Select Acquire IP. The console waits until the address is allocated, and associated if you chose an instance, and then returns to the list.
The address is billed from the moment it's allocated. If you asked for an association and only the association fails, the console shows The address was allocated, but the association failed. The address then exists in your project, unassociated, and the form doesn't let you allocate a second one. Associate the address from the list, or release it. If the allocation itself fails, nothing is left behind.
Associate a Floating IP with an instance
In the list, open the actions of an unassociated address, and select Associate. You can also open the address and select Associate on its page.
In Target resource, select the instance.
If the instance has more than one network interface, select the interface's fixed IP address under Network interface.
Select Associate.
When the association is in place, the address is Active, Mapped fixed IP shows the interface's fixed IP address, and the instance shows the address as its public IP. If the instance's subnet isn't connected to the address's pool, the association fails with a message that says so, and the address stays unassociated.
If the project has no instances, the dialog shows No instances available to associate. Create an instance first.
Move a Floating IP to another instance
Disassociate the address from its current instance. See Disassociate a Floating IP.
Associate it with the new instance. See Associate a Floating IP with an instance.
The address stays the same. Between the two steps, it doesn't reach any instance.
Disassociate a Floating IP
In the list, open the actions of an associated address, and select Disassociate.
Confirm with Disassociate.
Every inbound connection to the address drops at once. The address stays allocated to your project and is still billed. You can also disassociate an address with Disassociate on its own page, or on the interface's row on the instance's Networking tab.
Release a Floating IP
Caution
Releasing an address can't be undone. You can't choose an address when you allocate one, so you can't get a released address back on purpose.
In the list, open the actions of the address, and select Release IP. To release several addresses, select their check boxes, and select Release.
Confirm with Release.
A released address returns to the pool, any association is removed, and its billing ends. You can also release an address on its own page with Release.
Allocate a Floating IP for a port
A port that you created on a network can get its own Floating IP, without an instance.
In the console, go to NetworkingNetworks, open the network, and select the Ports / devices tab.
Point to the port's row, and select the globe icon. The icon appears for ports that have no Floating IP and aren't on an external network.
The platform allocates a new address from the region's default pool and associates it with the port. The address then appears in the port's Public IP column and in the list of Floating IPs. If the association fails, the platform releases the new address again, so nothing is left behind.
To take the address off the port, select the unlink icon on the port's row. The address is disassociated and stays allocated to your project.
Troubleshooting
| Situation | Cause | Resolution |
|---|---|---|
| The association fails with a message that the instance's subnet isn't connected to the external network. | The subnet isn't attached to a router, or the router's external gateway is on another external network than the address's pool. | Attach the subnet to a router with an external gateway on the pool. The router's page shows its external network, and the address's page shows its pool. |
| A quota message when you allocate. | The subscription's quota or the project's allocation has no room for another Floating IP. | Release addresses that you don't use. To raise the allocation or request an increase, see Quotas. |
| The address was allocated, but the association failed | The request included an association, and it didn't complete. | Check the list of Floating IPs. If the new address is there, fix the cause and associate it from the list, or release it. |