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.
- Open the navigation menu and click Compute. Under Compute, click Instances.
- Under List scope, select the compartment that contains the instance you want to add a private IP address to.
- Click the name of the instance to open its details page.
- Under Resources, click Attached VNICs.
- Click the VNIC that you're interested in.
- Under Resources, click IPv4 Addresses.
Click Assign Secondary Private IP Address and then enter the private IP address information:
- Private IP Address: (Optional) An available private IP address from the subnet's CIDR (otherwise the private IP address is automatically assigned).
- Unassign if already assigned to another VNIC: Select this check box to force reassignment of the IP address if it's already assigned to another VNIC in the subnet. Only relevant if you specify a private IP address in the preceding field.
- Hostname: (Optional) A hostname to use for DNS within the cloud network. Only available if both the VCN and subnet have DNS labels. See DNS in Your Virtual Cloud Network.
- Public IP Type: (Optional) Only available if the VNIC is in a public subnet. See Public IP Addresses.
- Click Assign.
Use the 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-ip-id destination_VNIC_OCID ... [OPTIONS]
For a complete list of parameters and values for CLI commands, see
Run the CreatePrivateIp operation to assign a new secondary private IP to a VNIC.
- 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.