Manage public IPs

This guide shows you how to create Public IPs, attach them to virtual machines, and manage them using the evroc CLI.

For information about Public IPs and how they work, see Public IPs.

Prerequisites

  • Access to an evroc organization and project
  • evroc CLI installed and configured

Create a Public IP

Create a Public IP resource that you can attach to a virtual machine:

evroc networking publicip create mypublicip

See Create a Public IP in the API reference.

Attach a Public IP to a VM

Attach a Public IP when creating a VM:

evroc compute virtualmachine create myvm \
  --zone=a \
  --running=true \
  --compute-profile-ref=general.s \
  --disk=mybootdisk \
  --boot-from=true \
  --public-ip=mypublicip

Attach a Public IP to an existing VM. The VM will not know what its public IP is. Note that the VM does not need to be stopped in order to do this.

evroc compute virtualmachine update myvm --public-ip=mypublicip

Change the Public IP on a VM

To replace a VM's Public IP with a different one, you must first detach the current Public IP, and attach the new one. You can't directly update from one Public IP to another.

  1. Detach the current Public IP:

    evroc compute virtualmachine update myvm --public-ip=""
    
  2. Attach the new Public IP:

    evroc compute virtualmachine update myvm --public-ip=mynewpublicip
    

Detach a Public IP from a VM

Remove a Public IP from a VM to disable inbound internet connectivity. Note that the VM does not need to be stopped in order to do this.

evroc compute virtualmachine update myvm --public-ip=""

List Public IPs

List all Public IPs in your project:

evroc networking publicip list

Use evroc networking publicip get <name> for detailed information about a specific Public IP, including which VM it's attached to.

See List Public IPs in the API reference.

Delete a Public IP

Delete Public IPs you no longer need. A Public IP must not be attached to any virtual machine before you can delete it.

evroc networking publicip delete mypublicip

See Delete a Public IP in the API reference.

Next steps