RHEL5.9 bond配置

一、配置bond

1、ifcfg-bond0

# Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe

DEVICE=bond0

BOOTPROTO=static

ONBOOT=yes

IPADDR=10.0.40.20

NETMASK=255.255.255.0

GATEWAY=10.0.40.254

USERCTL=no


2、ifcfg-eth0

# Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe

DEVICE=eth0

BOOTPROTO=static

ONBOOT=yes

MASTER=bond0

SLAVE=yes

USERCTL=no


3、ifcfg-eth1

# Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe

DEVICE=eth1

BOOTPROTO=static

ONBOOT=yes

MASTER=bond0

SLAVE=yes

USERCTL=no


4、/etc/modprobe.conf配置

alias eth0 tg3

alias eth1 tg3

alias eth2 bnx2

alias eth3 bnx2

alias scsi_hostadapter megaraid_sas

alias scsi_hostadapter1 ata_piix

alias scsi_hostadapter2 lpfc

alias usb0 cdc_ether

alias bond0 bonding

options bond0 miimon=100 mode=1

注:網卡綁定需要同型號網卡做bonding,如果eth0和eth2做綁定後,測試冗餘性時網絡故障後不會切換,但是查看cat /proc/net/bongding/bond0有綁定信息。


二、查看狀態

1、重啓網絡

 /etc/init.d/network restart


2、查看bond運行狀態

cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 1

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth0

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:50:56:a2:4d:00

Slave Interface: eth1

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:50:56:a2:4d:01


三、測試bond

1、斷開eth1網口

[root@test1 network-scripts]# ifdown eth0

2、查看bond狀態,eth0已經掉線,現在eth1接管

[root@test1 network-scripts]# cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 1

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:50:56:a2:4d:01

3、激活eth1

[root@test1 network-scripts]# ifup eth0

4、查看bond狀態,eth0上線,但是網絡流量還是在eth1上跑,eth0作爲備份。(之前eth0是承載流量)

[root@test1 network-scripts]# cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 1

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:50:56:a2:4d:01

Slave Interface: eth0

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:50:56:a2:4d:00



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章