Binding multiple NICs in Linux with the NMCLI command

Source: Internet
Author: User

Today, let's learn how to bind a network adapter in CentOS 7.x using NMCLI (Network Manager command line Interface: Web Management Commands Interface).

A network card (interface) binding is a way to logically connect multiple NICs together to allow failover or increase throughput. One way to improve server network availability is to use multiple network cards. The Linux binding driver provides a way to aggregate multiple network adapters into a single logical binding interface. This is a new way to implement bindings and does not affect the old binding drivers in the Linux kernel.

The NIC bindings provide us with two main benefits:

High bandwidth

Redundancy/elasticity

Now let's configure the NIC bindings on CentOS 7. We need to decide which interfaces to choose to configure as a group interface (team interface).

Run the IP link command to see which interfaces are available on the system.

$ IP Link

Here we create a group interface in active backup mode using the eno16777736 and eno33554960 NICs.

Follow the syntax below to create a connection for the network group interface with the NMCLI command.

# nmcli con Add type team con-name CNAME ifname iname [config JSON]

The CNAME refers to the name of the connection, Iname is the interface name, and the JSON (JavaScript Object Notation) specifies the processor (runner) used. The JSON syntax is formatted as follows:

' {' runner ': {' name ': ' METHOD '} '

METHOD is one of the following: broadcast, Activebackup, Roundrobin, LoadBalance, or LACP.

1. Create a group interface

Now let's create the group interface. This is the command we used to create the group interface.

# nmcli con Add type team con-name TEAM0 ifname team0 config ' {"runner": {"name": "Activebackup"}} '

Run the # nmcli con show command to verify the group interface configuration.

# NMCLI Con Show

2. Add from Device

Now let's add the TEAM0 from the device to the main device. This is the syntax to add from the device:

# nmcli con Add type team-slave con-name CNAME ifname iname Master Team

Here we add eno16777736 and eno33554960 as Team0 interface from the device.

# nmcli con Add type team-slave con-name TEAM0-PORT1 ifname eno16777736 Master Team0

# nmcli con Add type team-slave con-name TEAM0-PORT2 ifname eno33554960 Master Team0

Verify the connection configuration again with the command #nmcli con show. Now we can see the configuration information from the device.

#nmcli Con Show

3. Assigning IP addresses

The above command creates the desired configuration file under the/etc/sysconfig/network-scripts/directory.

Now let's assign an IP address to the TEAM0 interface and enable this connection. This is the command for IP assignment.

# nmcli con mod team0 ipv4.addresses "192.168.1.24/24 192.168.1.1"

# nmcli con mod team0 ipv4.method Manual

# nmcli con up team0

4. Verifying bindings

Verify the IP address information with the #ip add show Team0 command.

#ip Add show Team0

Now use the TEAMDCTL command to check the active backup Configuration feature.

# Teamdctl Team0 State

Now let's disconnect the active port and check the status again to confirm that the active backup configuration works as expected.

# nmcli Dev Dis eno33554960

After disconnecting the activation port, use the command again to check the status #teamdctl team0 state.

# Teamdctl Team0 State

Yes, it works well!! We will use the following command to connect the disconnected connection back to TEAM0.

#nmcli Dev Con eno33554960

We also have a TEAMNL command to display some options for the TEAMNL command.

Use the following command to check the ports that are running on the TEAM0.

# TEAMNL TEAM0 Ports

Displays the port Team0 is currently active.

# TEAMNL Team0 getoption Activeport

Well, we've successfully configured the NIC bindings .

Free pick up Brother Lian IT Education Original Linux Operations Engineer video/Detailed Linux tutorials, details of the website customer service: http://www.lampbrother.net/linux/

or hooking up with Q2430675018.

Welcome to the Linux Communication Group 478068715


Binding multiple NICs in Linux with the NMCLI command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.