日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

网络组Network Teaming

發(fā)布時(shí)間:2024/9/5 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 网络组Network Teaming 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

網(wǎng)絡(luò)組team:是將多個(gè)網(wǎng)卡聚合在一起,從而實(shí)現(xiàn)容錯(cuò)和提高吞吐量

1 創(chuàng)建網(wǎng)絡(luò)組接口

nmcli connection add type team con-name TEAMname ifname INTname [config JSON]

TEAMname 指定連接名,INname指定接口名,

JSON指定runner方式,格式為:'{"runner":{"name":"METHOD"}}'

METHOD 可以是broadcast、roundrobin、activebackup、loadbalance、lacp

(1)創(chuàng)建網(wǎng)絡(luò)接口組team0

[root@centos7 ~]# nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"loadbalance"}}'
Connection 'team0' (e70483a1-2688-4eb2-9466-8e732360291d) successfully added.

(2)給網(wǎng)路組team0配置IP地址

[root@centos7 ~]# nmcli connection modify team0 ipv4.method manual ipv4.addresses 200.200.200.200/24 gw4 200.200.200.1

2 創(chuàng)建port接口(SLAVE)

既就是生成組TEAM組成員的配置文件。

注意:這個(gè)配置文件和網(wǎng)卡配置文件是相互獨(dú)立的。

nmcli connection add type team-slave con-name SLAVEname ifname INname master TEAMname

SLAVEname 指定連接名,INTname指定網(wǎng)絡(luò)接口名(相當(dāng)于指定要加入網(wǎng)絡(luò)組的網(wǎng)卡名),TEAMnmae指定所屬網(wǎng)絡(luò)組。

若連接名不指定,默認(rèn)為team-slave-IFACE

創(chuàng)建接口組

????這里使用ens34、ens38兩塊網(wǎng)卡

[root@centos7 ~]# nmcli connection add con-name team0-ens34 type team-slave ifname ens34 master team0 Connection 'team0-ens34' (a481fb6d-bf61-413d-a2c7-289966bee1a7) successfully added. [root@centos7 ~]# nmcli connection add con-name team0-ens38 type team-slave ifname ens38 master team0 Connection 'team0-ens38' (758d0eba-1625-46b2-b539-1d853a45be6b) successfully added.

3 啟用網(wǎng)絡(luò)組

啟用網(wǎng)絡(luò)組:nmcli connection up team0

啟用組成員:nmcli connection up SLAVEname

[root@centos7 ~]# nmcli connection up team0 Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/20)[root@centos7 ~]# nmcli connection up team0-ens34 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/23)[root@centos7 ~]# nmcli connection up team0-ens38 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/24)

4 查看網(wǎng)絡(luò)組狀態(tài)

teamdctl TEAMname state

[root@centos7 ~]# teamdctl team0 state

setup:

runner: loadbalance

ports:

ens34

link watches:

link summary: up

instance[link_watch_0]:

name: ethtool

link: up

down count: 0

ens38

link watches:

link summary: up

instance[link_watch_0]:

name: ethtool

link: up

down count: 0

5 網(wǎng)絡(luò)組配置文件

(1)MASTER配置文件

[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0

DEVICE=team0

TEAM_CONFIG="{\"runner\":{\"name\":\"loadbalance\"}}"

BOOTPROTO=none

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

NAME=team0

UUID=e70483a1-2688-4eb2-9466-8e732360291d

ONBOOT=yes

DEVICETYPE=Team

IPADDR=200.200.200.200

PREFIX=24

GATEWAY=200.200.200.1

(2)組成員(SLAVE)配置文件

[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0-ens34

NAME=team0-ens34

UUID=a481fb6d-bf61-413d-a2c7-289966bee1a7

DEVICE=ens34

ONBOOT=yes

TEAM_MASTER=team0

DEVICETYPE=TeamPort

6 刪除網(wǎng)絡(luò)組

(1)斷開連接

[root@centos7 ~]# nmcli connection down team0Connection 'team0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)

查看下狀態(tài)

[root@centos7 ~]# teamdctl team0 state Device "team0" does not exist [root@centos7 ~]# nmcli connection show

NAME UUID TYPE DEVICE

ens33 be9d1f2f-20e0-4282-9cb5-0da4c8b0fc7c 802-3-ethernet ens33

virbr0 8b1532d4-d99b-4201-8163-44d733302230 bridge virbr0

team0 e70483a1-2688-4eb2-9466-8e732360291d team --

team0-ens34 a481fb6d-bf61-413d-a2c7-289966bee1a7 802-3-ethernet --

team0-ens38 758d0eba-1625-46b2-b539-1d853a45be6b 802-3-ethernet --

可以看到已經(jīng)關(guān)閉成功

(2)刪除TEAM組成員

[root@centos7 ~]# nmcli connection delete team0-ens34 Connection 'team0-ens34' (a481fb6d-bf61-413d-a2c7-289966bee1a7) successfully deleted. [root@centos7 ~]# nmcli connection delete team0-ens38 Connection 'team0-ens38' (758d0eba-1625-46b2-b539-1d853a45be6b) successfully deleted.

(3)刪除TEAM組

[root@centos7 ~]# nmcli connection delete team0 Connection 'team0' (e70483a1-2688-4eb2-9466-8e732360291d) successfully deleted.

查看一下

[root@centos7 ~]# nmcli connection show NAME UUID TYPE DEVICE ens33 be9d1f2f-20e0-4282-9cb5-0da4c8b0fc7c 802-3-ethernet ens33 virbr0 8b1532d4-d99b-4201-8163-44d733302230 bridge virbr0

已經(jīng)看不到team0 相關(guān)的內(nèi)容,說明刪除成功

轉(zhuǎn)載于:https://www.cnblogs.com/Sunzz/p/7091651.html

總結(jié)

以上是生活随笔為你收集整理的网络组Network Teaming的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。