首页 > 系统服务 > 详细

linux下网卡绑定

时间:2014-09-09 10:57:48      阅读:288      评论:0      收藏:0      [点我收藏+]

网卡绑定的作用:1、冗余,防止单点故障 

        2、防止传输瓶颈

1.交换机端口绑定:

1 system-view
2 link-aggregation group 1 mode manual
3 
4 比如把端口1和2进行绑定
5 
6 interface Ethernet1/0/1                  #进入交换机1口
7 port link-aggregation group 1        #把当前端口加入汇聚组1
8 interface Ethernet1/0/2                  #进入交换机2口
9 port link-aggregation group 1        

2.系统网卡绑定

1.设置Bounding
vi /etc/modules.conf   #添加以下内容
alias bond0 bonding
options bonding mode=1 miimon=200 primary=eth2 use_carrier=1

2. 加载bonding模块
modprobe bonding

3.创建/修改bond0 eth0 eth1 配置文件
vi /et/sysconfig/network-ifcfg-“网卡名”

DEVICE=‘bond0‘
BOOTPROTO=‘static‘
BROADCAST=‘x.x.x.x‘
IPADDR=‘x.x.x.x‘

DEVICE=eth0
BOOTPROTO=‘static‘
STARTMODE=‘onboot‘

DEVICE=eth1
BOOTPROTO=‘static‘
STARTMODE=‘onboot‘

4.重启所有网卡
rcnetwork restart

5.绑定eth0 eth1 到bond0
ifenslave bond0 eth0
ifenslave bond0 eth1

6.重启后自动加载设置:

在/etc/init.d/中添加bonding启动文件
vi /etc/init.d/bonding  #添加以下语句
case “$1in
    start)
/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1
;;
        *)
;;
esac

7.把加载bonding模块的脚本加入启动脚本中

vi /etc/init.d/boot.local
modprobe bonding

 

linux下网卡绑定

原文:http://www.cnblogs.com/cpy-devops/p/3961383.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!