网卡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 使 ...
随机推荐
- Python selenium自动化网页抓取器
(开开心心每一天~ ---虫瘾师) 直接入正题---Python selenium自动控制浏览器对网页的数据进行抓取,其中包含按钮点击.跳转页面.搜索框的输入.页面的价值数据存储.mongodb自动i ...
- 常见查找算法之php, js,python版
常用算法 >>>1. 顺序查找, 也叫线性查找, 它从第一个记录开始, 挨个进行对比, 是最基本的查找技术 javaScript 版顺序查找算法: // 顺序查找(线性查找) 只做找 ...
- Open Judge 2750 鸡兔同笼
2750:鸡兔同笼 ...
- HDU 2602 Bone Collector(01背包裸题)
Bone Collector Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- B. Secret Combination
B. Secret Combination time limit per test 2 seconds memory limit per test 256 megabytes input standa ...
- Centos7环境搭建lnmp环境
[原创]编译安装lnmp环境 准备软件:nginx1.10.3+php-5.5.12+mariadb10.0.8(数据库在此使用的yum安装) 如果需要编译安装的可以给我留言,我后续再发布出来! 依赖 ...
- css之隐藏内容的方法
css隐藏内容的方法有三种:即display:none.visibility:hidden.overflow:hidden. 1.display:none;的缺陷: 搜索引擎可能认为被隐藏的文字属于垃 ...
- Linux 离线安装Rubygems详解
很多时候我们会发现,真实的生成环境很多都没有外网,只有内网环境,这个时候我们又需要安装RubyGems,则不能提供yum命令进行在线安装了,这个时候我们就需要下载安装包进行离线安装.本文主要简单介绍如 ...
- Hibernate查询对象的方法浅析
Hibernate 查询对象是根据对象的id查询的,只要你有id (id唯一),则无论你是否其他字段与传过来的对象一致,都会查到该id在数据库对应的对象.若是在关联查询中,所关联表的id为空,即所查表 ...
- 分享给有需要的你,精选了10套web开发免费视频教程~~
在这里给大家精选百度传课里的一些比较好的视频教程,比较适合新手们,有需要的可以收藏着学习!! 蓝鸥微信小程序全方位深度解析 链接:http://www.chuanke.com/v4702151-19 ...