美文网首页CentOSNetwork
centos7 bond 端口聚合

centos7 bond 端口聚合

作者: 泗渡 | 来源:发表于2022-05-12 14:10 被阅读0次

事先需要准备好网络yum源,保证服务器可正常上网
关闭防火墙,关闭selinux

本次实验虚拟机环境下模拟,网卡为nat模式,dhcp分配ip,现添加两张网卡,如图


image.png

登录服务器后,由于是后添加的网卡,发现/etc/sysconfig/network-scripts下没有新加网卡的配置文件,然后使用以下命令

nmtui
把有线连接 image.png
改为对应网卡改为对应网卡名字 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"

然后重启网络

systemctl restart network

然后使用nmtui发现


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

相关文章

  • centos7 bond 端口聚合

    事先需要准备好网络yum源,保证服务器可正常上网关闭防火墙,关闭selinux 本次实验虚拟机环境下模拟,网卡为n...

  • centos多网卡端口聚合配置

    Centos6/7多网卡配置端口聚合 关闭NetworkManager服务 加载bond模块 配置网卡文件,以网卡...

  • Centos7链路聚合bond0

    配个bond0备忘 首先确定自己内核是否支持bonding模块(每个人的内核版本都不一样自己替换) cat /bo...

  • Linux Bond 初识

    linux的链路聚合就是把多网卡捆绑成一个逻辑网卡,聚合有bond模式和team模式,在企业及电信Linux服务器...

  • Linux常用命令

    CentOS7 防火墙增加端口

  • Centos7端口开放

    Centos7端口开放 查看已打开的端口 netstat -anp 查看想开的端口是否已开 firewall-c...

  • linux服务器常用

    Centos7 打开80端口防火墙命令

  • centos7 防火墙

    centos7防火墙开放端口 >>>永久增加端口开放 firewall-cmd --zone=public --a...

  • centos7 添加端口

    以centos7开放8080端口为例: 添加端口firewall-cmd --zone=public --add-...

  • centos7的双网卡绑定

    centos7的双网卡绑定 关闭NetworkManager 修改配置文件 然后再重启网卡 查看bond0是否配置正常

网友评论

    本文标题:centos7 bond 端口聚合

    本文链接:https://www.haomeiwen.com/subject/jsidurtx.html