ubuntu双网卡绑定配置
2024-08-26 08:09:28
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会认为链路没有问题而继续使用。
最新文章
- UP Board 人若有大胆,板子就很惨:首次上电开机失败
- 【异常】ORA-01536: space quota exceeded for tablespace
- 搭建java,oracle,plsql开发环境
- yaf框架流程四
- 源码分析之spring-JdbcTemplate日志打印sql语句
- git 删除右键菜单
- ARXObject的入门学习
- Gulp构建
- [原创] 绿色单文件封装程序GreenOne V3.0
- linux三剑客之sed命令
- Vue组件库的那些事儿,你都知道吗?
- python@wraps实现原理
- python的oop概述
- Go中iota是什么
- node 模块化思想中index.js的重要性
- 组队项目,Main队伍
- MongoDB修改默认数据库
- netcore webapi 用户 'IIS APPPOOL\无托管代码' 登录失败
- ng-show和ng-if的区别
- java第六天
热门文章
- faster rcnn一些博客
- velocity(vm)模板引擎基本语法
- filezilla server FTP 安装报错 ";could not load TLS network. Aborting start of administration interface";
- Git中文书籍
- iOS sandbox
- 08私有化、MRO顺序
- 【design pattern】代理模式
- 【memcached】memcached中flags字段的作用
- ZOJ 2567 Trade
- parse XML &; JSON &; js