ITPub博客

首页 > IT基础架构 > 网络安全 > redhat5.4 双网卡 bonding

redhat5.4 双网卡 bonding

原创 网络安全 作者:wmlm 时间:2011-09-30 08:50:32 0 删除 编辑

刚做完一个DG环境,其中要求服务器的两块网卡做成一主一备,对网卡绑定的操作过程如下

红帽子5.4默认已经加载bonding驱动

登录主机 10.20.2.21

一.配置bond0
# cd /etc/sysconfig/network-scripts/
# cp ifcfg-bond0 bak_ifcfg-bond0
# vi /etc/sysconfig/network-scripts/ifcfg-bond0

[@more@]

将第一行改成 DEVICE=bond0
# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=10.20.2.21
NETMASK=255.255.255.0
GATEWAY=10.20.2.254
ONBOOT=yes
TYPE=Ethernet

二 配置eth0
# cp ifcfg-eth0 bak_ifcfg-eth0
# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0 #如果不写,则必须做第五步
SLAVE=yes #如果不写,则必须做第五步
USERCTL=yes

三 配置eth1
# cp ifcfg-eth1 bak_ifcfg-eth1
# cat ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0 #如果不写,则必须做第五步
SLAVE=yes #如果不写,则必须做第五步
USERCTL=yes

四 修改/etc/modprobe.conf 添加
alias bond0 bonding
options bond0 miimon=100 mode=1 primary=eth0

五 修改/etc/rc.d/rc.local 可选
ifenslave bond0 eth0 eth1

或者
/etc/rc.local
modprobe bonding miimon=100 mode=1

六 重启操作系统后检查
# cat /proc/net/bonding/bond0


登录备机
更换IP地址 重复以上操作

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1055410/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: kccpb_sanity_check2
请登录后发表评论 登录
全部评论

注册时间:2008-04-08

  • 博文量
    398
  • 访问量
    3716787