在CentOS/RHEL 4上 如何配置接口绑定bonding(NIC teaming )

按照以下 4 个步骤配置绑定接口(bonding ):

  1. 使用配置文件/etc/modprobe.conf配置bonding驱动,以及bonding模式和参数。
# grep bond0 /etc/modprobe.conf
alias bond0 bonding
options bond0 mode=1 miimon=100
  1. 使用各自的网络脚本配置bond的保存接口。
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
  1. 使用网络脚本文件 /etc/sysconfig/network-scripts/ifcfg-bond0 配置绑定接口。
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
MASTER=yes
BOOTPROTO=dhcp
ONBOOT=yes
  1. 完成上述所有步骤后,激活绑定界面。
# ifup bond0

请注意 CentOS4/RHEL 4 上的绑定参数设置与 CentOS/RHEL 5 上的不同。
CentOS/RHEL 4 系统不支持 ifcfg-XXX 中的“BONDING_OPTS”。
对于 RHEL/CentOS 4 系统,绑定参数应始终在 /etc/modprobe.conf 中设置。

注意:对于CentOS/RHEL 4上的多个bonding接口,相同模式的应该使用“max_bonds”参数,不同模式的应该使用多个驱动程序实例。

日期:2020-09-17 00:12:52 来源:oir作者:oir