Help Center> Cloud Container Engine> Best Practices> Networking> Using Multiple ENIs on a Node in a CCE Cluster

Using Multiple ENIs on a Node in a CCE Cluster

Scenario

This section describes how to configure elastic network interfaces (ENIs) if multiple NICs are used on a node in a CCE cluster.

Procedure

If the cluster version is v1.15.11 or v1.17.9, Network is used as the CCE networking management component.

The following uses a CentOS 7 VM as an example to describe how to configure the VM networking.

  1. Log in to the VM OS.
  2. Run the ifconfig command to query the ENIs bound to the VM.

    Assume that the name of the NIC is eth1. Run the following command:

    vim /etc/sysconfig/network-scripts/ifcfg-eth1

    Edit the file as follows:

    DEVICE="eth1"
    BOOTPROTO="dhcp"
    ONBOOT="yes"
    TYPE="Ethernet"
    PERSISTENT_DHCLIENT="yes"

  3. Run the following command to restart the VM network to make the networking configuration take effect:

    systemctl restart network

If the cluster version is v1.17.11 or later, NetworkManager is used as the CCE networking management component. When you configure ENIs on the CCE node, the configurations vary depending on the network model you use.

  • Tunnel network (overlay_l2): ENIs can be automatically configured, for example, their IP addresses can be automatically obtained and renewed.
  • VPC network: In addition to the primary NIC and the ENIs bound to containers, you need to configure extra ENIs.
  • Cloud Native Network 2.0: In addition to the primary NIC and the ENIs bound to containers, you need to configure extra ENIs.

For a cluster that uses the Cloud Native Network 2.0 model (CCE Turbo cluster), the container networking is carried by ENIs and supplementary ENIs. If you want to use this network model, submit a service ticket to change the configuration of reserved ENIs in the cluster.

Procedure

The following uses a CentOS 7 VM as an example to describe how to configure the VM networking.

  1. Log in to the VM OS.
  2. Run the ifconfig command to query the ENIs bound to the VM.

    Assume that the name of the NIC is eth1. Run the following command:

    vim /etc/sysconfig/network-scripts/ifcfg-eth1

    Edit the file as follows:

    DEVICE="eth1"
    BOOTPROTO="dhcp"
    ONBOOT="yes"
    TYPE="Ethernet"
    PERSISTENT_DHCLIENT="yes"

  3. Run the following command to restart the VM network to make the networking configuration take effect.

    systemctl restart NetworkManager

  4. Check whether the dhclient process of the eth1 NIC on the node is started. If yes, the configuration takes effect.