由于做LVS不能分发到多核,所以用网卡绑定来实现这一点,下面我是我做的用三块网卡绑定的试验

1、修改网卡配置文件

[root@nfs1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth0

ERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

BOOTPROTO=none

[root@nfs1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth1

ERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

BOOTPROTO=none

[root@nfs1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth2

ERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

BOOTPROTO=none

2.编辑虚拟网络接口配置文件,指定网卡IP

[root@nfs1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0 

DEVICE=bond0

BOOTPROTO=static

ONBOOT=yes

IPADDR=172.28.28.225

NETMASK=255.255.255.0

GATEWAY=172.28.28.183

3.编辑/etc/modprobe.conf添加内容如下

alias bond0 bonding

options bond0 miimon=100 mode=0

注: 
(1)、miimon 是链路监测的时间间隔单位是毫秒,miimon=100的意思就是,每100毫秒检测网卡和交换机之间是否连通,如不通则使用另外的链路。 
(2)、mode=0 表示负载均衡方式,两块网卡都工作,需要交换机作支持。 
       mode=1 表示冗余方式,网卡只有一个工作,一个出问题启用另外的。 
       mode=6 表示负载均衡方式,两块网卡都工作,不需要交换机作支持。

4.重启网卡测试是否OK,

[root@nfs1 ~]# service network restart

Shutting down interface bond0:  [  OK  ]

Shutting down loopback interface:  [  OK  ]

Bringing up loopback interface:  [  OK  ]

Bringing up interface bond0:  [  OK  ]