Public IP
Overview
A public IP is a static IP that lets the internet reach a VM or a load balancer. Use it for SSH access, exposing a web server, and so on.
You're billed as long as the IP is allocated, even when it isn't attached to a VM. Delete public IPs you aren't using.
Creating a public IP
-
Under Network > Public IPs, click Create Public IP.
-
Configure the following:
Field Description Public IP name An identifying name Zone The zone the public IP will be allocated in (pick the same zone as the VM) DDoS protection Allocate from the DDoS-protected IP pool; higher rate when enabled Disaster recovery Provision a secondary IP in another zone for automatic NAT failover during a zone outage -
Click Create.
DDoS protection and DR determine which pool the IP is taken from. If a zone has no pool that supports the option, you can see an availability error like noAvailableDrIp.
Attaching to a VM
A public IP attaches to a network interface (NI) rather than the VM itself. You can create the NI together with the VM at the network step, or pick an existing NI, and attach the public IP to that NI.
Option 1: At VM creation time
In the network step of the VM creation wizard, pick the public IP you've created in the public IP field.
Option 2: Attach after creation
- Pick the target IP in Network > Public IPs.
- Click Edit and pick the VM's NI in Attached network interface.
- Click Save.
DR public IPs can only attach to DR VMs / NIs, and standard public IPs can only attach to standard VMs / NIs (networkInterfaceDrMismatch).
Attaching to a load balancer
A public IP can also be attached to a load balancer. It can be attached only when the load balancer is created, and cannot be swapped or detached afterwards.
- IPs already attached to another resource (a network interface or another load balancer) cannot be selected.
- While attached to a load balancer, the public IP cannot be deleted or attached to a VM's network interface.
- Deleting the load balancer automatically detaches the public IP, after which it can be attached to another resource or deleted.
Releasing a public IP
On the public IP detail page, choose Edit > Detach network interface > Save to break the link to the VM.
To delete the IP itself, detach from the VM first, then click Delete.
Next steps
- Firewall: configuring inbound traffic rules
- Load balancer: distributing traffic arriving at a public IP across servers