Detaching a public IP address from a virtual machine
Written by
Updated at June 14, 2024
If you previously attached a public IP address to a VM's network interface, you can detach it.
Management console
CLI
API
- In the management console
, select the folder the 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 command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To detach 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's_network_interface_number>
Where:
--id
: VM ID. You can get a list of instance IDs in a folder using theyc compute instance list
CLI command.--network-interface-index
: VM's network interface number. The default value is0
. To get a list of VM's network interfaces and their numbers, run theyc compute instance get <VM_ID>
command.
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.