百度空间 | 百度首页 
 
查看文章
 
CentOS双网卡绑定
2008/01/29 16:03

eth0 ----\

             --绑定--> bond0

eth1 ----/

配置文件目录:

# cd /etc/sysconfig/network-scripts/

1、配置bond0

# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=bond0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
TYPE=Ethernet

2、配置eth0

# ifcfg-eth0
# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
ONBOOT=yes

3、配置eth1

# ifcfg-eth1
# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
ONBOOT=yes

4、开机引导

# /etc/modprobe.conf

加入:

alias bond0 bonding

options bond0 miimon=100 mode=0

注意:

miimon 用来进行链路检测,单位:毫秒

mode可以为0, 1;0为负载均衡,1为失效保护

# vi /etc/rc.d/rc.local

加入:

ifenslave bond0 eth0 eth1
route add -net 192.168.1.0 netmask 255.255.255.0 bond0
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.1 bond0

# reboot

# cat /proc/net/bonding/bond0

搞定,Good luck!!!


类别:技术积累 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu