1.1    查看系统内核是否支持bonding

[root@cobbler-node1 ~]# cat /boot/config-3.10.0-693.el7.x86_64 | grep -i bonding
CONFIG_BONDING=m

1.2    备份系统自带的网卡配置文件,以及创建bond0网卡配置文件

[root@cobbler-node1 ~]# cd /etc/sysconfig/network-scripts
[root@cobbler-node1 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@cobbler-node1 network-scripts]# cp -a ifcfg-eth0 ifcfg-eth0.bak
[root@cobbler-node1 network-scripts]# cp -a ifcfg-eth1 ifcfg-eth1.bak
[root@cobbler-node1 network-scripts]# cp -a ifcfg-eth0.bak ifcfg-bond0

1.3修改系统eth0、eth1、bond0网卡配置文件

[root@cobbler-node1 network-scripts]# vi ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
DEVICE=eth0
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@cobbler-node1 network-scripts]# vi ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
DEVICE=eth1
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@cobbler-node1 network-scripts]# vi ifcfg-bond0
TYPE=Bond
BOOTPROTO=none
DEVICE=bond0
ONBOOT=yes
IPADDR=10.129.49.240
NETMASK=255.255.255.0
GATEWAY=10.129.49.1
DNS1=10.112.15.30
DNS2=10.112.15.33
USERCTL=no

1.4    将eth0、eth1网卡配置文件合并显示

[root@cobbler-node1 network-scripts]# paste ifcfg-eth0 ifcfg-eth1
TYPE=Ethernet TYPE=Ethernet
BOOTPROTO=none BOOTPROTO=none
DEVICE=eth0 DEVICE=eth1
ONBOOT=yes ONBOOT=yes
USERCTL=no USERCTL=no #控制用户是否有修改网卡的权限,必须设置为no,只有root用户才可以修改
MASTER=bond0 MASTER=bond0
SLAVE=yes SLAVE=yes

1.5    对比eth0、eth1网卡配置文件不同内容

[root@cobbler-node1 network-scripts]# diff ifcfg-eth0 ifcfg-eth1
3c3
< DEVICE=eth0
---
> DEVICE=eth1

1.6    在/etc/modprobe.d/目录下创建bonding.conf(网卡绑定模式)配置文件

[root@cobbler-node1 network-scripts]# echo -e "alias bond0 bonding\noptions bond0 mode=6 miimon=100" >> /etc/modprobe.d/bonding.conf
[root@cobbler-node1 network-scripts]# cat /etc/modprobe.d/bonding.conf
alias bond0 bonding
options bond0 mode=6 miimon=100
注意:
#mode=6代表负载均衡;两块网卡同时工作,增加网络带宽,不需要依赖物理交换机设置
#mode=1代表主备切换;只有一块网卡处于活动状态,活动网卡故障切换到备用网卡
#miimon=100代表网络链路检测频率100ms检查一次,如果出现问题则切换到备用网卡

1.7    执行modprobe bonding命令更新加载bonding模块,使其系统支持网卡bonding

[root@cobbler-node1 network-scripts]# modprobe bonding
#验证bonding模块是否加载成功,出现如下结果则证明加载成功
[root@cobbler-node1 network-scripts]# lsmod | grep bonding
bonding 145728 0

1.8    重启系统网络服务

[root@cobbler-node1 network-scripts]# systemctl restart network

1.9    查看网卡绑定的模式以及绑定的网卡状态信息

[root@cobbler-node1 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0 Slave Interface: eth0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 28:6e:d4:88:ce:5d
Slave queue ID: 0 Slave Interface: eth1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 28:6e:d4:88:ce:5e
Slave queue ID: 0

1.10    查看系统网络信息,验证绑定成功

[root@cobbler-node1 network-scripts]# ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.129.49.240 netmask 255.255.255.0 broadcast 10.129.49.255
inet6 fe80::2a6e:d4ff:fe88:ce5d prefixlen 64 scopeid 0x20<link>
ether 28:6e:d4:88:ce:5d txqueuelen 1000 (Ethernet)
RX packets 1675775 bytes 126050576 (120.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3432 bytes 496778 (485.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 28:6e:d4:88:ce:5d txqueuelen 1000 (Ethernet)
RX packets 837774 bytes 63015040 (60.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1718 bytes 237790 (232.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 28:6e:d4:88:ce:5d txqueuelen 1000 (Ethernet)
RX packets 838224 bytes 63053418 (60.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1714 bytes 258988 (252.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 8 bytes 584 (584.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 584 (584.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

CentOS 7 bonding模式双网卡绑定的更多相关文章

  1. centos 6.4系统双网卡绑定配置详解

    Linux双网卡绑定实现就是使用两块网卡虚拟成为一块网卡(需要交换机支持),这个聚合起来的设备看起来是一个单独的以太网接口设备,通俗点讲就是两块网卡具有相同的IP地址而并行链接聚合成一个逻辑链路工作. ...

  2. CentOS 6.9下双网卡绑定单个IP地址及装网卡绑定到一个网桥(转)

    说明:经过查阅,原来双网卡绑定一个IP的专业名词叫做bond,可以实现负载均衡:如果想要实现两张网卡绑定到一个网桥,基本思路是两张网卡设置同一个网桥是行不通的,但如果先实现bond,然后将bond绑定 ...

  3. Linux配置bond模式 双网卡绑定步骤

    什么是bond 网卡bond是通过多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡,在生产场景中是一种常用的技术.Kernels 2.4.12及以后的版本均供bonding模块,以前 ...

  4. Linux下双网卡绑定(bonding技术)

    Linux网卡绑定探析   2013-08-20 15:39:31 现在很多服务器都自带双千兆网口,利用网卡绑定既能增加网络带宽,同时又能做相应的冗余,目前应用于很多的场景.linux操作系统下自带的 ...

  5. Centos 7.6 双网卡绑定实现高可用

    Centos 7.6 双网卡绑定实现高可用 作者:尹正杰 版权声明:原创作品, 谢绝转载!否则将追究法律责任. 一.Bond模式概述 当linux系统上有多个单独网卡,又想充分利用这些网卡,同时对外提 ...

  6. CentOS 6.X 双网卡绑定配置

    相关环境 主机:Dell PowerEdge R720服务器(背板有4个GE网口) 操作系统:CentOS(RHEL)6.X 网线连接 使用6类网线 将Dell R720 GE网口 0,与交换机A相连 ...

  7. (转)深度分析Linux下双网卡绑定七种模式

    现在一般的企业都会 使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在 网卡产商也会出一些针对window ...

  8. 深度分析Linux下双网卡绑定七种模式

    现在一般的企业都会使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在网卡产商也会出一些针对windows操 ...

  9. Centos 7.2 双网卡绑定之踩坑

    线上服务器,安装centos7.2 x64最小化安装,需要做链路聚合,双网卡绑定.在centos 6.x 和 centos 7上测试都OK,于是直接开搞. 说明下,以下环境是在虚拟机中实现的: 系统: ...

随机推荐

  1. lazy load的一些网址

    http://www.gayadesign.com/scripts/queryLoader/ http://www.oschina.net/p/queryloader http://www.cnblo ...

  2. 《从0到1学习Flink》—— Flink Data transformation(转换)

    前言 在第一篇介绍 Flink 的文章 <<从0到1学习Flink>-- Apache Flink 介绍> 中就说过 Flink 程序的结构 Flink 应用程序结构就是如上图 ...

  3. windows用一键安装包安装(推荐)

    为了简化大家在windows下面的安装,我们在xampp基础上做了禅道的windows一键安装包.xampp是业内非常著名的AMP集成运行环境.禅道的一键安装包主要在它基础上做了大量的精简,并集成了我 ...

  4. 精心收集的SSH框架的面试题汇总

    Hibernate工作原理及为什么要用? 原理: 1. 读取并解析配置文件 2. 读取并解析映射信息,创建SessionFactory 3. 打开Sesssion 4. 创建事务Transation ...

  5. C# 的两种debug 方法

    第一种:需要把调试方法改成debug代码用 #if DEBUG 包裹 using System; using System.Collections.Generic; using System.Text ...

  6. 运用CSS3媒体查询判断iPhoneX、iPhoneXR、iPhoneXS MAX及横竖屏

    //iphoneX.iphoneXs @media only screen and (device-width: 375px) and (device-height: 812px) and (-web ...

  7. 零基础逆向工程31_Win32_05_提取图标_修改标题

    在程序中使用图标 1.加载图标 HICON hIcon; hIcon = LoadIcon (hAppInstance, MAKEINTRESOURCE (IDI_ICON)); hAppInstan ...

  8. hihoCoder #1044 : 状态压缩·一 (清垃圾)

    题意: 某车厢有一列座位,共有n个位置,清洁工要在这n个位置上清垃圾,但是不能全部位置都清理,只能选择部分.选择的规则是,连续的m个位置内,不能够清理超过q个,也就是说从第1~m个位置最多可以清q个, ...

  9. pc-要实现相隔一定时间数据排序变化一次

    有时候产品会有这种要求,就是展示的数据三天是正序的,一天是逆序的,解决是: 以某一个时间点为基准点,然后获取当前的时间,然后计算差值,分情况 //专利 JPView : function(Sorder ...

  10. iOS开发资料

    https://github.com/XCGit/awesome-objc-frameworks https://github.com/KevinHM/ios-good-practices-the-l ...