一.首先关掉网卡管理:
[root@mail ~]# service NetworkManager stop
停止 NetworkManager 守护进程: [确定]
[root@mail ~]# service network stop
正在关闭接口 eth0: [确定]
关闭环回接口: [确定]
[root@mail ~]# chkconfig NetworkManager on
二.建立配置文件
[root@mail modprobe.d]# touch /etc/modprobe.d/bonding.conf
[root@mail modprobe.d]# vim /etc/modprobe.d/bonding.conf
alias bond0 bonding
三.配置网卡
[root@mail network-scripts]# vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
[root@mail network-scripts]# cp -p ifcfg-eth0 ifcfg-bond0 //我这是测试环境所以就建立临时
[root@mail network-scripts]# vim ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
IPADDR=192.168.0.10
PREFIX=24
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="mode=1 miimon=50"
注:模式0:平衡轮询
模式1:主动备份
模式3:广播,容错
四.加载bond驱动启动服务
[root@mail network-scripts]# modprobe bonding
[root@mail network-scripts]# service network restart
正在关闭接口 bond0: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 bond0: [确定]
五.检查
ifconfig
bond0 Link encap:Ethernet HWaddr 00:18:8B:8D:D6:07
inet addr:192.168.5.88 Bcast:192.168.5.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe8d:d607/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:24448 errors:0 dropped:0 overruns:0 frame:0
TX packets:353 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1697415 (1.6 MiB) TX bytes:51100 (49.9 KiB)
eth0 Link encap:Ethernet HWaddr 00:18:8B:8D:D6:07
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:13320 errors:0 dropped:0 overruns:0 frame:0
TX packets:168 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:982133 (959.1 KiB) TX bytes:24306 (23.7 KiB)
Interrupt:19
转载于:https://blog.51cto.com/jiagd/1068152