1,安装bonding需要的软件

sudo apt-get install ifenslave

2,在/etc/modules中加入:

bonding mode= miimon=

3,在/etc/network/interfaces中加入:

auto bond0
iface bond0 inet static
address 10.128.1.12
netmask 255.255.255.0
gateway 10.128.1.200
post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1

#静态路由设定

up route add -host 10.128.0.1 gateway 10.128.1.254
up route add -net 10.128.3.0 mask 255.255.255.0 gateway 10.128.1.254

#重启服务器(加载模块,需重启生效)

说明:
miimon是用来进行链路监测的。比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路;mode的值表示工作模式,他共有0,1,2,3四种模式,常用的为0,1两种。
 
mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作,带宽加倍。
mode=1表示fault-tolerance (active-backup)提供冗余功能,工作方式是主备的工作方式,默认情况下只有一块网卡工作,另一块做备份。
bonding只能提供链路监测,即从主机到交换机的链路是否接通。
如果只是交换机对外的链路down掉了,而交换机本身并没有故障,那么bonding会认为链路没有问题而继续使用。

最新文章

  1. UP Board 人若有大胆,板子就很惨:首次上电开机失败
  2. 【异常】ORA-01536: space quota exceeded for tablespace
  3. 搭建java,oracle,plsql开发环境
  4. yaf框架流程四
  5. 源码分析之spring-JdbcTemplate日志打印sql语句
  6. git 删除右键菜单
  7. ARXObject的入门学习
  8. Gulp构建
  9. [原创] 绿色单文件封装程序GreenOne V3.0
  10. linux三剑客之sed命令
  11. Vue组件库的那些事儿,你都知道吗?
  12. python@wraps实现原理
  13. python的oop概述
  14. Go中iota是什么
  15. node 模块化思想中index.js的重要性
  16. 组队项目,Main队伍
  17. MongoDB修改默认数据库
  18. netcore webapi 用户 'IIS APPPOOL\无托管代码' 登录失败
  19. ng-show和ng-if的区别
  20. java第六天

热门文章

  1. faster rcnn一些博客
  2. velocity(vm)模板引擎基本语法
  3. filezilla server FTP 安装报错 "could not load TLS network. Aborting start of administration interface"
  4. Git中文书籍
  5. iOS sandbox
  6. 08私有化、MRO顺序
  7. 【design pattern】代理模式
  8. 【memcached】memcached中flags字段的作用
  9. ZOJ 2567 Trade
  10. parse XML & JSON & js