Updated on 2025-01-27 GMT+08:00

Adding a NIC

Scenarios

If your ECS requires multiple network interfaces, you can add them to your ECS.

Procedure

  1. Log in to the management console.
  2. Under Computing, click Elastic Cloud Server.
  3. Click the name of the ECS to which you want to add a NIC.

    The page providing details about the ECS is displayed.

  4. On the NICs tab, click Add NIC.
  5. Set the subnet and security group for the NIC to be added.
    Figure 1 Configuring the subnet and security group
    • Security Group: You can select multiple security groups. In such a case, the access rules of all the selected security groups will apply to the ECS.
    • Subnet: specifies the subnet which the network interface to be added belongs to.
    • New Private IP Address: If you want to add a network interface with a specified IP address, enter an IP address into the New Private IP Address field. I
  6. Click OK.

Follow-up Procedure

Some OSs cannot identify newly added NICsnetwork interfaces. In this case, you need to manually activate the NICsnetwork interfaces. The following uses Ubuntu as an example to show how to activate NICsnetwork interfaces. Operations may vary depending on the operating system. You can refer to the corresponding OS documentation for assistance.

  1. Locate the row containing the target ECS and click Remote Login in the Operation column.

    Log in to the ECS.

  2. Run the following command to view the NICnetwork interface name:

    ifconfig -a

    In this example, the NICnetwork interface name is eth2.

  3. Run the following command to switch to the target directory:

    cd /etc/network

  4. Run the following command to open the interfaces file:

    vi interfaces

  5. Add the following information to the interfaces file:

    auto eth2

    iface eth2 inet dhcp

  6. Run the following command to save and exit the interfaces file:

    :wq

  7. Run either the ifup ethX command or the /etc/init.d/networking restart command to make the newly added NICnetwork interface take effect.

    X in the preceding command indicates the serial number of the NICnetwork interface, for example, ifup eth2.

  8. Run the following command to check whether the NICnetwork interface name obtained in step 2 is displayed in the command output:

    ifconfig

    For example, check whether eth2 is displayed in the command output.

    • If yes, the newly added NICnetwork interface has been activated. No further action is required.
    • If no, the newly added NICnetwork interface failed to be activated. Go to step 9.
  9. Log in to the management console. Locate the row containing the target ECS, click More in the Operation column, and select Restart.
  10. Run ifconfig again to check whether the NICnetwork interface name obtained in step 2 is displayed in the command output:
    • If yes, no further action is required.
    • If no, contact customer service.