网卡bond技术
[root@woo ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.10.10.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
[root@woo ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
[root@woo ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
1.在这里,我们直接创建一个加载bonding的专属设定文件/etc/modprobe.d/bonding.conf
[root@woo ~]# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding
options bonding mode=0 miimon=200
2.加载模块(重启系统后就不用手动再加载了)
[root@woo ~]# modprobe bonding
3.确认模块是否加载成功:
[root@woo ~]# lsmod | grep bonding
bonding 100065 0
[root@db01 ~]# service network restart
Shutting down interface bond0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface bond0: [ OK ]
[root@db01 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 40:f2:e9:db:c9:c2
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 40:f2:e9:db:c9:c3
[root@db01 ~]# ifconfig | grep HWaddr
bond0 Link encap:Ethernet HWaddr 40:F2:E9:DB:C9:C2
eth0 Link :Ethernet HWaddr 40:F2:E9:DB:C9:C2
eth1 Link encap:Ethernet HWaddr 40:F2:E9:DB:C9:C2
[root@woo ~]# vi /etc/rc.d/rc.local
#追加
ifenslave bond0 eth0 eth1
route add default gw 10.10.10.1
alias bond0 bonding
options bonding mode=1 miimon=200
alias bond1
options bonding mode=1 miimon=200
alias bond0 bonding
alias bond1 bonding
options bonding max_bonds=2 miimon=200 mode=1
alias bond0 bonding
options bond0 miimon=100 mode=1
install bond1 /sbin/modprobe bonding -o bond1 miimon=200 mode=0
shell脚本:
网卡名为:eth
#!/bin/bash
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-bond0
echo "options bond0 miimon=100 mode=6" >> /etc/modprobe.conf
echo "alias bond0 bonding" >> /etc/modprobe.conf
echo "ifenslave bond0 eth0 eth1" >> /etc/rc.d/rc.local
sed -i 's/^sh/#sh/g' /etc/rc.d/rc.local
# bond0
sed -i "s/HWADDR/#HWADDR/g" /etc/sysconfig/network-scripts/ifcfg-bond0
sed -i "s/eth0/bond0/g" /etc/sysconfig/network-scripts/ifcfg-bond0 # eth0
> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "# Network Connection" > /etc/sysconfig/network-scripts/ifcfg-eth0
echo "DEVICE=eth0" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "MASTER=bond0" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "SLAVE=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0 # eth1
> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "# Network Connection" > /etc/sysconfig/network-scripts/ifcfg-eth1
echo "DEVICE=eth1" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "MASTER=bond0" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "SLAVE=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth1 网卡名为:em
#!/bin/bash
cp /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/network-scripts/ifcfg-bond0
echo "options bond0 miimon=100 mode=6" >> /etc/modprobe.conf
echo "alias bond0 bonding" >> /etc/modprobe.conf
echo "ifenslave bond0 em1 em2" >> /etc/rc.d/rc.local
sed -i 's/^sh/#sh/g' /etc/rc.d/rc.local
# bond0
sed -i "s/HWADDR/#HWADDR/g" /etc/sysconfig/network-scripts/ifcfg-bond0
sed -i "s/em1/bond0/g" /etc/sysconfig/network-scripts/ifcfg-bond0 # em1
> /etc/sysconfig/network-scripts/ifcfg-em1
echo "# Network Connection" > /etc/sysconfig/network-scripts/ifcfg-em1
echo "DEVICE=em1" >> /etc/sysconfig/network-scripts/ifcfg-em1
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-em1
echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-em1
echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-em1
echo "MASTER=bond0" >> /etc/sysconfig/network-scripts/ifcfg-em1
echo "SLAVE=yes" >> /etc/sysconfig/network-scripts/ifcfg-em1 # em2
> /etc/sysconfig/network-scripts/ifcfg-em2
echo "# Network Connection" > /etc/sysconfig/network-scripts/ifcfg-em2
echo "DEVICE=em2" >> /etc/sysconfig/network-scripts/ifcfg-em2
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-em2
echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-em2
echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-em2
echo "MASTER=bond0" >> /etc/sysconfig/network-scripts/ifcfg-em2
echo "SLAVE=yes" >> /etc/sysconfig/network-scripts/ifcfg-em2
网卡bond技术的更多相关文章
- linux系统下网络主-备份策略之网卡bond技术
操作系统:CentOS Linux release 7.1.1503 (Core) 网卡适配器: eno1.eno2 bonding类型:mode=1 (active-backup),主-备份策略 网 ...
- Linux Bond 技术学习资料
Bond 技术原理 Bond 就是将多块网卡虚拟成为一块网卡的技术,通过 bond 技术让多块网卡看起来是一个单独的以太网接口设备并具有相同的 IP 地址. Bond 的原理是网卡在混杂 (promi ...
- Linux 双网卡绑定技术
bond技术是在linux2.4以后加入内核. 一般步骤是1.把bonding模块加入内核, 2 编辑要绑定的网卡设置,去除地址设定 3 添加bond设备,设置地址等配置 4 重启网络 5 在交换机 ...
- linux网络基础-网卡bonding技术
1.bondingbonding(绑定)是一种linux系统下的网卡绑定技术,可以把服务器上n个物理网卡在系统内部抽象(绑定)成一个逻辑上的网卡,实现本地网卡的冗余,带宽扩容和负载均衡.在应用部署中是 ...
- 链路聚合teaming(网卡绑定技术)2
一.sentos7网卡绑定技术之teaming 这里介绍两种最常见的双网卡绑定模式: (1) roundrobin - 轮询模式 所有链路处于负载均衡状态,这种模式的特点增加了带宽,同时支持容错能力. ...
- 实战网卡bond
一.什么是网卡bond 所谓bond,就是把多个物理网卡绑定成一个逻辑上的网卡,使用同一个IP工作,在增加带宽的同时也可以提高冗余性,一般使用较多的就是来提高冗余,分别和不同交换机相连,提高可靠性,但 ...
- 网卡也能虚拟化?网卡虚拟化技术 macvlan 详解
本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. 01 macv ...
- Linux 网卡Bond模式
网卡bond是通过把多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡. 有7种模式: mod 0/mod 1/mod 2/mod 3/mod 4/mod 5 mod=0 ,即:(ba ...
- centos7.x网卡bond配置
本文摘抄自 https://www.cnblogs.com/liwanggui/p/6807212.html centos7网卡bond配置 centos7网卡bond配置 1 备份网卡配置文件2 使 ...
随机推荐
- IdentityServer Topics(1)- 启动说明
启动 IdentityServer的启动是中间件和服务的组合来实现的. 所有配置都在你的启动类(Startup.cs)中完成. 配置服务 通过以下方式调用将IdentityServer服务添加到DI系 ...
- Spring框架学习笔记(4)——配置bean more
1.配置List属性 <!-- 配置List属性 --> <bean id="person4" class="com.broadtext.beans.c ...
- 支付宝当面付开发(java)
支付宝当面付开发(java) 业务流程: 接入准备: 直接下载demo: https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7 ...
- JAVA开发中遇到的异常总结
最常见的五种异常:必会,面试题: 算术异常类:ArithmeticExecption 空指针异常类:NullPointerException 类型强制转换异常:ClassCastException 数 ...
- 自己实现一个each迭代器
什么是迭代器? 其实就是对一个对象内部进行遍历的方法,比如jquery的each方法,或者原生js的foreach方法. 迭代器的特点 针对迭代器,这里有几个特点: ☑ 访问一个聚合对象的内容而无需暴 ...
- SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFact ...
- v-for并判断当前元素是否选中:$set实现响应添加属性
前言 一直纠结着使用v-for进行列表渲染时如何为当前的元素添加是否选中的标识. 1.v-for进行列表渲染 <div class="lists"> <ul> ...
- Spark学习笔记2(spark所需环境配置
Spark学习笔记2 配置spark所需环境 1.首先先把本地的maven的压缩包解压到本地文件夹中,安装好本地的maven客户端程序,版本没有什么要求 不需要最新版的maven客户端. 解压完成之后 ...
- 阿里云部署SSL证书详解
http://mp.weixin.qq.com/s/NV7Zad4DVEgzG2GCHYJVLw 查找中间证书 为了确保兼容到所有浏览器,我们必须在阿里云上部署中间证书,如果不部署证书,虽然安装过程可 ...
- phpmyadmin设置密码,不用登录直接进入
版权声明:本文为博主原创文章,未经博主允许不得转载. 1.config.sample.inc.PHP改为config.inc.php 2.加入或更改代码: [php] view plain copy ...