网卡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 使 ...
随机推荐
- mysql数据库快速入门(1)
1.数据库操作 1.1.连接mysql服务器 mysql -u root( 用户名 ) -p 1.2.退出mysql命令提示窗 exit 1.3.查看版本 SELECT VERSION(); 1.4. ...
- Inception服务的安装以及使用Python 3 实现MySQL的审计
Inception服务的安装以及使用Python实现MySQL的审计 Bison是Inception服务所依赖的包之一,但是某些Linux版本已安装的Bison,或者是通过yum安装的Bison,通常 ...
- PostgreSQL=>递归查询
PostgreSQL=>递归查询 转载请注明源地址:http://www.cnblogs.com/funnyzpc/p/8232073.html 距上次博客更新刚好两周,这两周发生了很多,比如: ...
- burpsuite截断上传webshell
1.先设置好代理127.0.0.1 8080 2.开启截断模式 3.上传文件会被burp截断 4.在hex下找到你上传的webshell的16进制编码 5.把.后面的源码改为00 点击forward上 ...
- 实例讲解基于 React+Redux 的前端开发流程
原文地址:https://segmentfault.com/a/1190000005356568 前言:在当下的前端界,react 和 redux 发展得如火如荼,react 在 github 的 s ...
- bfs学习
今天做到了bfs的练习,顺便写下心得... bfs能解决搜索和最短路径的问题. 下面是学习心得: typedef struct point //定义点 { int x; int y; }P; bfs( ...
- jquery dataTimePicker日历插件(精确到小时)
效果图: 下载地址:https://github.com/WangChangyao/jquery-dataTimePicker.git <!DOCTYPE html> <h ...
- input[type=file]样式更改以及图片上传预览
以前知道input[type=file]可以上传文件,但是没用过,今天初次用,总感觉默认样式怪怪的,想修改一下,于是折腾了半天,总算是小有收获. 以上是默认样式,这里我想小小的修改下: HTML代码如 ...
- Oracle_SQL99_连接查询
Oracle_SQL99_连接查询 交叉连接 cross join --交叉连接 cross join --作用:产生两个表的笛卡尔积 select * from emp cross join d ...
- 十二个 ASP.NET Core 例子——配置操作
目录: 简单配置(利用configration 键值读取) 使用选项和配置对象(自定义类绑定配置文件实现读取) IOptionsSnapshot(配置文件更改时也变化) 内存数据放到配置对象中 实体框 ...