CentOS 7 bonding模式双网卡绑定
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模式双网卡绑定的更多相关文章
- centos 6.4系统双网卡绑定配置详解
Linux双网卡绑定实现就是使用两块网卡虚拟成为一块网卡(需要交换机支持),这个聚合起来的设备看起来是一个单独的以太网接口设备,通俗点讲就是两块网卡具有相同的IP地址而并行链接聚合成一个逻辑链路工作. ...
- CentOS 6.9下双网卡绑定单个IP地址及装网卡绑定到一个网桥(转)
说明:经过查阅,原来双网卡绑定一个IP的专业名词叫做bond,可以实现负载均衡:如果想要实现两张网卡绑定到一个网桥,基本思路是两张网卡设置同一个网桥是行不通的,但如果先实现bond,然后将bond绑定 ...
- Linux配置bond模式 双网卡绑定步骤
什么是bond 网卡bond是通过多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡,在生产场景中是一种常用的技术.Kernels 2.4.12及以后的版本均供bonding模块,以前 ...
- Linux下双网卡绑定(bonding技术)
Linux网卡绑定探析 2013-08-20 15:39:31 现在很多服务器都自带双千兆网口,利用网卡绑定既能增加网络带宽,同时又能做相应的冗余,目前应用于很多的场景.linux操作系统下自带的 ...
- Centos 7.6 双网卡绑定实现高可用
Centos 7.6 双网卡绑定实现高可用 作者:尹正杰 版权声明:原创作品, 谢绝转载!否则将追究法律责任. 一.Bond模式概述 当linux系统上有多个单独网卡,又想充分利用这些网卡,同时对外提 ...
- CentOS 6.X 双网卡绑定配置
相关环境 主机:Dell PowerEdge R720服务器(背板有4个GE网口) 操作系统:CentOS(RHEL)6.X 网线连接 使用6类网线 将Dell R720 GE网口 0,与交换机A相连 ...
- (转)深度分析Linux下双网卡绑定七种模式
现在一般的企业都会 使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在 网卡产商也会出一些针对window ...
- 深度分析Linux下双网卡绑定七种模式
现在一般的企业都会使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在网卡产商也会出一些针对windows操 ...
- Centos 7.2 双网卡绑定之踩坑
线上服务器,安装centos7.2 x64最小化安装,需要做链路聚合,双网卡绑定.在centos 6.x 和 centos 7上测试都OK,于是直接开搞. 说明下,以下环境是在虚拟机中实现的: 系统: ...
随机推荐
- Spring RestTemplate GET 请求参数
@Test public void testUpdateProfitJson_GET_Params() throws BusinessException { String apiURL="U ...
- Java面向对象_常用类库api——对象比较器
概念:对两个或多个数据项进行比较,以确定他们是否相等,或确定他们之间的大小关系及排列顺序成为比较. 1.Comparable接口: 此接口强行对实现它的每个类的对象进行整体排序.这种排序被称为类的自然 ...
- Spark Mllib里的如何对两组数据用斯皮尔曼计算相关系数
不多说,直接上干货! import org.apache.spark.mllib.stat.Statistics 具体,见 Spark Mllib机器学习实战的第4章 Mllib基本数据类型和Mlli ...
- Docker最全教程之使用PHP搭建个人博客站点(二十二)
目录 官方镜像 编写简单的Hello world! 1. 编写Hello world! 2. 编写Dockerfile 3. 构建并运行 4. 直接使用PHP Docker镜像运行PHP脚本 构建自 ...
- Linux下安装JDK及相关配置
1.官网下载JDK:选择Linux压缩包进行下载 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...
- 数据库(DBUtils)
DBUtils和连接池 今日内容介绍 u DBUtils u 连接池 第1章 DBUtils 如果只使用JDBC进行开发,我们会发现冗余代码过多,为了简化JDBC开发,本案例我们讲采用apache c ...
- Django组件:用户认证组件
一丶用户认证 1.auth模块 from django.contrib import auth django.contrib.auth中提供了许多方法,这里主要介绍其中的三个: (1).authent ...
- 定时器new Timer().schedule()的使用
Timer是一种工具,线程用其安排以后在后台线程中执行的任务.可安排任务执行一次,或者定期重复执行.实际上是个线程,定时调度所拥有的TimerTasks. TimerTask是一个抽象类,它的子类由 ...
- HDU3973 线段树 + 字符哈希
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3973 , 线段树 + 字符哈希,好题. 又学了一种新的哈希方法,hhhh~ 解法: 想法是用P进制的数 ...
- c++ vector & 二维数组 & MessageBox
vector: https://www.cnblogs.com/mr-wid/archive/2013/01/22/2871105.html c++ 二维数组: int **p; p = new in ...