Private IP Addresses

This topic describes how to manage the IPv4 addresses assigned to an instance in a virtual cloud network (VCN).

IPv6 addressing is currently supported only in the US Government Cloud. For more information, see IPv6 Addresses.


Avoid entering confidential information when assigning descriptions, tags, or friendly names to your cloud resources through the Oracle Cloud Infrastructure Console, API, or CLI.

Overview of IP Addresses

Instances use IP addresses for communication. Each instance has at least one private IP address and optionally one or more public IP addresses. A private IP address enables the instance to communicate with other instances inside the VCN, or with hosts in your on-premises network (via an IPSec VPN or Oracle Cloud Infrastructure FastConnect). A public IP address enables the instance to communicate with hosts on the internet. For more information, see these related topics:

About the Private IP Object

The Networking service defines an object called a private IP, which consists of:

Each private IP object has an Oracle-assigned OCID (see Resource Identifiers). If you're using the API, you can also assign each private IP object a friendly name.

Each instance receives a primary private IP object during launch. The Networking service uses the Dynamic Host Configuration Protocol (DHCP) to pass the object's private IP address to the instance. This address does not change during the instance's lifetime and cannot be removed from the instance. The private IP object is terminated when the instance is terminated.

If an instance has any secondary VNICs attached, each of those VNICs also has a primary private IP.

A private IP can have a public IP assigned to it at your discretion.

A private IP can be the target of a route rule in your VCN. For more information, see Using a Private IP as a Route Target.

About Secondary Private IP Addresses

You can add a secondary private IP to an instance after it's launched. You can add it to either the primary VNIC or a secondary VNIC on the instance. The secondary private IP address must come from the CIDR of the VNIC's subnet. You can move a secondary private IP from a VNIC on one instance to a VNIC on another instance if both VNICs belong to the same subnet.

Here are a few reasons why you might use secondary private IPs:

  • Instance failover: You assign a secondary private IP to an instance. Then if the instance has problems, you can easily reassign that secondary private IP to a standby instance in the same subnet. If the secondary private IP has a public IP assigned to it, that public IP moves along with the private IP.
  • Running multiple services or endpoints on a single instance: For example, you could have multiple container pods running on a single instance, and each uses an IP address from the VCN's CIDR. The containers have direct connectivity to other instances and services in the VCN. Another example: you could run multiple SSL websites with each one using its own IP address.

Here are more details about secondary private IP addresses:

  • They're supported for all shapes and OS types, for both bare metal and VM instances.
  • A VNIC can have a maximum of 31 secondary private IPs.
  • They can be assigned only after the instance is launched (or the secondary VNIC is created/attached).
  • A secondary private IP that is assigned to a VNIC in a regional subnet has a null availability domain attribute. Compare this with the VNIC's primary private IP, which always has its availability domain attribute set to the instance's availability domain, regardless of whether the instance's subnet is regional or AD-specific.
  • Deleting a secondary private IP from a VNIC returns the address to the pool of available addresses in the subnet.
  • They are automatically deleted when you terminate the instance (or detach/delete the secondary VNIC).
  • The instance's bandwidth is fixed regardless of the number of private IP addresses attached. You can't specify a bandwidth limit for a particular IP address on an instance.
  • A secondary private IP can have a reserved public IP assigned to it at your discretion.

Required IAM Policy

To use Oracle Cloud Infrastructure, you must be given the required type of access in a policy  written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment  you should work in.

For administrators: see IAM Policies for Networking.

Using the Console

To view an instance's private IPs
To assign a new secondary private IP to a VNIC
To move a secondary private IP to another VNIC in the same subnet
To update the hostname for an existing private IP
To delete a secondary private IP from a VNIC
To manage tags for a private IP

Using the API

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.

To manage private IPs on a VNIC, use these operations:

  • GetPrivateIp: Use this to get a single privateIp object by specifying its OCID.
  • ListPrivateIps: Use this to get a single privateIp object by specifying the private IP address (for example, and the subnet's OCID. Or you can list all the privateIp objects in a given subnet, or just the ones assigned to a given VNIC.
  • CreatePrivateIp: Use this to assign a new secondary private IP to a VNIC.
  • UpdatePrivateIp: Use this to reassign a secondary private IP to a different VNIC in the same subnet, or to update the hostname or display name of a secondary private IP.
  • DeletePrivateIp: Use this to delete a secondary private IP from a VNIC. The private IP address is returned to the subnet's pool of available addresses.

Linux: Details about Secondary IP Addresses

After assigning a secondary private IP to a VNIC, you must configure the OS to use it.

Basic Commands (Not Persistent Through a Reboot)

On the instance, run the following command. It works on all variants of Linux, for both bare metal and VM instances:

ip addr add <address>/<subnet_prefix_len> dev <phys_dev> label <phys_dev>:<addr_seq_num>


  • <address>: The secondary private IP address.
  • <subnet_prefix_len>: The subnet's prefix length. For example, if the subnet is, the subnet prefix length is 24.
  • <phys_dev>: The interface to add the address to (for example, ens2f0).
  • <addr_seq_num>: The sequential number in the stack of addresses on the device (for example, 0).

For example:

ip addr add dev ens2f0 label ens2f0:0

Later if you want to delete the address, you can use:

ip addr del dev ens2f0:0 

Also make sure to delete the secondary IP from the VNIC. You can do that before or after executing the above command to delete the address from the OS configuration.


If you've assigned a secondary IP to a secondary VNIC, and you're using policy-based routing for the secondary VNIC, make sure to configure the route rules to look up the same route table for the secondary IP address.

Configuration File (Persistent Through a Reboot)

You can make the configuration persistent through a reboot by adding the information to a configuration file.

For Oracle Linux and CentOS
For Ubuntu

Windows: Details about Secondary IP Addresses

After assigning a secondary private IP to a VNIC, you must configure the OS to use it. Here are instructions for using a PowerShell script or the Network and Sharing Center UI.

Using a PowerShell Script
Using the Network and Sharing Center UI