码迷,mamicode.com
首页 > 系统相关 > 详细

linux双网卡绑定

时间:2016-06-27 09:04:38      阅读:142      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!