Using the NMCLI command to create a network group on Linux

Source: Internet
Author: User

Network group: is a method of aggregating multiple network cards together to achieve redundancy and increase throughput

Network group differs from legacy bonding technology for better performance and scalability

The network group is implemented by the kernel driver and teamd daemon.


Below we demonstrate how to create a network group with the NMCLI command on a Linux system using the CENTOS7 system as an environment

NMCLI connection Add con-name team0 type team ifname team0 config ' {"runner": {"name": "Activebackup"}} '

Create a IFCFG-TEAM0 configuration file

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/86/E1/wKioL1fOJ2fCnJnRAACHn5JzdkI552.png-wh_500x0-wm_3 -wmp_4-s_3042355168.png "style=" Float:none; "title=" 1 Create the Ifcfg-team0 file. png "alt=" Wkiol1foj2fcnjnraachn5jzdki552.png-wh_50 "/>

NMCLI Connection Modify TEAM0 ipv4.addresses 10.1.56.56/16

Add IP for TEAM0

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/86/E1/wKioL1fOJ2iCDnguAABbn-R1St0006.png-wh_500x0-wm_3 -wmp_4-s_516993641.png "style=" Float:none; "title=" 2 Add Team0 "Ip.png" to alt= wkiol1foj2icdnguaabbn-r1st0006.png-wh_50 "/>

Modify the Bootproto=none in the IFCFG-TEAM0 configuration file

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/E2/wKiom1fOJ2iRsooAAABUsni2L80850.png-wh_500x0-wm_3 -wmp_4-s_3040414053.png "style=" Float:none; "title=" 3 Modify Team0 bootproto.png "alt=" Wkiom1foj2irsooaaabusni2l80850.png-wh_50 "/>

NMCLI connection Add con-name team-port1 type Team-slave ifname eno33554984 master Team0

NMCLI connection Add con-name team-port2 type Team-slave ifname eno50332208 master Team0

Creating Port1 and Prot2 interfaces

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/E1/wKioL1fOJ2nAJjI0AABxMKo0K_E080.png-wh_500x0-wm_3 -wmp_4-s_928760066.png "style=" Float:none; "title=" 4 Create Port1 and Port2.png "alt=" Wkiol1foj2najji0aabxmko0k_e080.png-wh _50 "/>

View Port1 and Port2 profiles

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/E2/wKiom1fOJ2mh6RslAABGABAb0Bg567.png-wh_500x0-wm_3 -wmp_4-s_3456788336.png "style=" Float:none; "title=" 5 View Port1 and Port2.png "alt=" Wkiom1foj2mh6rslaabgabab0bg567.png-wh_50 "/>

nmcli Connection up team0 enable TEAM0 and view


650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/86/E1/wKioL1fOJ2qSCOTCAABVanCrY64217.png-wh_500x0-wm_3 -wmp_4-s_583953609.png "style=" Float:none; "title=" 6 enable TEAM0 and view. png "alt=" wkiol1foj2qscotcaabvancry64217.png-wh_50 "/>

nmcli Connection up Team-port1 enable Port1 interface

nmcli Connection up Team-port2 enable Port2 interface

and view

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/86/E2/wKiom1fOJ2rzQ_AyAABp1GsMdDo167.png-wh_500x0-wm_3 -wmp_4-s_2334505777.png "style=" Float:none; "title=" 7 Enable Port1 and 2.png "alt=" wkiom1foj2rzq_ayaabp1gsmddo167.png-wh_50 "/>

Teamdctl Team0 State to view details of TEAM0 and enable NIC condition

Discover Port1 's eno33554984 in runner state

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/86/E2/wKiom1fOJ2uCczmXAABBLts9Xtw334.png-wh_500x0-wm_3 -wmp_4-s_3338920351.png "style=" Float:none; "title=" 8teamdctl teeam0 state.png "alt=" Wkiom1foj2ucczmxaabblts9xtw334.png-wh_50 "/>

Ifconfig View network card, find eno33554984 and eno50332208 no IP address

And Team0 has an IP address, which means our configuration is correct, eno33554984 and eno50332208 serve Team0

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/86/E1/wKioL1fOJ2uRfawHAACdlt56on4523.png-wh_500x0-wm_3 -wmp_4-s_3663036681.png "style=" Float:none; "title=" 9 View ifconfig.png "alt=" Wkiol1foj2urfawhaacdlt56on4523.png-wh_ "/>

Simulates a corrupted port1 and finds that the network is back to normal after a certain number of packets have been lost

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/86/E2/wKiom1fOJ2zTcJlAAACjLxJqKGg480.png-wh_500x0-wm_3 -wmp_4-s_35339450.png "style=" Float:none; "title=" 10 simulates damage. png "alt=" wkiom1foj2ztcjlaaacjlxjqkgg480.png-wh_50 "/>

Teamdctl Team0 State to view details of TEAM0 and enable NIC condition

found that the previous port1 is already in the down state, Port2 's eno50332208 is in runner state

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/86/E1/wKioL1fOJ23wnmLeAABBgbx-DaY567.png-wh_500x0-wm_3 -wmp_4-s_577506888.png "style=" Float:none; "title=" 11 enable standby NIC. png "alt=" wkiol1foj23wnmleaabbgbx-day567.png-wh_50 "/ >

Simulate Port1 and port2 all damage

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/86/E1/wKioL1fOJ23g7_59AABBWlmGxLs329.png-wh_500x0-wm_3 -wmp_4-s_2644475769.png "style=" Float:none; "title=" 12TEAM0 Group Two cards all damaged. png "alt=" wkiol1foj23g7_ 59aabbwlmgxls329.png-wh_50 "/>

Network returns to normal once a certain number of packets have been lost


650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/86/E2/wKiom1fOJ26ybUxVAADHYLzRXME482.png-wh_500x0-wm_3 -wmp_4-s_282156631.png "style=" Float:none; "title=" 13 network is still normal. png "alt=" wkiom1foj26ybuxvaadhylzrxme482.png-wh_50 "/ >

This is because in our previous IP configuration, the default setting for global is available globally, so when the TEAM0 Network group of the two interfaces are all damaged, the system's other network card eno16777736 automatically take over the work of networks, thus realizing the redundancy mechanism.

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/E2/wKiom1fOJ26APLNXAAANQTKA3IY760.png-wh_500x0-wm_3 -wmp_4-s_217154044.png "style=" Float:none; "title=" 14.png "alt=" Wkiom1foj26aplnxaaanqtka3iy760.png-wh_50 "/>


This article is from the "11798474" blog, please be sure to keep this source http://11808474.blog.51cto.com/11798474/1846716

Using the NMCLI command to create a network group on Linux

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.