CentOS中创建和删除Bond详细步骤

这篇具有很好参考价值的文章主要介绍了CentOS中创建和删除Bond详细步骤。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、创建Bond

1、查看网卡信息

[root@localhost ~]# ip a
[root@localhost ~]# nmcli connection show
ens6f0   0e3be75a-2638-4b05-97a0-89adaddb13c2  ethernet  ens6f0  
ens14f0  9ce46d12-fd50-380d-5160-a27902128ed5  ethernet  ens14f0 
ens14f1  f424bed9-9599-6487-9d60-f0d6f1698c64  ethernet  ens14f1 
ens4f0   11d1d159-e438-bc38-bba2-411145f244b4  ethernet  ens4f0  
ens4f1   f540b644-ada1-a879-c4aa-2566c44f1e74  ethernet  ens4f1       

2、设置bond

[root@localhost ~]# nmcli connection add con-name bond0 ifname bond0 type bond mode 4
[root@localhost ~]# nmcli connection show

3、将网卡绑定bond

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens4f0
TYPE=Ethernet
#PROXY_METHOD=none
#NM_CONTROLLED=no
#EFROUTE=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
NAME=ens4f0
DEVICE=ens4f0
ONBOOT=yes
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens4f1
TYPE=Ethernet
#PROXY_METHOD=none
#NM_CONTROLLED=no
#EFROUTE=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
NAME=ens4f1
DEVICE=ens4f1
ONBOOT=yes

4、手动创建bonding.conf配置文件,并将其加入系统启动项
此步骤一定要操作,否则bond创建完成后不一会就自动消失了!

[root@localhost ~]# vim /etc/modprobe.d/bonding.conf
alias bond0 bonding
options bond0 mode=4 miimon=200
[root@localhost ~]# sed -i '$a \ifenslave bond0 ens4f0 ens4f1' /etc/rc.d/rc.local 
[root@localhost ~]# cat /etc/rc.d/rc.local 

5、重启网络服务,加载bond信息

[root@localhost ~]# systemctl restart network
[root@localhost ~]# modprobe bonding

6、查看bond中的网卡

[root@localhost ~]# cat /sys/class/net/bond0/bonding/slaves
ens4f0 ens4f1

7、查看bond网卡配置和bond信息

[root@localhost ~]# nmcli connection show
ens6f0   0e3be75a-2638-4b05-97a0-89adaddb13c2  ethernet  ens6f0  
bond0    eb6e1a3c-ddbe-4abc-8e3a-cb9118fcabfb  bond      bond0    
ens14f0  9ce46d12-fd50-380d-5160-a27902128ed5  ethernet  ens14f0 
ens14f1  f424bed9-9599-6487-9d60-f0d6f1698c64  ethernet  ens14f1 
ens4f0   11d1d159-e438-bc38-bba2-411145f244b4  ethernet  ens4f0  
ens4f1   f540b644-ada1-a879-c4aa-2566c44f1e74  ethernet  ens4f1      

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS=mode=802.3ad
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
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=bond0
UUID=eb6e1a3c-ddbe-4abc-8e3a-cb9118fcabfb
DEVICE=bond0
ONBOOT=yes


[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: e8:eb:d3:21:a8:78
Active Aggregator Info:
	Aggregator ID: 1
	Number of ports: 4
	Actor Key: 21
	Partner Key: 1
	Partner Mac Address: 64:2f:c7:55:2b:c2

Slave Interface: ens4f0
MII Status: up
Speed: 25000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e8:eb:d3:21:a8:78
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: e8:eb:d3:21:a8:78
    port key: 21
    port priority: 255
    port number: 1
    port state: 61
details partner lacp pdu:
    system priority: 32768
    system mac address: 64:2f:c7:55:2b:c2
    oper key: 1
    port priority: 32768
    port number: 3
    port state: 61

Slave Interface: ens4f1
MII Status: up
Speed: 25000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e8:eb:d3:21:a8:79
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: e8:eb:d3:21:a8:78
    port key: 21
    port priority: 255
    port number: 2
    port state: 61
details partner lacp pdu:
    system priority: 32768
    system mac address: 64:2f:c7:55:2b:c2
    oper key: 1
    port priority: 32768
    port number: 4
    port state: 61

二、删除Bond

1、将网卡从bond中删除

[root@localhost ~]# cat /sys/class/net/bond0/bonding/slaves
ens4f0 ens4f1
[root@localhost ~]# echo -ens4f0 >  /sys/class/net/bond0/bonding/slaves
[root@localhost ~]# echo -ens4f1 >  /sys/class/net/bond0/bonding/slaves
[root@localhost ~]# cat /sys/class/net/bond0/bonding/slaves

2、将bonding从系统启动项中删除

[root@localhost ~]# vim /etc/rc.d/rc.local 

3、删除bonding.conf配置文件

[root@localhost ~]# rm -rf /etc/modprobe.d/bonding.conf

4、删除bond文章来源地址https://www.toymoban.com/news/detail-522511.html

[root@localhost ~]# ls /sys/class/net/
bond0  bonding_masters  ens14f0  ens14f1  ens6f0   lo  usb0  virbr0  virbr0-nic
注意:这里无法直接删除bond0配置文件和打开bonding_masters文件进行编辑,只能采用下述方式进行删除。
[root@localhost ~]# echo -bond0 >/sys/class/net/bonding_masters
[root@localhost ~]# rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0
[root@localhost ~]# systemctl restart network

到了这里,关于CentOS中创建和删除Bond详细步骤的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【Linux】网卡的7种bond模式

    一、bond模式 Mode=0(balance-rr) 表示负载分担round-robin,和交换机的聚合强制不协商的方式配合 Mode=1(active-backup) 表示主备模式,只有一块网卡是active,另外一块是备的standby,这时如果交换机配的是捆绑,将不能正常工作,因为交换机往两块网卡发包,有一半包是丢弃的 Mode=2(bala

    2024年01月21日
    浏览(23)
  • 银河麒麟服务器操作系统配置bond

    一、bond介绍 多块网卡虚拟成一块网卡,实现冗余,多张网卡对外显示一张,具有同一个IP,网络配置都会使用Bonding技术做网口硬件层的冗余,防止单个网口应用的单点故障。对于多张物理网卡而言,其中一块物理网卡会被设置成Master,其他的网卡都是Slave,Bond网卡的MAC地址

    2024年02月04日
    浏览(41)
  • 网卡聚合(bond)模式简介及交换机侧配置

    网卡绑定mode共有七种(0~6) : bond0、bond1、bond2、bond3、bond4、bond5、bond6 第一种模式:mode=0 ,即:(balance-rr) Round-robin policy(平衡抡循环策略,需要配置交换机静态聚合) 第二种模式:mode=1,即: (active-backup) Active-backup policy(主-备份策略) 第三种模式:mode=2,即:(balance-xor)

    2024年02月08日
    浏览(36)
  • 银河麒麟服务器操作系统配置bond1

    1、查看当前系统网卡信息:在终端输入:ifconfig,可以看到当前系统存在ens33、ens37两块网卡 2、创建bond虚拟网卡,命令如下: 3、为bond网卡添加成员(真实网卡),命令: 添加完成之后,命令:nmcli connect 查询新添加的附属网卡是否启用,如未启用,需要用命令进行启用 4、

    2024年02月06日
    浏览(86)
  • 交换机链路聚合以及对应服务器的BOND模式

    交换机链路聚合分为两类,手工模式和LACP模式,其中LACP模式又包含静态/动态LACP两种形式,最大支持8个端口链路聚合。         手工模式(manual)又被称作静态模式,在不支持LACP功能的交换机上可以使用手工模式进行链路聚合,增加链路带宽。手工模式的特点如下: 不需

    2024年02月04日
    浏览(33)
  • centos安装docker详细步骤

    目录 一.前言 1.环境要求 2.官网中文安装参考手册 二.安装步骤 1.卸载旧版本 2.安装需要的软件包 3.设置docker镜像源 1.配置docker镜像源 方式1:官网地址(外国): 方式2:阿里云源: 2.查看配置是否成功 4.更新yum软件包索引 5.可以查看所有仓库中所有docker版本 6、安装docker 7、启

    2024年03月27日
    浏览(36)
  • Centos安装Docker详细步骤,Debian安装Docker详细步骤

    Linux 安装Docker指令 更新系统: 安装依赖包,以便使用 HTTPS 连接下载 Docker 软件包: 添加 Docker 软件源: 安装 Docker: 启动 Docker 服务: 验证 Docker 是否成功安装: 如果一切正常,你将看到一个提示消息,表明 Docker 安装成功并且正在运行。 如果你希望当前用户拥有使用 Doc

    2024年02月04日
    浏览(31)
  • Centos7的安装步骤【详细】

    centos7下载地址:http://mirrors.aliyun.com/centos/7/isos/x86_64/ 1、打开虚拟机,点击主页,创建新的虚拟机 2、使用典型和自定义都行,这里我选的是自定义,点击下一步 3、点击下一步 3、这里选择稍后安装操作系统 4、点击下一步 5、给虚拟机命名,然后在电脑上为这个虚拟机创建一

    2024年02月14日
    浏览(28)
  • Centos7的详细安装步骤

    虚拟机环境: VMWare15.5Pro 官网地址: https://www.vmware.com/cn.html 安装的过程中需要序列码,百度搜索VMware序列码多得很。例如: https://www.win7zhijia.cn/win10jc/win10_44991.html 镜像:Centos7 阿里云Centos7镜像下载地址: https://developer.aliyun.com/mirror/ 打开地址后,选择屏幕中间的OS镜像进行选

    2024年02月05日
    浏览(45)
  • Centos7安装Mysql详细步骤

      本文主要介绍如何在Centos7下安装Mysql。 一、下载Mysql 使用wget命令下载mysql安装包。确保系统已经安装了wget,如果没有安装,执行 yum install wget 安装。 wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 二、安装、启动Mysql服务 1.安装mysql(rpm可以看成一个压缩包,先安

    2024年02月16日
    浏览(28)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包