Configuring the Instance OS for a Secondary IP Address

On Compute Cloud@Customer, after you create a secondary private IP address on a VNIC, log into the instance to configure the instance OS to use the new IP address

Linux Instance OS Configuration

Configuring the Instance OS Manually

This configuration permits use of an IP address subnet, netmask, gateway, and DNS service that are entirely independent from the existing NIC. This configuration is persistent across reboots.

Create a new network interface configuration file to create a subinterface on the existing NIC. In this example, ens03 is the name of the existing NIC and ifcfg-ens3:0 is the name of the new configuration file.

  1. Create the network configuration file ifcfg-ens3:0 in the /etc/sysconfig/network-scripts/ directory to create the first sub-interface (:0) on the existing ens3 NIC.

    Include the following entries in ifcfg-ens3:0:

    TYPE=Ethernet
    BOOTPROTO=none
    IPADDR=a.b.c.d
    PREFIX=24
    GATEWAY=
    DNS=
    NAME=ens3:0
    DEVICE=ens3:0
  2. Include the appropriate IPADDR, PREFIX, GATEWAY, and DNS entries for this new sub-interface.

  3. Run the following command to start the new interface:

    # ifup ens3:0
  4. Run the following command to confirm that the new interface is operational:

    # ifconfig -a

See also Linux: Details about Secondary IP Addresses.

Using the Oracle Script

The Oracle script can only configure a secondary IP address on a secondary VNIC. To configure a secondary IP address on the primary VNIC, use the /etc/sysconfig/network-scripts/ method described in the preceding procedure. You can download the Oracle script from https://docs.oracle.com/iaas/Content/Resources/Assets/secondary_vnic_all_configure.sh .

To use this script to configure a secondary private IP address on a secondary VNIC, use the -e option as shown in the following example. The instance metadata does not include information about secondary IP addresses. You must provide the IP address and VNIC OCID on the command line.

$ secondary_vnic_all_configure.sh -e IP_address VNIC_OCID

The configuration performed by the script is not persistent across reboots. Run the script every time you add a new secondary private IP address or reboot the instance. If you have several secondary IP addresses, consider creating a configuration file as described in the manual previous procedure.

Oracle Solaris Instance OS Configuration

Use the ipadm command to configure network interfaces persistently.

Microsoft Windows Instance OS Configuration

See Windows: Details about Secondary IP Addresses for information about how to either:

  • Create a PowerShell script.

  • Use the Network and Sharing Center user interface.