草庐IT

centos7 bond 端口聚合

泗渡 2023-03-28 原文

事先需要准备好网络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 端口聚合的更多相关文章

  1. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  2. kvm虚拟机安装centos7基于ubuntu20.04系统 - 2

    需求:要创建虚拟机,就需要给他提供一个虚拟的磁盘,我们就在/opt目录下创建一个10G大小的raw格式的虚拟磁盘CentOS-7-x86_64.raw命令格式:qemu-imgcreate-f磁盘格式磁盘名称磁盘大小qemu-imgcreate-f磁盘格式-o?1.创建磁盘qemu-imgcreate-fraw/opt/CentOS-7-x86_64.raw10G执行效果#ls/opt/CentOS-7-x86_64.raw2.安装虚拟机使用virt-install命令,基于我们提供的系统镜像和虚拟磁盘来创建一个虚拟机,另外在创建虚拟机之前,提前打开vnc客户端,在创建虚拟机的时候,通过vnc

  3. ruby - Rails Elasticsearch 聚合 - 2

    不知何故,我似乎无法获得包含我的聚合的响应...使用curl它按预期工作:HBZUMB01$curl-XPOST"http://localhost:9200/contents/_search"-d'{"size":0,"aggs":{"sport_count":{"value_count":{"field":"dwid"}}}}'我收到回复:{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":90,"max_score":0.0,"hits":[]},"a

  4. c# - Ruby 等效于 C# Linq 聚合方法 - 2

    什么是Linq聚合方法的ruby​​等价物。它的工作原理是这样的varfactorial=new[]{1,2,3,4,5}.Aggregate((acc,i)=>acc*i);每次将数组序列中的值传递给lambda时,变量acc都会累积。 最佳答案 这在数学以及几乎所有编程语言中通常称为折叠。它是更普遍的变形概念的一个实例。Ruby从Smalltalk中继承了这个特性的名称,它被称为inject:into:(像aCollectioninject:aStartValueinto:aBlock一样使用。)所以,在Ruby中,它称为inj

  5. ruby - Chromedriver Devtools 端口号错误 - 2

    尝试使用capybara、selenium和chromedriver-helper运行测试时出现以下错误。使用相同版本的chromedriver,测试在mac上本地运行良好。我已经尝试在我的spec_helper中明确设置远程调试端口,但显然这被忽略了,因为chromedriver使用随机远程调试端口。Selenium::WebDriver::Error::UnknownError:unknownerror:Devtoolsportnumberfilecontentswereinanunexpectedformat(Driverinfo:chromedriver=2.40.565383

  6. ruby - 为什么 openssl 在 windows 上产生错误但在 centos 上不产生错误:PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error) - 2

    require'openssl'ifARGV.length==2pkcs12=OpenSSL::PKCS12.new(File.read(ARGV[0]),ARGV[1])ppkcs12.certificateelseputs"Usage:load_cert.rb"end运行它会在Windows上产生错误,但在Linux上不会。错误:OpenSSL::PKCS12::PKCS12Error:PKCS12_parse:macverifyfailurefrom(irb):21:ininitializefrom(irb):21:innewfrom(irb):21fromC:/Ruby192/

  7. centos 安装 最新版 skywalking 8.9.1 - 2

    一、相关网址1、官网(可以下载,查看文章)https://skywalking.apache.org/downloads/2、github地址:(可提问题寻求帮助)https://github.com/apache/skywalking二、 实验环境操作系统 centos7.9先安装好 elasticsearch7.16.2操作系统安装好jdk8-17,实验机器jdk11java下载地址:https://www.oracle.com/java/technologies/downloads/#java8IP地址为192.168.24.160三、安装skywalking 1、下载skywalkin

  8. ruby - 如何在 HTTParty 中设置端口 - 2

    我读到HTTParty使用SSLiftheportissetto443,但我不知道如何设置端口。有人可以为我澄清一下吗? 最佳答案 检查规范:https://github.com/jnunemaker/httparty/blob/82a90c1b93b076f9d2d7410123c2b5d609401a1f/spec/httparty/request_spec.rb#L41目标URL预计使用端口443。只需在目标URI末尾添加:443就足以使HTTParty使用SSL。顺便说一下,HTTPSURL也将使用SSL。例子:http:/

  9. Centos7-yum安装mysql-修改密码-无密码登录-安全配置 - 2

    目录1、yum安装mysql修改密码(1)在mysql里面修改(2)第二种方式,利用mysqladmin修改密码2、没有密码,登录mysql修改密码3、mysql的安全设置1、yum安装mysql在CentOS中默认安装有MariaDB(MySQL的一个分支),安装完成之后可以直接覆盖MariaDB。rpm-qa|grepmariadb查询是否安装了mariadbrpm-e--nodepsmariadb-libs-5.5.60-1.el7_5.x86_64卸载mariadwgethttp://dev.mysql.com/get/mysql57-community-release-el7-11.

  10. Linux操作系统CentOS7安装Nginx[详细版] - 2

    Nginx安装1.官网下载Nginx2.使用XShell和Xftp将压缩包上传到Linux虚拟机中3.解压文件nginx-1.20.2.tar.gz4.配置nginx5.启动nginx6.拓展(修改端口和常用命令)(一)修改nginx端口(二)常用命令1.官网下载Nginxhttp://nginx.org/en/download.html这里我下载的是1.20.2版本,大家按需下载对应稳定版即可2.使用XShell和Xftp将压缩包上传到Linux虚拟机中没有XShell可以参考《Linux操作系统CentOS7连接XShell》3.解压文件nginx-1.20.2.tar.gz1)检查是否存

随机推荐