首页 > 系统服务 > 详细

linux双网卡绑定

时间:2016-06-27 09:04:19      阅读:266      评论:0      收藏:0      [点我收藏+]

双网卡绑定

在/etc/modprobe.d/下建立bond0.conf
#vi /etc/modprobe.d/bond0.conf

输入下面内容
alias bond0 bonding
options bond0 miimon=100 mode=1

建立channel bonding interface
#vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
BOOTPROTO=none
IPADDR=172.16.251.171
NETMASK=255.255.255.128
GATEWAY=172.16.251.1
DNS1=172.16.251.200
ONBOOT=yes
USERCTL=no
ARPCHECK=no

修改网卡eth0配置
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
输入下面内容
DEVICE="eth0"
BOOTPROTO=none
#ONBOOT="no"
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

修改网卡eth1配置
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
BOOTPROTO=none
#ONBOOT="no"
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

添加bond0模块
modprobe bonding


#ifconfig bond0 down

配置miimon
#echo 100 > /sys/class/net/bond0/bonding/miimon

配置mode
#echo 1 > /sys/class/net/bond0/bonding/mode

#ifconfig bond0 up

#vi /etc/rc.d/rc.local
加入下列:
modprobe bonding miimon=100 mode=1 primary=eth0
ifenslave bond0 eth0 eth1

#chkconfig NetworkManager off
#service NetworkManager stop
#chkconfig network
#service network restart

#/etc/rc.d/init.d/network restart

linux双网卡绑定

原文:http://www.cnblogs.com/immortality/p/5619096.html

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