|
|
(本机需求两块网卡:eth0、eth1)
1.首先查看系统内核是否支持bonding这个模块:(双网卡绑定用到的技术是bonding)
[iyunv@bogon ~]# cat /boot/config-2.6.18-92.el5 |grep BONDING
CONFIG_BONDING=m
说明支持bonding;
查看bonding这个模块有没有起来:
root@bogon ~]# lsmod |grep bonding
bonding 81197 0
(如果没有起来用命令:[iyunv@bogon ~]# modprobe bonding启动模块)
2.关闭防火墙的规则:
[iyunv@bogon ~]# iptables -F
[iyunv@bogon ~]# iptables -X
[iyunv@bogon ~]# /etc/init.d/iptables save
[iyunv@bogon ~]# setenforce 0
3.配置物理网卡eth0:
vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
4.配置物理网卡eth1:
vim ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
5.配置bond0:
vim ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.18.120
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=192.168.18.1
DNS1=192.168.18.254
6.给bond0设置配置文件:
vim /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=50 mode=1(1模式是rr算法模式一一,0模式是一个工作一个备份)
7.重启网络:service network restart
8.查看bonding信息:
cat /proc/net/bonding/bond0
|
|
|
|
|
|
|
|