CentOS 5.4上雙網路卡(多網路卡)繫結

kidking2010發表於2011-07-08

在CentOS上做雙網路卡繫結:

1.確定網路卡和配置檔案

修改配置檔案:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes

vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes

vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
BOOTPROTO=none

#廣播域
BROADCAST=10.10.10.255

#網路卡實體地址
IPADDR=10.10.10.221

#子網掩碼
NETMASK=255.255.255.0
NETWORK=10.10.10.0
ONBOOT=yes

#閘道器地址
GATEWAY=10.10.10.1
TYPE=Ethernet

2. 在模組檔案中新增如下標紅的內容:

vi  /etc/modprobe.conf


alias eth0 bnx2
alias eth1 bnx2
alias scsi_hostadapter megaraid_sas
alias scsi_hostadapter1 usb-storage
alias bond0 bonding
options bond0 miimon=100 mode=0

3.在啟動檔案中加入如下標紅內容:

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/local
ifenslave bond0 eth0 eth1

4.重啟網路服務

 /etc/init.d/network restart
Shutting down interface bond0:                             [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface bond0:                               [  OK  ]

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23141985/viewspace-701726/,如需轉載,請註明出處,否則將追究法律責任。

相關文章