网卡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 使 ...
随机推荐
- springmvc json数据返回前台,中文乱码
@ResponseBody@RequestMapping(value = "selectProvinces",produces = "text/json;charset= ...
- IdentityServer Topics(4)- 登录
为了使IdentityServer代表用户发布令牌,该用户必须登录到IdentityServer. Cookie认证 使用来自ASP.NET Core的cookie身份验证处理程序管理的cookie跟 ...
- Echarts---柱状图实现
做Echarts很简单,可以参看官网 http://echarts.baidu.com/index.html 作为程序员我们只需要把静态数据替换成我们自己需要的! 下面看一个自己做的例子: 还是先看看 ...
- 四 : springMVC各种跳页面传值
第一种方式 : 返回值为String类型的跳转页面,犯法参数里面需要写Model modelimport org.springframework.ui.Model;包下的.返回String1):字符串 ...
- UEP-按钮控制及时间
按钮的判断 var record = ajaxgrid.getAllRecords(); if(record.length>0){ var isPack=record[0].get(" ...
- mitm6:通过IPv6攻破IPv4网络
一.前言 虽然IPv6正在互联网上逐步推广,但在内部网络环境中使用IPv6的公司依然非常稀少.然而,大多数公司并不知道,即使他们没有主动去使用IPv6,但从Windows Vista以来,所有的Win ...
- TP5使用phpmailer实现邮件发送
1.从github下载PHPMailer,在vendor目录中新建文件夹phpmailer,将压缩包中的class.phpmailer.php和class.smtp.php复制到phpmailer中, ...
- phpfpm配置 php中的坑
###### 记一些坑```//phpfpm配置pm.max_children = 最大并发数详细的答案:pm.max_children 表示 php-fpm 能启动的子进程的最大数量.因为 php- ...
- dede的pagelist标签的listsize数字属性详解
转载▼http://blog.sina.com.cn/s/blog_a4f3bd4e01012c8n.html dede的pagelist标签的listsize数字属性详解.见远seo经常用织梦搭建各 ...
- 基于VUE的九宫格抽奖功能
HTML代码: <template> <div class="luckDraw"> <title-bar :title="title&quo ...