redhat 5.9做RAC前的双网卡绑定

来源:互联网 发布:centos7 ubuntu 对比 编辑:程序博客网 时间:2024/05/22 02:08

      最近这几天忙着装上了服务器,redhat 5.9,华为的存储,并装上多路径软件。在施工的过程中自己配置的双网卡bonding .完后自己整理以便于日后有所忘记。

      环境介绍:

 root@wtrac1[/root]#uname -aLinux wtrac1 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linuxroot@wtrac2[/root]#uname -aLinux wtrac2 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
          步骤:

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-bond0root@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-bond0# Intel Corporation 82580 Gigabit Network ConnectionDEVICE=bond0BOOTPROTO=noneONBOOT=yesNETMASK=255.255.255.224IPADDR=172.16.20.78GATEWAY=172.16.20.65TYPE=EthernetUSERCTL=noroot@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-eth0# Intel Corporation 82580 Gigabit Network ConnectionDEVICE=eth0BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERCTL=noMASTER=bond0SLAVE=yesroot@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-eth2# Broadcom Corporation NetXtreme II BCM5709 Gigabit EthernetDEVICE=eth2BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERCTL=noMASTER=bond0SLAVE=yesroot@wtrac2[/root]#cat /etc/modprobe.conf  ---加载模块,让系统支持bondingalias eth0 igbalias eth1 igbalias eth2 bnx2alias eth3 bnx2alias scsi_hostadapter megaraid_sasalias scsi_hostadapter1 ata_piixalias scsi_hostadapter2 lpfcalias usb0 cdc_etheralias bond0 bondingoptions bond0 miimon=100 mode=0---miimon 三种模式分别是0 负载均衡,两块网卡都工作,需要交换机作支持1 冗余方式,只有一个网卡工作,一个出现问题启用另外一个6 负载均衡,两块网卡都工作,不需要交换机作支持root@wtrac2[/root]#cat  /etc/rc.d/rc.local --开机启动#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/localifenslave bond0 eth0 eth2root@wtrac2[/root]# cat /proc/net/bonding/bond0   ---查看绑定后的状态Ethernet Channel Bonding Driver: v3.4.0-2 (October 7, 2008)Bonding Mode: load balancing (round-robin)MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 6c:ae:8b:78:42:08Slave Interface: eth2MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 90:e2:ba:42:f5:cecp /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-bond1root@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-bond1# Intel Corporation 82580 Gigabit Network ConnectionDEVICE=bond1BOOTPROTO=noneONBOOT=yesTYPE=EthernetNETMASK=255.255.255.224IPADDR=192.168.1.2USERCTL=noroot@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-eth1# Intel Corporation 82580 Gigabit Network ConnectionDEVICE=eth1BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERCTL=noMASTER=bond1SLAVE=yesroot@wtrac2[/root]#cat /etc/sysconfig/network-scripts/ifcfg-eth3# Broadcom Corporation NetXtreme II BCM5709 Gigabit EthernetDEVICE=eth3BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERCTL=noMASTER=bond1SLAVE=yesroot@wtrac2[/root]#cat /etc/modprobe.conf alias eth0 igbalias eth1 igbalias eth2 bnx2alias eth3 bnx2alias scsi_hostadapter megaraid_sasalias scsi_hostadapter1 ata_piixalias scsi_hostadapter2 lpfcalias usb0 cdc_etheralias bond0 bondingoptions bond0 miimon=100 mode=0alias bond1 bondingoptions bond1 miimon=100 mode=0root@wtrac2[/root]#cat  /etc/rc.d/rc.local#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/localifenslave bond0 eth0 eth2ifenslave bond1 eth1 eth3service network restart (重启过后才能查看)root@wtrac2[/root]#cat /proc/net/bonding/bond1Ethernet Channel Bonding Driver: v3.4.0-2 (October 7, 2008)Bonding Mode: load balancing (round-robin)MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth1MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 6c:ae:8b:78:42:0aSlave Interface: eth3MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 90:e2:ba:42:f5:cf


0 0
原创粉丝点击