Moving a Secondary Private IP Address to a Different VNIC

Move a secondary private IP address to another VNIC in the same subnet.

    1. Open the navigation menu  and select Compute. Under Compute, select Instances.
    2. Select the name of the instance to open its details page.
    3. Under Resources, select Attached VNICs.
    4. Select the VNIC that you're interested in.
    5. Under Resources, select IPv4 Addresses.
      The VNIC's associated IP addresses are listed in tabular form.
    6. Select Assign Secondary Private IP Address and enter assignment information:
      • IPv4 Address: Select an IPv4 CIDR block to automatically assign the IPv4 address. The available choices depend on what you select in IPv4 Address Assignment.
      • Manually assign IPv4 addresses: Select this option to enter a specific IPv4 address from a CIDR block assigned to this subnet.
      • Private IP Address:Enter the secondary private IP address to move.
      • CIDR Prefix Length (Optional): Enter a netmask value if you want to assign an IP CIDR address. If left blank, the system uses 32 to assign a single private IP address. You can't reassign a private IP address if it’s part of an IP CIDR address, but you can reassign an IP CIDR address itself.
      • Unassign if already assigned to another VNIC: Select this checkbox to move the secondary IP address from the current VNIC.
      • Hostname: (Optional) Enter the hostname to use for DNS in the cloud network. This field is available only if the VCN and subnet both have DNS labels. For more information, see DNS in a Virtual Cloud Network. This field isn't available if the CIDR prefix length is used in the range of 18-31.
      • Public IP Type: (Optional) This field is available only if the VNIC is in a public subnet. For more information, see Public IP Addresses. This field isn't available if the CIDR prefix length is used in the range of 18-31.
      • Route Table (Optional): Assign a custom route table to handle traffic from this IP address. For more information, see Per-resource Routing. If you assign a custom route table, traffic from this IP address doesn't use the default VCN or subnet route tables.

        If you select + Another IPv4 address, you can assign more IPv4 objects to the instance VNIC, but the objects must come from the same subnet.

    7. Select Assign.
  • Use the network vnic assign-private-ip command and required parameters to move a secondary private IP address from one VNIC to another:

    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 the CLI Command Reference.

  • Run the UpdatePrivateIp operation to move a private IP address from one VNIC to another.