close

先建立 bond0

 

[root@KHCDNSS01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.15.25.0
NETMASK=255.255.255.0
IPADDR=10.15.25.13
USERCTL=no

 

ETHTOOL_OPTS="autoneg off speed 1000 duplex full" ##### 定速為 1000M 全雙工

BONDING_OPTS="miimon=100 mode=6"   ##### bonding options 也可以在這邊設定

BONDING_OPTS="mode=0 miimon=100 downdelay=300 updelay=300 max_bonds=4"  #####


note: you must use capital letter for left side variables, especially BONDING_OPTS, otherwise, you might not be able to see slave devices from command output of 'ifconfig'.
Do not configure BONDING_OPTS in /etc/modprobe.d/bonding.conf as suggested by Redhat.

 

 

在設定 Salve 網路卡 (eth0、eth1)

 

[root@KHCDNSS01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:22:19:50:BC:7E
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

 

[root@KHCDNSS01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:22:19:50:BC:80
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

 

 

設定 Gateway

 

[root@KHCDNSS01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=KHCDNSS01
GATEWAY=10.15.25.254

 

 

修改 modprobe or modprobe.d

 

再來是編輯 /etc/modprobe.conf 檔案:(這個檔案在 RHEL3 是在:/etc/modules.conf 而在 RHEL4、5 以後的版本則在:/etc/modprobe.conf)

RHEL6的版本是在 /etc/modprobe.d/ 裡面建立 bonding.conf 檔案

 

(RHEL4、5)

[root@KHCDNSS01 ~]# vi /etc/modprobe.conf
alias eth0 bnx2
alias eth1 bnx2
alias scsi_hostadapter megaraid_sas
alias scsi_hostadapter1 ata_pii
alias bond0 bonding
options bond0 miimon=100

 

P.S. 這裡要注意一下喔,假如你想綁兩個以上的話,那 option 這一行的後面要再多加一個選項喔:max_bonds=3,這代表我要將三個網卡綁成一個 Channel...像下面這樣:

(options bond0 miimon=100 max_bonds=3)

 

(RHEL6)

[root@voipdb2 modprobe.d]# cat bonding.conf
alias bond0 bonding
alias bond1 bonding
alias bond4 bonding
 

 

查詢 bonding 狀況

 
看 bonding 的狀況為
[root@KHCDNSS01 ~]# cat /proc/net/bonding/bond0
arrow
arrow
    文章標籤
    Linux
    全站熱搜

    johnchen6927 發表在 痞客邦 留言(0) 人氣()