Bonding設定

投稿者: | 2011年5月8日
Pocket

対象サーバについて

製品名 OpenBlockS 600
OS(kernel ver) Debian lenny(2.6.29)
CPU 600MHz(AMCC PowerPC 405EX)
メモリ 1GB(DDR2 SDRAM)
ストレージ 8GB(Compact Flash)

はじめに

以下の図のようにOpenblocks600のeth0,eth1でbonding IFを作成します。

bondingドライバの障害検知方法にはMII監視とARP監視がありますが、Openblocks600では両方とも動作しましたので、それぞれについて紹介します。

MII監視

MII監視は物理NICがリンクダウンしたら故障とみなす方式です。

リンクによけいなパケットが流れず短時間で切り替わる反面、NICが上がったまま通信不可となるような障害時には対応できません。

インストール

close:~# aptitude install ifenslave-2.6
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます
パッケージの状態を初期化しています... 完了
タスクの記述を読み込んでいます... 完了
以下の新規パッケージがインストールされます:
  ifenslave-2.6
更新: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
13.5kB のアーカイブを取得する必要があります。展開後に 115kB のディスク領域が新たに消費されます。
拡張状態情報を書き込んでいます... 完了
取得:1 http://ftp.jp.debian.org lenny/main ifenslave-2.6 1.1.0-10 [13.5kB]
13.5kB を 0s 秒でダウンロードしました (13.8kB/s)
未選択パッケージ ifenslave-2.6 を選択しています。
(データベースを読み込んでいます ... 現在 16963 個のファイルとディレクトリがインストールされています。)
(.../ifenslave-2.6_1.1.0-10_powerpc.deb から) ifenslave-2.6 を展開しています...
man-db のトリガを処理しています ...
ifenslave-2.6 (1.1.0-10) を設定しています ...
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます
パッケージの状態を初期化しています... 完了
拡張状態情報を書き込んでいます... 完了
タスクの記述を読み込んでいます... 完了

事前MACアドレス確認

close:~# ifconfig -a
eth0      Link encap:イーサネット  ハードウェアアドレス 00:0a:85:04:02:ff
          inetアドレス:192.168.0.200 ブロードキャスト:192.168.0.255  マスク:255.255.255.0
          inet6アドレス: fe80::20a:85ff:fe04:2ff/64 範囲:リンク
          UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
          RXパケット:13537 エラー:0 損失:0 オーバラン:0 フレーム:0
          TXパケット:8845 エラー:0 損失:0 オーバラン:0 キャリア:0
      衝突(Collisions):0 TXキュー長:1000
          RXバイト:16106556 (15.3 MiB)  TXバイト:640629 (625.6 KiB)
          割り込み:25

eth1      Link encap:イーサネット  ハードウェアアドレス 00:0a:85:04:82:ff
          BROADCAST MULTICAST  MTU:1500  メトリック:1
          RXパケット:0 エラー:0 損失:0 オーバラン:0 フレーム:0
          TXパケット:0 エラー:0 損失:0 オーバラン:0 キャリア:0
      衝突(Collisions):0 TXキュー長:1000
          RXバイト:0 (0.0 B)  TXバイト:0 (0.0 B)
          割り込み:27

lo        Link encap:ローカルループバック
          inetアドレス:127.0.0.1 マスク:255.0.0.0
          inet6アドレス: ::1/128 範囲:ホスト
          UP LOOPBACK RUNNING  MTU:16436  メトリック:1
          RXパケット:246 エラー:0 損失:0 オーバラン:0 フレーム:0
          TXパケット:246 エラー:0 損失:0 オーバラン:0 キャリア:0
      衝突(Collisions):0 TXキュー長:0
          RXバイト:21212 (20.7 KiB)  TXバイト:21212 (20.7 KiB)

結合ドライバモジュールのロード

close:~# vi /etc/modprobe.d/bonding
alias bond0 bonding

close:~# modprobe bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
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.

オプション指定を行うように警告が出たため、一度削除してから指定します。

close:~# modprobe -r bond0
close:~# vi /etc/modprobe.d/bonding
alias bond0 bonding
options bonding mode=1 miimon=100

mode=1(Active-Backup)、監視間隔100msで動作を確認します。

close:~# modprobe bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
bonding: MII link monitoring set to 100 ms

ロードに成功しました。

ちなみに動作modeには以下があります。

mode=0 balance-rr 送信するパケットごとに使用する物理NICを切替
mode=1 active-backup 1つ目の物理NICが使える間はそのNICのみを使用し、そのNICが故障すれば次のNICを使う
mode=2 balance-xor 送信元と送信先のMACアドレスをXORして使用する物理NICを決める。
mode=3 broadcast 送信パケットはコピーされて、全ての物理NICに対して同じものが送出される。
mode=4 802.3ad IEEE802.3adプロトコルを使い、スイッチとの間で動的にあ繰りげーションを作成
mode=5 balance-tlb 物理NICの間で最も負荷の少ない物理NICを選んで送信する。受信は特定の物理NICを使って受信する。
mode=6 balance-alb 送信も受信も負荷の少ない物理NICを使う。
close:~# vi /etc/modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
bonding

起動時から有効化するために/etc/modulesにも設定します。

インタフェース設定

close:~# vi /etc/network/interfaces

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback

allow-hotplug bond0
auto bond0
iface bond0 inet static
address 192.168.0.200
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
slaves eth0 eth1

再起動

close:~# shutdown -r now

状態確認

・Openblocks側

close:~# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: negotiated 100baseTx-FD, link ok

両方ともlink okとなっています。

close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

Bonding Modeは指定通り(mode=1)、active-backupになっています。

Primary Slaveは指定しなかったためNoneとなっています。

Currently Active Slaveはeth0になっています。

MII Polling Intervalも指定通り、100msとなっています。

eth0、eth1ともにUP状態となっており、HW addrは正しいアドレスを表示します。

close:~# ip link show
1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff
3: eth1:  mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff
4: bond0:  mtu 1500 qdisc noqueue state UP
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff

IPコマンドで見ると、MACアドレスはeth0、1ともに同じ値になっています。

・対向L2SW側

c2940-ACT#sho mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/8
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

対向L2SWのMACアドレステーブルでは、Openblocksのeth0と接続されているFa0/8側にて認識されています(eth1はFa0/7と接続されています)

・中継区間でのキャプチャ結果

MIIではIFの状態を指定した間隔でチェックしているだけなのでパケットは流れません。

eth0 ケーブル抜去

・Openblocks側

close:~# ping www.yahoo.co.jp
PING www.ya.gl.yahoo.co.jp (203.216.231.189) 56(84) bytes of data.

...

64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=26 ttl=56 time=6.26 ms
64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=27 ttl=56 time=6.27 ms
64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=28 ttl=56 time=7.23 ms ★★★★ここで抜去★★★★
64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=29 ttl=56 time=11.8 ms
64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=30 ttl=56 time=6.15 ms
64 bytes from f8.top.vip.tnz.yahoo.co.jp (203.216.231.189): icmp_seq=31 ttl=56 time=8.97 ms

...

→パケロスはありませんでした。

・対向L2SWでのログ

c2940-ACT#
2d13h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down
2d13h: %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down
c2940-ACT#

状態確認

・Openblocks側

close:~# mii-tool
eth0: no link
eth1: negotiated 100baseTx-FD, link ok

eth0がno linkになっています。

close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: down
Link Failure Count: 1
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

Currently Active Slaveがeth1に変わりました。

また、eth0のMII Statusがdownになり、Link Failure Countが1にカウントアップしています。

close:~# ip link show
1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast master bond0 state DOWN qlen 1000
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff
3: eth1:  mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff
4: bond0:  mtu 1500 qdisc noqueue state UP
    link/ether 00:0a:85:04:02:ff brd ff:ff:ff:ff:ff:ff

IPコマンドでもeth0のstateがDOWNになっています。

・対向L2SWでの確認

c2940-ACT#sho mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/7
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

対向L2SWのMACアドレステーブルでは、Openblocksのeth1と接続されているFa0/7側での認識に変わりました。

eht0 ケーブル接続後、状態確認

・Openblocks側

close:~# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

Primaryオプションにてeth0を指定しなかったため、Currently Active Slaveはeth1のままになっています。

・対向L2SW側

c2940-ACT#sho mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/7
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

→L2SW側も同じく、Openblocksのeth1と接続されているFa0/7側での認識のままです。

Primary eth0にして再度実施

オプションにてPrimary指定にした場合の動きを確認します。

close:~# vi /etc/modprobe.d/bonding

alias bond0 bonding
options bonding mode=1 miimon=100 primary=eth0

close:~# shutdown -r now

...

状態確認

・Openblocks側

close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

Primary SlaveがNoneからeth0に変わりました。

・対向L2SW側

c2940-ACT#sho mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/8
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

対向L2SWのMACアドレステーブルでは、Openblocksのeth0と接続されているFa0/8側にて認識されています。

eth0 ケーブル抜去

close:~# ping www.yahoo.co.jp

...

64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=58 ttl=55 time=6.30 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=59 ttl=55 time=6.17 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=60 ttl=55 time=5.75 ms ★★★★ここで抜去★★★★
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=62 ttl=55 time=5.80 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=63 ttl=55 time=8.15 ms

1秒パケロスしました。

eth0 ケーブル挿入

close:~# ping www.yahoo.co.jp

...

64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=65 ttl=55 time=8.50 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=66 ttl=55 time=7.66 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=67 ttl=55 time=11.6 ms ★★★★ここで挿入★★★★
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=72 ttl=55 time=7.18 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=73 ttl=55 time=8.16 ms
64 bytes from f10.top.vip.tnz.yahoo.co.jp (203.216.227.245): icmp_seq=74 ttl=55 time=6.09 ms

5秒パケロスしました。

状態確認

・Openblocks側

close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

Primaryオプションの効果でCurrently Active Slaveがeth0に戻っています。

・対向L2SW側

c2940-ACT#sho mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/8
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

L2SW側もPrimaryオプションの効果でOpenblocksのeth0と接続されているFa0/8側にて認識されています。

ARP監視

MII監視では、IFはUP状態にも関わらず通信できないような障害で対応できません。

また、L2SWを束ねて利用している場合、MII監視では直接接続されていないL2SW障害を検出できないためARP監視を使用することになります。

ARP監視の欠点としてはARPパケットがリンク中に流れることと、ARP間隔だけ障害復旧に時間がかかることです。

MII監視からARP監視への設定変更

・Openblocks側

close:~# vi /etc/modprobe.d/bonding

alias bond0 bonding
options bonding mode=1 miimon=0 primary=eth0 arp_interval=3000 arp_ip_target=192.168.0.1

miimon=0にしてMII監視を止めています(miimonオプションを削除しても問題ありません)。

ARP監視の間隔を3秒、ターゲットをルータにしています(L2SWを束ねている場合は他のサーバにも実施すべきです)

close:~# shutdown -r now

Broadcast message from root@close (pts/0) (Sun May  8 19:30:44 2011):

The system is going down for reboot NOW!


close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 3000
ARP IP target/s (n.n.n.n form): 192.168.0.1

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

ARP Polling Intervalが設定どおり3秒になっています。また、ARP IP targetも指定通りルータになっています。

ARPパケットを送出している様子をtcpdumpコマンドで確認します。

close:~# tcpdump arp -i any
tcpdump: WARNING: Promiscuous mode not supported on the "any" device
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
21:15:02.370639 arp who-has 192.168.0.1 tell 192.168.0.200
21:15:02.371060 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:15:05.370496 arp who-has 192.168.0.1 tell 192.168.0.200
21:15:05.371051 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:15:08.370496 arp who-has 192.168.0.1 tell 192.168.0.200
21:15:08.371081 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:15:11.370499 arp who-has 192.168.0.1 tell 192.168.0.200
21:15:11.371047 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)

...

DUMPしてみると3秒間隔でARPを投げています。

・L2SW側

c2940-ACT#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/8
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

対向L2SWのMACアドレステーブルでは、Openblocksのeth0と接続されているFa0/8側にて認識されています。

eth0 ケーブル抜去

・Openblocks側(Ping結果)

close:~# ping www.yahoo.co.jp
PING www.ya.gl.yahoo.co.jp (124.83.171.240) 56(84) bytes of data.

...

64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=15 ttl=50 time=18.4 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=16 ttl=50 time=16.8 ms★★★★ここで抜去★★★★
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=23 ttl=50 time=17.0 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=24 ttl=50 time=16.2 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=25 ttl=50 time=21.8 ms

7秒パケロスしました。

tcpdumpでのARP送出の様子も確認します。

close:~# tcpdump arp -i any
tcpdump: WARNING: Promiscuous mode not supported on the "any" device
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
21:25:20.386623 arp who-has 192.168.0.1 tell 192.168.0.200
21:25:20.387075 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:25:23.386503 arp who-has 192.168.0.1 tell 192.168.0.200
21:25:23.387239 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:25:26.386483 arp who-has 192.168.0.1 tell 192.168.0.200
21:25:26.387026 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)★★★★ここで抜去★★★★
21:25:35.398207 arp reply 192.168.0.200 is-at 00:0a:85:04:02:ff (oui Unknown)★★★★ここでGARP送出★★★★
21:25:35.398426 arp who-has 192.168.0.1 tell 192.168.0.200
21:25:35.399327 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:25:38.398495 arp who-has 192.168.0.1 tell 192.168.0.200★★★★通常の3秒間隔でのARP送信に戻っている★★★★
21:25:38.399058 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)

GARPを正常なIF側(eth1)から送出することで対向L2SWのMAC-ADDRESSテーブルを書き換えている様子が分かります。

・L2SW側

c2940-ACT#
2d16h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down
2d16h: %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down
c2940-ACT#
c2940-ACT#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/7
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

対向L2SWのMACアドレステーブルでは、Openblocksのeth1と接続されているFa0/7側に切り替わりました。

eth0 ケーブル挿入

・Openblocks側(Ping結果)

close:~# ping www.yahoo.co.jp
PING www.ya.gl.yahoo.co.jp (124.83.171.240) 56(84) bytes of data.

...

64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=58 ttl=50 time=16.9 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=59 ttl=50 time=26.9 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=60 ttl=50 time=15.9 ms★★★★ここで挿入★★★★
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=61 ttl=50 time=16.5 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=62 ttl=50 time=17.5 ms
64 bytes from f7.top.vip.ogk.yahoo.co.jp (124.83.171.240): icmp_seq=63 ttl=50 time=16.7 ms

挿入時は断はありませんでした。

tcpdumpでのARP送出の様子も確認します。

close:~# tcpdump arp -i any

...

21:43:20.530488 arp who-has 192.168.0.1 tell 192.168.0.200
21:43:20.531004 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)★★★★ここで抜去★★★★
21:43:23.530488 arp who-has 192.168.0.1 tell 192.168.0.200
21:43:23.531013 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:43:26.530496 arp who-has 192.168.0.1 tell 192.168.0.200
21:43:26.531025 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)
21:43:29.540036 arp reply 192.168.0.200 is-at 00:0a:85:04:02:ff (oui Unknown)★★★★GARP送出★★★★
21:43:29.540277 arp who-has 192.168.0.1 tell 192.168.0.200
21:43:29.541069 arp reply 192.168.0.1 is-at 00:a0:de:27:ae:7d (oui Unknown)

接続後、少し時間を置いてから(上記では9秒)GARPを送出しています。

・L2SW側

c2940-ACT#
2d16h: %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to up
2d16h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to up
c2940-ACT#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/7
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

UP直後しばらくはOpenblocksのeth1と接続されているFa0/7側で認識しています。

c2940-ACT#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0013.8002.a0c0    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000a.8504.02ff    DYNAMIC     Fa0/8
   1    00a0.de27.ae7d    DYNAMIC     Fa0/1
   1    b8ac.6faa.e8b7    DYNAMIC     Fa0/1
Total Mac Addresses for this criterion: 7

10秒ほど空けて再度確認してみたところ(恐らく上記GARPがOpenblocks600のeth0から送出されたのを契機として)、Openblocksのeth0と接続されているFa0/8側に切り替わりました。

ARP監視とMII監視の併用

ARP監視とMII監視が併用できるか確かめてみました。

close:~# vi /etc/modprobe.d/bonding

alias bond0 bonding
options bonding mode=1 miimon=100 primary=eth0 arp_interval=50000 arp_ip_target=192.168.0.1

miimon=100にして(=MII監視を動作させて)arp関連のオプションも記述します。

close:~# shutdown -r now

Broadcast message from root@close (pts/0) (Sun May  8 19:25:48 2011):

The system is going down for reboot NOW!

close:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:02:ff

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0a:85:04:82:ff

ARP監視が止まっています。併用はできないようです。

Pocket

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です