Bond 的几种设置方式

  • Bond相关信息


查看服务器bond信息:  # cat /proc/net/bonding/*


  • Bond脚本设置方式      

  

如果遇到下面的错误信息,可以采用下列方式:

Bringing up interface bond0: Device bond0 does not seem to be present, delaying initialization. 


解决办法:

# modprobe bonding

# lsmod |grep bonding 


执行以上两行后就可以支持bond了

# cat /etc/rc.d/network.sh      // add this scripts to /etc/rc.local for automatic start


======================

#!/bin/bash


AIP="10.10.30.26"

Wg="10.10.30.254"


ifconfig eth0 up

ifconfig eth1 up

modprobe bonding mode=1 miimon=100 primary=eth0

ifconfig bond0 $AIP netmask 255.255.255.0

ifenslave bond0 eth0 eth1

sleep 1


ip ro del default

ip ro add default via $Wg dev bond0

sleep 1

ifdown eth0

ifconfig eth0 up


  • Bond文件配置设置方式

# cat /etc/sysconfig/network-scripts/ifcfg-bond0 

DEVICE="bond0"

BOOTPROTO=none

IPADDR=10.10.1.200

NETMASK=255.255.0.0

GATEWAY=10.0.0.254

NM_CONTROLLED=no                                        

ONBOOT=yes

USERCTL=no

BONDING_OPTS="mode=1 miimon=100"          #注意在mode=1的情况下,如果需要指定主网卡,需要加上 primary=eth0


# cat /etc/sysconfig/network-scripts/ifcfg-em1

DEVICE="em1"

BOOTPROTO=none

MASTER=bond0

SLAVE=yes

ONBOOT=yes

USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-em2

DEVICE="em2"

BOOTPROTO=none

MASTER=bond0

SLAVE=yes

ONBOOT=yes

USERCTL=no


  • 双Bond文件配置设置方式

# cat /etc/sysconfig/network-scripts/ifcfg-bond0 

DEVICE=bond0

ONBOOT=yes

BONDING_OPTS=miimon=100 mode=0

BOOTPROTO=static

IPADDR=10.2.3.188

NETMASK=255.255.0.0

# cat /etc/sysconfig/network-scripts/ifcfg-bond1

DEVICE=bond1

ONBOOT=yes

BONDING_OPTS=miimon=100 mode=0

BOOTPROTO=static

IPADDR=10.2.4.188

NETMASK=255.255.0.0


# cat /etc/sysconfig/network-scripts/ifcfg-em1

DEVICE=em1

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=none

SLAVE=yes

MASTER=bond0

# cat /etc/sysconfig/network-scripts/ifcfg-em2

DEVICE=em2

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=none

SLAVE=yes

MASTER=bond0

# cat /etc/sysconfig/network-scripts/ifcfg-em3

DEVICE=em3

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=none

SLAVE=yes

MASTER=bond1

# cat /etc/sysconfig/network-scripts/ifcfg-em4

DEVICE=em4

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=none

SLAVE=yes

MASTER=bond1


  • Bond错误

   

ISSUE

   

   Ethernet Channel Bonding Driver: v2.6.3-rh (June 8, 2005)

   bonding: Warning: either miimon or arp_interval and arp_ip_target module 

   parameters must be specified, otherwise bonding will not detect link failures! 

   see bonding.txt for details.

   divert: allocating divert_blk for bond0


SOLUTION

Properly setup bonding alias in "/etc/modprobe.conf"


## setup bond0 alias and set it's option in 

##    /etc/modprobe.conf

##

## NOTE:

##    miimon=100 (100 msecs) [Media Independent Interface (MII) link 

monitoring]

##    mode=1     (bond mode) ["1" is "active-backup" mode]

##

##

vi /etc/modprobe.conf

--- add the following to the end of the file ---

alias bond0 bonding

options bond0 miimon=100 mode=1



   [root@rac1 log]# grep bond0 /etc/modprobe.conf

   alias bond0 bonding

   options bond0 miimon=100 mode=1

refer:http://kb.dbatoolz.com/tp/3359.bonding_either_miimon_or_arp_interval_and_arp_ip_target_module_must_be_specified.html


http://www.2cto.com/os/201403/283742.html

你可能感兴趣的:(linux,NetWork,Bond,bond0,bond1)