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
Section titled “Prerequisites”- Access to an evroc organization and project
- evroc CLI installed and configured
Create a Public IP
Section titled “Create a Public IP”Create a Public IP resource that you can attach to a virtual machine:
evroc networking publicip create mypublicipSee Create a Public IP in the API reference.
Attach a Public IP to a VM
Section titled “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=mypublicipAttach 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=mypublicipChange the Public IP on a VM
Section titled “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.
-
Detach the current Public IP:
Terminal window evroc compute virtualmachine update myvm --public-ip="" -
Attach the new Public IP:
Terminal window evroc compute virtualmachine update myvm --public-ip=mynewpublicip
Detach a Public IP from a VM
Section titled “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
Section titled “List Public IPs”List all Public IPs in your project:
evroc networking publicip listUse 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
Section titled “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 mypublicipSee Delete a Public IP in the API reference.
Next steps
Section titled “Next steps”- Learn how to configure security groups to control traffic to VMs with Public IPs
- See how to create a virtual machine with a Public IP