LoginSignup
0
0

More than 5 years have passed since last update.

round-robin に誤認識された bond0 を active-backup に修正する

Last updated at Posted at 2017-10-05

現象

/etc/network/interfaces に bond_mode active-backup と正しく記述しても
なぜかround-robinになる問題に遭遇した。

Oct 6 06:29:01.273 JST: %SW_MATM-4-MACFLAP_NOTIF: Host xxxx.xxxx.xxxx in vlan 99 is flapping between port Ge1/0/9 and port Po1

L3SWにて上記メッセージが「約10分に1回」出力されている。

grep ^Bonding /proc/net/bonding/bond?
  • kernel 4.4.44-1-pve (proxmox4) だと発生しなかった。
  • kernel 4.10.17-3-pve (proxmox5:最新)で発生。
/etc/network/interfaces抜粋
auto bond0
iface bond0 inet manual
    slaves eth0 eth1
    bond_miimon 100
    bond_mode active-backup

参考

対応

/root/fix_bonding_mode.sh
#!/bin/sh

# round-robin に誤認識された bond0 を active-backup に修正する
grep "round-robin" /proc/net/bonding/bond0 > /dev/null
if [ $? -eq 0 ];then
        /sbin/ifdown bond0
        echo "active-backup" > /sys/class/net/bond0/bonding/mode
        /sbin/ifup bond0
fi
crontab
@reboot sh /root/fix_bonding_mode.sh

なお /sbin/ifconfig bond0 down だと /sys/class/net/bond0/bonding/modeに書き込めないため ifdown を使うこと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0