How to change an internal IP address
Written by
Updated at December 17, 2025
Case description
You need to change the internal IP address of the VM instance.
Solution
You can change the internal IP address of a VM using the CLI, Terraform, and API.
CLI
Terraform
API
- Installing and setting up the CLI
yc compute instance update-network-interfacecommand
Command example:
yc compute instance update-network-interface <VM ID> --network-interface-index=0 --ipv4-address=<new IP address from subnet range>
The --network-interface-index flag sets the index of the network interface to update, with numbering starting from zero.
Alert
You can only change the IP address on a stopped machine.