Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決-創(chuàng)新互聯(lián)

今天小編給大家分享一下Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決的相關(guān)知識(shí)點(diǎn),內(nèi)容詳細(xì),邏輯清晰,相信大部分人都還太了解這方面的知識(shí),所以分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后有所收獲,下面我們一起來(lái)了解一下吧。

公司專注于為企業(yè)提供成都網(wǎng)站制作、做網(wǎng)站、微信公眾號(hào)開(kāi)發(fā)、商城網(wǎng)站建設(shè)微信小程序定制開(kāi)發(fā),軟件定制網(wǎng)站設(shè)計(jì)等一站式互聯(lián)網(wǎng)企業(yè)服務(wù)。憑借多年豐富的經(jīng)驗(yàn),我們會(huì)仔細(xì)了解各客戶的需求而做出多方面的分析、設(shè)計(jì)、整合,為客戶設(shè)計(jì)出具風(fēng)格及創(chuàng)意性的商業(yè)解決方案,創(chuàng)新互聯(lián)建站更提供一系列網(wǎng)站制作和網(wǎng)站推廣的服務(wù)。

說(shuō)明下,以下環(huán)境是在虛擬機(jī)中實(shí)現(xiàn)的:

系統(tǒng): centos7.2 x64 最小化安裝。

Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決

為了方便演示,這里共有三張網(wǎng)卡:


    eno16777736 : 橋接網(wǎng)卡:10.0.0.11/24


    剩下的兩張網(wǎng)卡準(zhǔn)備做綁定:


        eno33554984


        eno50332208

[root@bogon ~]# nmcli con sh 
name    uuid         type   device  
wired connection 2 bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0 802-3-ethernet --   
wired connection 1 5b4e0b3e-c469-404c-8839-76d18442fc20 802-3-ethernet --   
eno16777736   100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 
[root@bogon ~]# nmcli con del 5b4e0b3e-c469-404c-8839-76d18442fc20 bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0
connection 'wired connection 1' (5b4e0b3e-c469-404c-8839-76d18442fc20) successfully deleted.
connection 'wired connection 2' (bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0) successfully deleted.

[root@bogon ~]# nmcli con add type team ifname team0 con-name team0 config '{"runner":{"name":"roundrobin"}}'
connection 'team0' (913f05c2-15d8-49a9-a35f-8bc5ee843c0c) successfully added.
[root@bogon ~]# nmcli con add type team-slave ifname eno50332208 con-name team0-port2 master team0
connection 'team0-port2' (1583854c-1f85-4c76-8cc7-c643071d4b82) successfully added.
[root@bogon ~]# nmcli con mod team0 ipv4.address "192.168.121.100/24"
[root@bogon ~]# nmcli con mod team0 ipv4.method manual

[root@bogon ~]# nmcli con sh 
name   uuid         type   device  
eno16777736 100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 
team0-port2 1583854c-1f85-4c76-8cc7-c643071d4b82 802-3-ethernet --   
team0-port1 bfd408b4-76d9-4f5c-ad5b-4d92430eb6ba 802-3-ethernet --   
team0  913f05c2-15d8-49a9-a35f-8bc5ee843c0c team   --

到這里都沒(méi)毛病。

[root@bogon ~]# nmcli con up team0
error: connection activation failed: networkmanager plugin for 'team' unavailable

什么鬼?networkmanager "team"插件不可用。于是開(kāi)始排查。

是否存在team模塊

[root@bogon ~]# lsmod | egrep *team*

木有。那直接restart network好了。

[root@bogon ~]# systemctl restart network 
job for network.service failed because the control process exited with error code. see "systemctl status network.service" and "journalctl -xe" for details.

[root@bogon ~]# systemctl status network
...
mar 25 04:47:56 bogon network[2742]: bringing up interface team0: error: connection activation failed: networkmanager plugin for 'team' unavailable
mar 25 04:47:56 bogon network[2742]: [failed]
...

一樣的報(bào)錯(cuò),難道什么包沒(méi)有安裝到?

[root@bogon ~]# yum list all | grep networkmanager*
networkmanager.x86_64     1:1.0.6-27.el7     @anaconda
networkmanager-libnm.x86_64    1:1.0.6-27.el7     @anaconda
networkmanager-tui.x86_64    1:1.0.6-27.el7     @anaconda
networkmanager-wifi.x86_64    1:1.0.6-27.el7     @anaconda
networkmanager-adsl.x86_64    1:1.0.6-27.el7     yum  
networkmanager-bluetooth.x86_64   1:1.0.6-27.el7     yum  
networkmanager-glib.x86_64    1:1.0.6-27.el7     yum  
networkmanager-libreswan.x86_64   1.0.6-3.el7     yum  
networkmanager-libreswan-gnome.x86_64 1.0.6-3.el7     yum  
networkmanager-team.x86_64    1:1.0.6-27.el7     yum  
networkmanager-wwan.x86_64    1:1.0.6-27.el7     yum

哎喲,還真有個(gè)networkmanager-team沒(méi)有安裝叻。

[root@bogon ~]# yum install networkmanager-team -y

然后再次嘗試:

[root@bogon ~]# nmcli con sh 
name   uuid         type   device  
eno16777736 100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 
team0-port2 1583854c-1f85-4c76-8cc7-c643071d4b82 802-3-ethernet --   
team0-port1 bfd408b4-76d9-4f5c-ad5b-4d92430eb6ba 802-3-ethernet --   
team0  913f05c2-15d8-49a9-a35f-8bc5ee843c0c team   -- 

[root@bogon ~]# nmcli con up team0
error: connection activation failed: networkmanager plugin for 'team' unavailable

尼瑪,還是同樣的錯(cuò),這就尷尬了。那就重啟下networkmanager 在看看。

[root@bogon ~]# systemctl restart networkmanager

[root@bogon ~]# nmcli con sh 
name   uuid         type   device  
team0-port2 1583854c-1f85-4c76-8cc7-c643071d4b82 802-3-ethernet eno50332208 
eno16777736 100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 
team0-port1 bfd408b4-76d9-4f5c-ad5b-4d92430eb6ba 802-3-ethernet eno33554984 
team0  913f05c2-15d8-49a9-a35f-8bc5ee843c0c team   team0

好了? what the fuck!趕緊查看是不是roundrobin模式

[root@bogon ~]# teamdctl team0 st
setup:
 runner: roundrobin
ports:
 eno33554984
 link watches:
  link summary: up
  instance[link_watch_0]:
  name: ethtool
  link: up
  down count: 0
 eno50332208
 link watches:
  link summary: up
  instance[link_watch_0]:
  name: ethtool
  link: up
  down count: 0
[root@bogon ~]# teamnl team0 ports 
 4: eno50332208: up 1000mbit fd 
 3: eno33554984: up 1000mbit fd

一切ok,老鐵,扎心了。

接下來(lái)測(cè)試下roundrobin


    這里說(shuō)明下:roundrobin這種bind模式:


        先來(lái)講下網(wǎng)卡bind的原理:


            通過(guò)將兩張或者多張網(wǎng)卡通過(guò)軟件虛擬出來(lái)一張邏輯網(wǎng)卡來(lái)傳輸數(shù)據(jù),這里bind的模式有很多種。比如我們上面的這種,就是其中的鏈路聚合模式。當(dāng)使用該模式的時(shí)候,兩張物理網(wǎng)卡和邏輯網(wǎng)卡的mac地址都被設(shè)置為一致,大家都知道,我們做鏈路聚合就是為了讓多張物理網(wǎng)卡聚合在一塊擴(kuò)展數(shù)據(jù)帶寬的方式,既然我們?cè)谶壿嬌鲜且粡埦W(wǎng)卡,那mac地址也就必須一致對(duì)吧。不然我們接到交換機(jī)或者路由器上,邏輯網(wǎng)卡一會(huì)是物理網(wǎng)卡1的mac地址,一會(huì)又是物理網(wǎng)卡2的地址,交換機(jī)一會(huì)找的到人,一會(huì)又找不到人。那數(shù)據(jù)還怎么傳輸。

            在鏈路聚合中,因?yàn)槭莾蓮埼锢砭W(wǎng)卡捆綁的模式,如果其中一張網(wǎng)卡down掉了,整個(gè)鏈路也就癱了。

  如下:

Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決


以上就是“Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家閱讀完這篇文章都有很大的收獲,小編每天都會(huì)為大家更新不同的知識(shí),如果還想學(xué)習(xí)更多的知識(shí),請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

本文題目:Centos中雙網(wǎng)卡綁定及相關(guān)問(wèn)題怎么解決-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)URL:http://bm7419.com/article46/ijheg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、微信公眾號(hào)、網(wǎng)站建設(shè)、App設(shè)計(jì)、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站內(nèi)鏈

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)