Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configure Network grouping (Network Team) in CentOS7

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I previously wrote a web-grouped article using nmtui graphical interface configuration, but JSON string input is tedious. Therefore, it is recommended that nmcli be configured. In addition, network grouping is recommended in CentOS7 to replace the previous network card binding. The specific operation has been discussed in detail in the White Paper of Red Hat. For more information, please see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/index.html.

Use the nmcli tool to configure 1. Create a network group

Command:

Nmcli connection add type team con-name ifname [configJSON]

Description:

CNAME: connection name INAME: interface name configJSON: specify runner method, format:'{"runner": {"name": "METHOD"}}'

METHOD can be broadcast,roundrobin,activebackup,loadbalance, lacp.

For example:

Nmcli connection add type team con-name team0 ifname team02. Add network group member ports and activate

Suppose the onboard NICs to be bound are eno1 and eno2

Add member port

Format:

Nmcli con add type team-slave con-name ifname master

Description:

CNAME: connection name INAME: network interface name TEAM: network group interface name connection name (CNAME) if not specified, default is team-slave-IFACEcon: abbreviation for connection

For example:

Nmcli con add type team-slave con-name team0-port1 ifname eno1 master team0nmcli con add type team-slave con-name team0-port2 ifname eno2 master team0 activates member port nmcli con up team0-port1nmcli con up team0-port2

You can view the group status of the network by using the command "ip link show". You can also use the following command to ensure that the port group is enabled

Nmcli con up team03. Configure a network grouped profile

Command:

Nmcli con modify team0 team.config [configJSON]

Description:

ConfigJSON can be either a configuration string or an JSON configuration file. Network grouped configuration files have examples in the / usr/share/doc/teamd-* / example_configs/ file and can be modified on this basis, especially port members. 4. Set the IP and other information of network group ports

The following are examples

(1) configure IP address nmcli con modify team0 ipv4.address 192.168.1.100 Universe 24 (2) configure gateway nmcli con modify team0 ipv4.gateway 192.168.1.1 (3) configure DNSnmcli con modify team0 ipv4.dns 192.168.1.3192.168.1.4

Two DNS addresses are separated by commas.

(4) configure IP domain (optional) nmcli con modify team0 ipv4.dns-search xxx.xxx.xxx (5) configure DNS address setting mode nmcli con modify team0 ipv4.method manual/auto/ignore

There are three ways to configure IP, which are manual, auto and ignore listed above.

Other configuration instructions # View network interface nmcli dev dis INAME# enable / shut down group interface and port interface nmcli con up/down CNAME

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report