Unassigning a public IP address from a VM
If you have previously assigned a public IP address to a VM network interface, you can unassign it.
Note
When unassigning an IP address that was assigned automatically (a dynamic IP address), you will not be able to assign it to a cloud resource again. To save the IP address for future use, make it static.
- In the management console
, select the folder this VM belongs to. - Select Compute Cloud.
- Select the VM.
- In the window that opens, under Network, click
in the top-right corner of the relevant network interface section and select Disassociate public IP address. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
To unassign a public IP address from a VM, run the following CLI command:
yc compute instance remove-one-to-one-nat
--id=<VM_ID>
--network-interface-index=<VM_network_interface_number>
Where:
--id
: VM ID. You can get a list of available VM IDs in the folder using theyc compute instance list
CLI command.--network-interface-index
: VM network interface number. The default value is0
. To get a list of VM network interfaces and their numbers, runyc compute instance get <VM_ID>
.
For more information about the yc compute instance remove-one-to-one-nat
command, see the CLI reference.
Use the removeOneToOneNat REST API method for the Instance resource or the InstanceService/RemoveOneToOneNat gRPC API call.