centos7 bond 端口聚合

事先需要準備好網(wǎng)絡yum源,保證服務器可正常上網(wǎng)
關(guān)閉防火墻,關(guān)閉selinux

本次實驗虛擬機環(huán)境下模擬,網(wǎng)卡為nat模式,dhcp分配ip,現(xiàn)添加兩張網(wǎng)卡,如圖


image.png

登錄服務器后,由于是后添加的網(wǎng)卡,發(fā)現(xiàn)/etc/sysconfig/network-scripts下沒有新加網(wǎng)卡的配置文件,然后使用以下命令

nmtui

把有線連接
image.png

改為對應網(wǎng)卡改為對應網(wǎng)卡名字
image.png

然后
cd /etc/sysconfig/network-scripts/

然后修改ifcfg-ens37,ifcfg-ens38配置文件(相當于末尾追加MASTER=bond0 SLAVE=yes,把BOOTPROTO改為none),如下

[root@localhost network-scripts]# cat ifcfg-ens37
HWADDR=00:0C:29:B2:F3:A9
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens37
UUID=f69a315d-2735-4489-b99e-7153f016e7b2
ONBOOT=yes
MASTER=bond0 
SLAVE=yes 
[root@localhost network-scripts]# cat ifcfg-ens38
HWADDR=00:0C:29:B2:F3:B3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens38
UUID=3e20bf34-6f74-34ff-b702-7f0e74ed34bc
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
MASTER=bond0
SLAVE=yes

然后新加一個bond配置文件,這里選擇mode 6,無需配置交換機

[root@localhost network-scripts]# cat ifcfg-bond0 
TYPE=Bond
BOOTPROTO=dhcp
ONBOOT=yes
DEVICE=bond0
BONDING_MASTER=yes
BONDING_OPTS="mode=6 miimon=100"

然后重啟網(wǎng)絡

systemctl restart network

然后使用nmtui發(fā)現(xiàn)


image.png
[root@localhost network-scripts]# lsmod | grep bonding
bonding               152979  0 
[root@localhost network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: ens37
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens37
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:b2:f3:a9
Slave queue ID: 0

Slave Interface: ens38
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:b2:f3:b3
Slave queue ID: 0
[root@localhost network-scripts]# ethtool bond0
Settings for bond0:
    Supported ports: [ ]
    Supported link modes:   Not reported
    Supported pause frame use: No
    Supports auto-negotiation: No
    Supported FEC modes: Not reported
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Advertised FEC modes: Not reported
    Speed: 2000Mb/s
    Duplex: Full
    Port: Other
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
    Link detected: yes
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

  • 配個bond0備忘 首先確定自己內(nèi)核是否支持bonding模塊(每個人的內(nèi)核版本都不一樣自己替換) 用hostna...
    遠or廣閱讀 1,109評論 0 1
  • 先說下網(wǎng)卡綁定的模式 CentOS6.x 使用的為bonding 技術(shù)共有七種(0~6) bond0-6 bond...
    遠or廣閱讀 1,826評論 0 1
  • 配置網(wǎng)卡bonding 配置bond0模式,兩塊網(wǎng)卡使用同一個IP地址,當一個網(wǎng)卡故障時,不影響使用 1 . 先關(guān)...
    JevonWei閱讀 2,527評論 0 0
  • 家里臺式機已經(jīng)幾年沒用過了,本著廢物再利用的心態(tài),準備做成服務器使用。記錄下來操作過程以備以后使用。 總體步驟: ...
    勇勇_cf62閱讀 3,149評論 0 1
  • CentOS 6之前,網(wǎng)絡接口使用連續(xù)號碼命名:eth0、eth1等,當 增加或刪除網(wǎng)卡時,名稱可能會發(fā)生變化 ?...
    楠人幫閱讀 868評論 0 0

友情鏈接更多精彩內(nèi)容