Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Service page
Yandex Compute Cloud
Documentation
Yandex Compute Cloud
    • All guides
      • Stopping and starting a VM
      • Resetting a Windows Server VM user password
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Moving a VM to a different folder
      • Moving a VM to a different cloud
      • Adding another network interface to a VM
      • Deleting a network interface from a VM
      • Assigning a public IP address to a VM
      • Unassigning a public IP address from a VM
      • Making a VM public IP address static
      • Reassigning a public IP address from one VM to another
      • Updating the VM internal IP address
      • Updating a VM
      • Changing VM computing resources
      • Changing VM security groups
      • VM maintenance policy management
      • Configuring VM access permissions
      • Linking a service account to a VM
      • Deleting a VM
    • Viewing service resource operations
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Managing a VM
  3. Updating the VM internal IP address

Updating the VM internal IP address

Written by
Yandex Cloud
Updated at July 29, 2025

After you create a VM, you can update internal IP addresses of its network interfaces.

CLI
Terraform
API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for updating the internal IP address of a VM network interface:

    yc compute instance update-network-interface --help
    
  2. Get a list of VMs in the default folder:

    yc compute instance list
    

    Result:

    +----------------------+-----------------+---------------+---------+----------------------+
    |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
    +----------------------+-----------------+---------------+---------+----------------------+
    | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
    | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
    +----------------------+-----------------+---------------+---------+----------------------+
    
  3. Select ID of the VM in question.

  4. Stop the selected VM.

  5. Get a list of network interfaces for the VM by specifying its ID:

    yc compute instance get <VM_ID>
    

    Result:

    ...
    network_interfaces:
      - index: "0"
        mac_address: d0:0d:24:**:**:**
        subnet_id: e2lpp96bvvgp********
        primary_v4_address:
          address: 192.168.2.23
          one_to_one_nat:
            address: 158.160.**.***
            ip_version: IPV4
      - index: "1"
        mac_address: d0:1d:24:**:**:**
        subnet_id: e2lrucutusnd********
        primary_v4_address:
          address: 192.168.1.32
      - index: "2"
        mac_address: d0:2d:24:**:**:**
        subnet_id: e2lv9c6aek1d********
        primary_v4_address:
          address: 192.168.4.26
    ...
    

    Save the index field value, which is the number of the network interface you want to update the internal IP address for.

  6. Update the internal IP address of the selected VM network interface:

    yc compute instance update-network-interface \
      --id <VM_ID> \
      --ipv4-address <internal_IP_address> \
      --network-interface-index <network_interface_number>
    

    Where:

    • --id: VM ID.
    • --ipv4-address: Internal IP address. Specify a new IP address or enter auto to assign it automatically.
    • --network-interface-index: VM network interface number you saved earlier.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. To update the internal IP address of a VM network interface, add the ip_address parameter to the network_interface section of the network interface you need in the yandex_compute_instance resource configuration:

    resource "yandex_compute_instance" "vm-1" {
      ...
      network_interface {
        ...
        ip_address = "<internal_IP_address>"
      }
    }
    

    For more information about the yandex_compute_instance resource parameters, see the relevant provider documentation.

  2. Create the resources:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    Terraform will create all the required resources. You can check the new resources using the management console.

To update the internal IP address of a VM network interface, use the updateNetworkInterface REST API method for the Instance resource or the InstanceService/PrimaryAddress gRPC API call.

Was the article helpful?

Previous
Reassigning a public IP address from one VM to another
Next
Updating a VM
© 2025 Direct Cursus Technology L.L.C.