Product SiteDocumentation Site

5.13. Configure Network Teaming Using nmcli

To create a new team interface, with name team-ServerA, issue a command as follows:
~]$ nmcli connection add type team ifname ServerA
Connection 'team-ServerA' (981eb129-1707-4a2e-a6ea-413330d96c10) successfully added.
As no JSON configuration file was specified the default configuration is used. Notice that the name was derived from the interface name by prepending the type. Alternatively, specify a name with con-name as follows:
~]$ nmcli connection add type team con-name Team0 ifname ServerB
Connection 'Team0' (fcafb3f0-4c95-48df-9e28-7ac7213f38ba) successfully added.
To view the team interfaces just configured, issue a command as follows:
~]$ nmcli connection show
NAME              UUID                                  TYPE        TIMESTAMP-REAL
Team0             fcafb3f0-4c95-48df-9e28-7ac7213f38ba  team        never
team-ServerA      981eb129-1707-4a2e-a6ea-413330d96c10  team        never
To load a team configuration file for a team that already exists, issue a command as follows:
~]$ nmcli connection modify team-ServerA team.config JSON-config
You can specify the team configuration either as JSON string or provide a file name containing the configuration. The file name can include the path. In both cases, what is stored in the team.config property is the JSON string. In the case of a JSON string, use single quotes around the string and paste the entire string to the command line.
To review the team.config property, enter a command as follows:
~]$ nmcli conn show team-ServerA | grep team.config
To add an interface to the team, with name team-slave-ens3, issue a command as follows:
~]$ nmcli connection add type team-slave ifname ens3 master Team0
Connection 'team-slave-ens3' (a33d5d32-87d7-4dc4-8a27-5a44aabfa440) successfully added.
Notice that the name was derived from the interface name by prepending the type. Alternatively, specify a name with con-name as follows:
~]$ nmcli con add type team-slave con-name Team0-port1 ifname ens3 master Team0
Connection 'Team0-port1' (adbf21f2-51b6-492f-8fc8-48b831383ac9) successfully added.
~]$ nmcli con add type team-slave con-name Team0-port2 ifname ens7 master Team0
Connection 'Team0-port2' (e5317075-c0c1-472f-b25d-0433b0297ea3) successfully added.
At time of writing, nmcli only supports Ethernet ports.
In order to bring up a team, the ports must be brought up first as follows:
~]$ nmcli connection up Team0-port1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
~]$ nmcli connection up Team0-port2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
You can verify the team interface was brought up by the activation of the ports, as follows:
~]$ ip link
3:  Team0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
    link/ether 52:54:00:76:6f:f0 brd ff:ff:ff:ff:ff:f
Alternatively, issue a command to bring up the team as follows:
~]$ nmcli connection up Team0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
See Section 2.4, “Using the NetworkManager Command Line Tool, nmcli” for an introduction to nmcli