Skip to content

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.

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

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

Terminal window
evroc networking publicip create mypublicip

See Create a Public IP in the API reference.

Attach a Public IP when creating a VM:

Terminal window
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.

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

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:

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

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

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.

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

List all Public IPs in your project:

Terminal window
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 Public IPs you no longer need. A Public IP must not be attached to any virtual machine before you can delete it.

Terminal window
evroc networking publicip delete mypublicip

See Delete a Public IP in the API reference.