NIC Teaming on CentOS 7 with Nmtui
in the Linux, which can aggregate multiple network links into a single logical link, can increase network throughput or redundancy. For example, we can assign an IP address to a group of two network interfaces, doubling our throughput, or reserving an interface for the backup, and if the first fails, the second NIC continues to work. Link aggregation has done bond in the past ,but in RHEL7 ,team will be the preferred method. Because team can be aggregated more efficiently, more advantageous than bonding. List of differences for team and Bond .
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8B/EC/wKioL1hczcnSs8bOAACd-15Ack8244.jpg-wh_500x0-wm_3 -wmp_4-s_937913034.jpg "style=" width:500px;height:400px "title=" 11.jpg "width=" height= "0" border= "hspace=" "0" vspace= "0" alt= "wkiol1hczcnss8boaacd-15ack8244.jpg-wh_50"/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/F0/wKiom1hczcrRbHp4AACYZ6ahjVU032.jpg-wh_500x0-wm_3 -wmp_4-s_1445392253.jpg "style=" WIDTH:500PX;HEIGHT:394PX; "title=" 12.jpg "width=" "height=" "394" border= "0" hspace = "0" vspace= "0" alt= "wkiom1hczcrrbhp4aacyz6ahjvu032.jpg-wh_50"/>
Here we will show you how to create and configure a team with two different network interfaces .
1, Teaming Daemon installation
In order to use the teaming feature, the TEAMD package must first be installed and the system will not normally install. Use the following command to install.
#yum Install Teamd-y
2, Nmtui Configuration teaming
First check the system current connection and device configuration
[Email protected] desktop]# NMCLI device status
DEVICE TYPE State CONNECTION
eno16777736 Ethernet Disconnected--
eno33554992 Ethernet Disconnected--
Lo Loopback unmanaged--
[Email protected] desktop]# NMCLI connection Show
NAME UUID TYPE DEVICE
[Email protected] desktop]#
There are no connection on both NICs. Perform Nmtui configuration teaming.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/EC/wKioL1hcz1CyqRQEAAAlgZZ-1CI038.jpg-wh_500x0-wm_3 -wmp_4-s_3443515883.jpg "style=" WIDTH:300PX;HEIGHT:286PX; "title=" 1.jpg "width=" "height=" 286 "border=" 0 "hspace= "0" vspace= "0" alt= "wkiol1hcz1cyqrqeaaalgzz-1ci038.jpg-wh_50"/>
Select "Edit a Connection" to move the cursor to OK and enter the next step.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8B/F0/wKiom1hcz1CxbYIyAAAU9KMOqf8213.jpg-wh_500x0-wm_3 -wmp_4-s_1684476114.jpg "style=" width:300px;height:283px; "title=" 2.jpg "width=" "height=" 283 "border=" 0 "hspace= "0" vspace= "0" alt= "wkiom1hcz1cxbyiyaaau9kmoqf8213.jpg-wh_50"/>
Select Add, enter.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8B/EC/wKioL1hcz1GTWSOvAAAnPvEGRv0762.jpg-wh_500x0-wm_3 -wmp_4-s_4168408613.jpg "style=" Float:none; "title=" 3.jpg "alt=" Wkiol1hcz1gtwsovaaanpvegrv0762.jpg-wh_50 "/>
Select the device type Team,crate.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/F0/wKiom1hcz1OBpLSpAABclEgUn4c573.jpg-wh_500x0-wm_3 -wmp_4-s_3610697771.jpg "style=" Float:none; "title=" 4.jpg "alt=" Wkiom1hcz1obplspaabclegun4c573.jpg-wh_50 "/>
The profile name is set according to the requirements, which is set to Myteam0,device and can also be set according to the requirements, which is set to TEAM0. When the settings are complete, move the cursor to add, adding the slave device.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8B/F0/wKiom1hcz1OwB_bsAAAr5Z6EY08568.jpg-wh_500x0-wm_3 -wmp_4-s_3284477979.jpg "style=" Float:none; "title=" 5.jpg "alt=" Wkiom1hcz1owb_bsaaar5z6ey08568.jpg-wh_50 "/>
Select Ethernet Type Creation
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/EC/wKioL1hcz1XCQnCBAABGnfWvqng002.jpg-wh_500x0-wm_3 -wmp_4-s_1150848826.jpg "style=" Float:none; "title=" 6.jpg "alt=" Wkiol1hcz1xcqncbaabgnfwvqng002.jpg-wh_50 "/>
Profile name is set to Myteam0-port1,device, set to the server NIC device name, as required.
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8B/EC/wKioL1hcz1bzprREAABGDin8gHg371.jpg-wh_500x0-wm_3 -wmp_4-s_3315588652.jpg "style=" Float:none; "title=" 7.jpg "alt=" Wkiol1hcz1bzprreaabgdin8ghg371.jpg-wh_50 "/>
Add the second NIC and set the profile name and device. Set to complete as result.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8B/F0/wKiom1hcz1iCRA0iAABJWNwQG_E026.jpg-wh_500x0-wm_3 -wmp_4-s_65197523.jpg "style=" Float:none; "title=" 8.jpg "alt=" Wkiom1hcz1icra0iaabjwnwqg_e026.jpg-wh_50 "/>
JSON configuration, move cursor to edit, enter will temporarily open a vim window, enter {"Runner" in Vim window: {"name": "LoadBalance"}},
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8B/F0/wKiom1hc1NfxazRlAAAgTIFpI1c288.jpg-wh_500x0-wm_3 -wmp_4-s_3849457303.jpg "title=" 13.jpg "alt=" Wkiom1hc1nfxazrlaaagtifpi1c288.jpg-wh_50 "/>
After you save the exit, it appears as follows.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8B/EC/wKioL1hcz1nR0tqIAABVlSJzdx4154.jpg-wh_500x0-wm_3 -wmp_4-s_3713937211.jpg "style=" Float:none; "title=" 9.jpg "alt=" Wkiol1hcz1nr0tqiaabvlsjzdx4154.jpg-wh_50 "/>
Configure IPv4, set to Manual, set IP, gateway, DNS as follows
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8B/F0/wKiom1hcz1yAAzdYAAB9ts1jqGk373.jpg-wh_500x0-wm_3 -wmp_4-s_1842941010.jpg "style=" Float:none; "title=" 10.jpg "alt=" Wkiom1hcz1yaazdyaab9ts1jqgk373.jpg-wh_50 "/>
After completing the Save exit, the teaming configuration completes automatically creating the relevant configuration file as follows:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8B/F1/wKiom1hc3kDT2kVcAABuWS6azks257.jpg-wh_500x0-wm_3 -wmp_4-s_2938784208.jpg "title=" 14.jpg "alt=" Wkiom1hc3kdt2kvcaabuws6azks257.jpg-wh_50 "/>
[email protected] network-scripts]# cat Ifcfg-myteam0
Device=team0
team_config= "{\" Runner\ ": {\" name\ ": \" Loadbalance\ "}}"
Devicetype=team
Bootproto=none
dns1=192.168.31.1
Defroute=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_failure_fatal=no
Name=myteam0
uuid=1f4ed5e2-46a1-4dbf-a870-5b088957a434
Onboot=yes
ipaddr=192.168.31.108
Prefix=24
gateway=192.168.31.1
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
[email protected] network-scripts]# cat Ifcfg-myteam0-port1
Name=myteam0-port1
Uuid=2b975876-780f-4181-971e-a79cf6a07a40
device=eno16777736
Onboot=yes
team_master=1f4ed5e2-46a1-4dbf-a870-5b088957a434
Devicetype=teamport
[email protected] network-scripts]# cat Ifcfg-myteam0-port2
Name=myteam0-port2
Uuid=24e3ef82-fb93-4d11-9a6e-4c27227f7f66
device=eno33554992
Onboot=yes
team_master=1f4ed5e2-46a1-4dbf-a870-5b088957a434
Devicetype=teamport
[Email protected] network-scripts]#
Review the current connection status again.
[Email protected] desktop]# NMCLI connection Show
NAME UUID TYPE DEVICE
MYTEAM0 1f4ed5e2-46a1-4dbf-a870-5b088957a434 Team Team0
Myteam0-port2 24e3ef82-fb93-4d11-9a6e-4c27227f7f66 802-3-ethernet eno33554992
Myteam0-port1 2b975876-780f-4181-971e-a79cf6a07a40 802-3-ethernet eno16777736
View the status of the server's current device.
[Email protected] desktop]# NMCLI device status
DEVICE TYPE State CONNECTION
eno16777736 Ethernet Connected Myteam0-port1
eno33554992 Ethernet Connected Myteam0-port2
TEAM0 Team Connected Myteam0
Lo Loopback unmanaged--
View IP address information.
[[Email protected] desktop]# IP a s
1:lo: <LOOPBACK,UP,LOWER_UP> MTU 65536 qdisc noqueue State UNKNOWN
Link/loopback 00:00:00:00:00:00 BRD 00:00:00:00:00:00
inet 127.0.0.1/8 Scope host Lo
Valid_lft Forever Preferred_lft Forever
INET6:: 1/128 Scope Host
Valid_lft Forever Preferred_lft Forever
2:eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU qdisc pfifo_fast Master Team0 State up Qlen 1000
Link/ether 00:0c:29:51:e8:75 BRD FF:FF:FF:FF:FF:FF
3:eno33554992: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU qdisc pfifo_fast Master Team0 State up Qlen 1000
Link/ether 00:0c:29:51:e8:75 BRD FF:FF:FF:FF:FF:FF
5:TEAM0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc Noqueue State up
Link/ether 00:0c:29:51:e8:75 BRD FF:FF:FF:FF:FF:FF
inet 192.168.31.108/24 BRD 192.168.31.255 Scope Global TEAM0
Valid_lft Forever Preferred_lft Forever
Inet6 fe80::20c:29ff:fe51:e875/64 Scope link tentative dadfailed
Valid_lft Forever Preferred_lft Forever
View Myteam0 's details and status as follows
[Email protected] desktop]# Teamdctl TEAM0 State
Setup
Runner:loadbalance
Ports
eno16777736
Link watches:
Link Summary:up
INSTANCE[LINK_WATCH_0]:
Name:ethtool
Link:up
Down count:0
eno33554992
Link watches:
Link Summary:up
INSTANCE[LINK_WATCH_0]:
Name:ethtool
Link:up
Down count:0
View slave NIC status via TEAMNL
[Email protected] ~]# TEAMNL TEAM0 ports
3:eno33554992:up 1000Mbit FD
2:eno16777736:up 1000Mbit FD
[Email protected] ~]#
3. Testing
On the client and ping 192.168.31.108, and then disconnect a NIC link on the server side, the ping command does not end.
[Email protected] desktop]# NMCLI device Disconnect eno16777736
Device ' eno16777736 ' successfully disconnected.
[Email protected] desktop]#
[Email protected] desktop]# NMCLI connection Show
NAME UUID TYPE DEVICE
Myteam0-port2 1a0f2bfd-cea1-4c7b-b2de-d34199b8561e 802-3-ethernet eno33554992
Myteam0-port1 8e0c325c-d069-4014-bb75-1fa1f4674618 802-3-ethernet--
MYTEAM0 e2976c8e-da7d-4901-88c6-db8a9913947c Team Team0
[Email protected] desktop]# NMCLI device status
DEVICE TYPE State CONNECTION
eno33554992 Ethernet Connected Myteam0-port2
TEAM0 Team Connected Myteam0
eno16777736 Ethernet Disconnected--
Lo Loopback unmanaged--
[Email protected] desktop]#
[Email protected] desktop]# Teamdctl TEAM0 State
Setup
Runner:loadbalance
Ports
eno33554992
Link watches:
Link Summary:up
INSTANCE[LINK_WATCH_0]:
Name:ethtool
Link:up
Down count:0
[Email protected] desktop]#
After disconnecting the link, view the client ping terminal.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/ED/wKioL1hc1wzAGRZPAACXEWTc-u8793.jpg-wh_500x0-wm_3 -wmp_4-s_2513332965.jpg "title=" qq20161223143054.jpg "alt=" Wkiol1hc1wzagrzpaacxewtc-u8793.jpg-wh_50 "/>
4. Modify Team Configuration
For team configuration can be modified by Nmtui or NMCLI, Nmtui open graphics, in the JSON configuration interface, select Edit to modify the contents of the Vim window to save exit.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8B/F1/wKiom1hc3w6wjBxfAABXlf_RPfE174.jpg-wh_500x0-wm_3 -wmp_4-s_3703600040.jpg "title=" 15.jpg "alt=" Wkiom1hc3w6wjbxfaabxlf_rpfe174.jpg-wh_50 "/>
[Email protected] desktop]# NMCLI connection down Myteam0
Connection ' MYTEAM0 ' successfully deactivated (d-bus active path:/ORG/FREEDESKTOP/NETWORKMANAGER/ACTIVECONNECTION/9)
[Email protected] desktop]# NMCLI connection Show
NAME UUID TYPE DEVICE
Myteam0-port1 2b975876-780f-4181-971e-a79cf6a07a40 802-3-ethernet--
Myteam0-port2 24e3ef82-fb93-4d11-9a6e-4c27227f7f66 802-3-ethernet--
MYTEAM0 1f4ed5e2-46a1-4dbf-a870-5b088957a434 Team--
[Email protected] desktop]# NMCLI device status
DEVICE TYPE State CONNECTION
eno16777736 Ethernet Disconnected--
eno33554992 Ethernet Disconnected--
Lo Loopback unmanaged--
[Email protected] desktop]# NMCLI connection up Myteam0-port1
Connection successfully activated (D-bus active path:/ORG/FREEDESKTOP/NETWORKMANAGER/ACTIVECONNECTION/12)
[Email protected] desktop]# NMCLI connection up Myteam0-port2
Connection successfully activated (D-bus active path:/ORG/FREEDESKTOP/NETWORKMANAGER/ACTIVECONNECTION/14)
[Email protected] desktop]# NMCLI connection up Myteam0
Connection successfully activated (master waiting for slaves) (D-bus active path:/org/freedesktop/networkmanager/ ACTIVECONNECTION/15)
[Email protected] desktop]# NMCLI device status
DEVICE TYPE State CONNECTION
eno16777736 Ethernet Connected Myteam0-port1
eno33554992 Ethernet Connected Myteam0-port2
TEAM0 Team Connected Myteam0
Bond0 Bond Unmanaged--
Lo Loopback unmanaged--
[Email protected] desktop]# NMCLI connection Show
NAME UUID TYPE DEVICE
Myteam0-port1 2b975876-780f-4181-971e-a79cf6a07a40 802-3-ethernet eno16777736
Myteam0-port2 24e3ef82-fb93-4d11-9a6e-4c27227f7f66 802-3-ethernet eno33554992
MYTEAM0 1f4ed5e2-46a1-4dbf-a870-5b088957a434 Team Team0
[Email protected] desktop]# Teamdctl TEAM0 State
Setup
Runner:roundrobin
Ports
eno16777736
Link watches:
Link Summary:up
INSTANCE[LINK_WATCH_0]:
Name:ethtool
Link:up
Down count:0
eno33554992
Link watches:
Link Summary:up
INSTANCE[LINK_WATCH_0]:
Name:ethtool
Link:up
Down count:0
[Email protected] desktop]#
Note:
(1), team configuration file can be seen in the/usr/share/doc/teamd-1.25/directory of the document, you can also refer to
Man teamd.conf Help content
[Email protected] ~]# cd/usr/share/doc/teamd-1.25/
[[email protected] teamd-1.25]# ls
COPYING Example_configs Example_ifcfgs
[Email protected] teamd-1.25]# CD example_configs/
[[email protected] example_configs]# ls
activebackup_arp_ping_1.conf activebackup_ethtool_3.conf broadcast.conf loadbalance_3.conf
activebackup_arp_ping_2.conf activebackup_multi_lw_1.conf lacp_1.conf random.conf
activebackup_ethtool_1.conf activebackup_nsna_ping_1.conf loadbalance_1.conf roundrobin_2.conf
activebackup_ethtool_2.conf activebackup_tipc.conf loadbalance_2.conf roundrobin.conf
[Email protected] example_configs]#
(2),runners available is listed below (Configuration '-' remove input)
Broadcast (data is transmitted through all ports)
Round-robin (data is transmitted through all ports in turn)
Active-backup (one port or link is used and others is kept as a backup)
LoadBalance (with active Tx load balancing and bpf-based TX Port selectors)
LACP (implements the 802.3ad Link Aggregation Control Protocol)
This article is from "Technical achievement dream!" "Blog, be sure to keep this provenance http://dreamsanqin.blog.51cto.com/845412/1885538
NIC Teaming on CentOS 7 with Nmtui