Assigning a New Secondary Private IP to a VNIC
Assign a new secondary private IP address to a VNIC.
You can add a secondary private IP to an instance after it's created. 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.
For more information see Private IP Addresses.
Use the network vnic assign-private-ip command and required parameters to assign a secondary private IP to a VNIC:
oci network vnic assign-private-ip --ip-address IP_address --unassign-if-already-assigned VNIC_OCID --vnic-id destination_VNIC_OCID ... [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreatePrivateIp operation to assign a new secondary private IP to a VNIC.
Next Steps
After assigning a secondary private IP to a VNIC, you must configure the OS to use it.
- For instances running a variant of Linux, see Configuring Linux to Use a Secondary Private IP Address.
- For Windows instances, see Configuring Windows to Use a Secondary IP Addresses.