1、查看主机网卡
[root@web ~]# cd /etc/sysconfig/network-scripts/
[root@web1 network-scripts]# ll
total 200
-rw-r--r--. 1 root root 212 Mar 20 22:15 ifcfg-eth0
-rw-r--r-- 1 root root 212 Mar 23 19:10 ifcfg-eth1
2、复制ifcfg-bond0
[root@web network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@web network-scripts]# ll
total 204
-rw-r--r-- 1 root root 212 Mar 23 19:12 ifcfg-bond0
-rw-r--r--. 1 root root 212 Mar 20 22:15 ifcfg-eth0
-rw-r--r-- 1 root root 212 Mar 23 19:10 ifcfg-eth1
3、编辑ifcfg-bond0、ifcfg-eth0、ifcfg-eth1
[root@web network-scripts]# vim ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=10.1.3.210
NETMASK=255.255.255.0
GATEWAY=10.1.3.254
ONBOOT=yes
USERCTL=no
[root@web1 network-scripts]# vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
[root@web1 network-scripts]# vim ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
4、模块加载
[root@web1 ~]# vim /etc/modprobe.d/dist.conf
在最后添加以下内容:
#加载bonding模块,对外虚拟网络接口设备为 bond0
options bond0 miimon=100 mode=6