Skip to content

在CentOS 6.5 设置Bonding

Published: at 00:00

在CentOS 6.5 设置Bonding

环境
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
CentOS release 6.5 (Final)

gateway 10.211.55.1
netmask 255.255.255.0
检查是否支持Bonding
cat /boot/config-2.6.32-431.el6.x86_64 | grep -i bonding
CONFIG_BONDING=m
设置ifcfg-bond0
vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE="bond0"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="10.211.55.41"
NETMASK="255.255.255.0"
GATEWAY="10.211.55.1"
USERCTL="no"
NM_CONTROLLED="no"
BONDING_OPTS="mode=6 miimon=100"
设置ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
ONBOOT="yes"
BOOTPROTO="none"
MASTER="bond0"
SLAVE="yes"
NM_CONTROLLED="no"
USERCTL="no"
TYPE="Ethernet"
设置ifcfg-eth1
vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE="eth1"
ONBOOT="yes"
BOOTPROTO="none"
MASTER="bond0"
SLAVE="yes"
NM_CONTROLLED="no"
USERCTL="no"
TYPE="Ethernet"
设置modprobe.conf
vi /etc/modprobe.d/bonding.conf

alias bond0 bonding
alias net-pf-10 off # ipv6 off
加载bonding
modprobe bonding
重启网络
service network restart
查看bonding
cat /proc/net/bonding/bond0
更改rc.local
vi /etc/rc.local

ifenslave bond0 eth0 eth1
route add default gw 10.211.55.1 netmask 255.255.255.0 bond0