Private IP addresses
Each VM is created with a network interface that has a private IPv4 address. VMs can communicate with each other without internet access by using their private addresses. Private address ranges are randomly allocated from subnets with the10.0.0.0/8 and 192.168.0.0/16 IPv4 CIDR blocks.
How to get a VM’s private IP address
- Web console
- CLI
- In the sidebar, go to
Compute → Virtual machines.
- Open the page of the required VM.
- Copy the Private IPv4 value from the Network block.
How to assign a secondary private IP address to a VM
You can use secondary private IP addresses as a backup option in case of incidents. For example, a backup node can take a secondary address of the main node when the main one fails. As a result, routing to this address can be preserved.- Web console
- CLI
To assign a secondary private address to a VM:
- In the sidebar, go to
Compute → Virtual machines.
- Open the page of the required VM.
- Click Attach resource → Secondary private IP.
- In the window that opens, select whether you want to reuse an existing IP address as a secondary one or create a new address.
- For an existing IP address, select an allocation and then click Assign address.
- For a new address, specify the allocation name and address. After that, click Create and assign address.
Public IP addresses
When creating a VM, you can enable public IPv4 addressing for it. A VM’s public address is mapped to its private address by using one-to-one NAT. All IP addresses assigned to a VM are allocations. When you create a VM and automatically assign a static or dynamic public address, Compute creates an allocation for it and assigns this address to this VM. After that, Compute manages the lifecycle of this allocation. In particular, Compute deletes the allocation when the VM is deleted. If you assign an already existing allocation when you create a VM, Virtual Networks manages the lifecycle of this allocation. In this case, the allocation is preserved even if you delete the VM. If you need to secure your VM and make it isolated, you can create a VM without a public IP address. If you need to connect to this VM from the internet, you can set up a WireGuard jump server. It has an IP address in the internet and an IP address in the VM’s network. As a result, you can access the VM via the jump server from the internet. This approach enhances security and still provides access to the VM.How to enable a public IP address for a VM
To enable a public address, either create a VM with it or assign a public address to an existing VM. A VM must be in the same region as the VM’s subnet. An allocation assigned to a VM must belong to the VM’s subnet. For more information, see Virtual Networks documentation.How to create a VM with a public IP address
- Web console
- CLI
On the VM creation page (
Compute → Virtual machines → Create virtual machine → Network → Public IP address), select one of the following options:
-
Auto assign dynamic IP (default): A dynamic public IP address is randomly allocated from the IPv4 public range of Nebius AI Cloud.
Dynamic public IP addresses are not persistent. If a VM with a dynamic address has the
Stoppedstatus for more than one hour, the address automatically returns to the IPv4 public range of Nebius AI Cloud. After that, Compute may allocate this address to a different VM. If you want to preserve the address, assign a static address or an allocation to the VM. - Auto assign static IP: A static public IP address is randomly allocated from the IPv4 public range of Nebius AI Cloud. If you stop a VM that has a static IP address, the address will not return to the range. However, if you delete this VM, the address will return.
- Select from already allocated: A preliminarily created allocation is assigned to a VM. If you use an allocation, its address will not return to the IPv4 range even if you delete the VM.
If an allocation with a public address has not been assigned to any resource for 30 days, Nebius AI Cloud can delete this allocation and release its address. If you want to preserve the address, assign its allocation to a Nebius AI Cloud resource.
How to enable a public IP address for an existing VM
You can only assign one public IP address to a VM. If the VM already has a public address, you cannot assign one more.- Web console
- CLI
- In the web console, go to
Compute → Virtual machines.
- Open the page of the required VM.
- Click Attach resource → Public IP address.
- In the window that opens, select whether you want to assign an existing IP address or create a new one.
- For an existing IP address, select the required one and then click Assign address.
- For a new address, specify the address type: dynamic or static. After that, click Create and assign address.
How to get the IPv4 public range of Nebius AI Cloud
The IPv4 public range depends on the region where you create a VM. To get the range:- CLI
- Get the ID of the default network in a given project. A project is associated with a region.
-
To get the ID of the default network pool, run the following command:
The pool ID is specified in the
spec.ipv4_public_pools.pools.idparameter of the output. -
Get CIDR blocks of a given pool:
The
status.cidrsparameter of the output shows the CIDR blocks. As they contain subnet mask/32, the CIDR blocks show available IP addresses. They form the IPv4 public range of Nebius AI Cloud. Compute allocates these addresses to VMs. If the default network contains several pools, a public address can be allocated from any of these pools.
How to get a VM’s public IP address
- Web console
- CLI
- In the sidebar, go to
Compute → Virtual machines.
- Open the page of the required VM.
- Copy the Public IPv4 value from the Network block.
How to migrate a public static IP address from one VM to another
To reassign a public static IP address from one VM to another, detach this address from the source VM and attach it to the target VM. Before you begin, make sure that you have a VM with a public static IP address (the source VM) and a VM without a public address (the target VM). For information about creating VMs, see How to create a virtual machine in Nebius AI Cloud. To migrate the address, do the following:- CLI
-
To get IDs of the source and target VMs, list all VMs:
-
Store the VMs’ IDs in environment variables:
-
Extract the allocation ID of the public static IP address currently attached to the source VM. This value is required to reassign the IP address to another VM.
-
Pin the allocation in the source VM specification. This prevents the allocation from being deleted when you detach it in the next step.
-
Remove the public IP address from the source VM. This makes the allocation available for reuse.
-
Assign the same allocation ID to the target VM:
The output of this command shows that the allocation is attached to the target VM.
How to detach an IP address from a VM
To detach a public address or a secondary private address from a VM:- Web console
- In the web console, go to
Compute → Virtual machines.
- Open the page of the required VM and then go to the Network interface tab.
- In the line of the allocation that you want to detach from a VM, click
→ Detach.
- In the window that opens, confirm the action.