FreeBSD でインターフェイスの冗長化 (ボンディング / チーミング / リンクアグリゲーション)

FreeBSD

FreeBSD でもインターフェイスの冗長化 (ボンディング / チーミング / リンクアグリゲーション) が可能です.
Active / Standby や LACP など,Linux と同等の冗長構成をとる事ができます.

今回はインターフェイスの冗長化について解説していきます.

冗長化 / リンクアグリゲーション の説明と構成

インターフェイスの冗長化 (ボンディング / チーミング / リンクアグリゲーション) について説明します.

インターフェイスが1つの場合,そのケーブルもしくはネットワークスイッチのポート,NIC が故障するとネットワークの断が発生し,サービス影響が生じます.
冗長化ができれば,アクティブなインターフェイスを通じてサービスを継続できます.

冗長化にはいくつかの方式があり,FreeBSD で構成可能な方式は次のとおりになります.

failover モード

failover モードは,2つのインターフェイスをアクティブ・スタンバイとして,通常はアクティブインターフェイスのみで送受信を行うモードです.
対向のネットワークスイッチに特別な設定は不要です.帯域は1つのインターフェイスが上限となります.

帯域の向上は不要で冗長だけできれば十分.もしくはスイッチで Etherchannel (Portchannel) が構成できない場合にこのモードを利用する形になります.

failover モードの設定

failover モードを設定する方法について2種類解説します.

コマンドラインでの構成

コマンドラインで構成するには次のとおり行います.インターフェイスは2つ,em0 と em1 を用いた場合で説明します.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1
ifconfig lagg0 create ifconfig em0 up ifconfig em1 up ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1

ifconfig lagg0 create」でリンクアグリゲーション用のインターフェイスを作成します.インターフェイス名は「laggX」である必要がありますので注意してください.

ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1」でリンクアグリゲーションのモードをフェイルオーバーにし,メンバーポートとして em0 と em1 を追加しています.

先に指定したポートが Active ポートとして利用されます.

永続的に利用する場合

/etc/rc.conf に以下のように設定を行います.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1"
cloned_interfaces="lagg0" ifconfig_em0="up" ifconfig_em1="up" ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1"
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto failover laggport em0 laggport em1"

cloned_interfaces=lagg0」が「ifconfig lagg0 create」に該当します.ここも「laggX」である必要があります.

動作確認

上記の設定で構成した場合の通常時はこのような状態になります.em0 が「MASTER,ACTIVE」と記載されているとおり,プライマリーポートとなり通常はこのインターフェイスが利用されます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto failover lagghash l2,l3,l4
laggport: em0 flags=5<MASTER,ACTIVE>
laggport: em1 flags=0<>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto failover lagghash l2,l3,l4 laggport: em0 flags=5<MASTER,ACTIVE> laggport: em1 flags=0<> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto failover lagghash l2,l3,l4
        laggport: em0 flags=5<MASTER,ACTIVE>
        laggport: em1 flags=0<>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

em0 をダウンさせた場合は次のようになります.「ACTIVE」が em1 に移動したことが確認でき,通信は切断されずにフェイルオーバーが行われます.
(正確には少しのロスは発生していますが,SSH セッションが切断される程のロスではありません)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto failover lagghash l2,l3,l4
laggport: em0 flags=1<MASTER>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto failover lagghash l2,l3,l4 laggport: em0 flags=1<MASTER> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto failover lagghash l2,l3,l4
        laggport: em0 flags=1<MASTER>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

em0 を再度 up させると次のようになります.em0 に「ACTIVE」がフェイルバックしてきます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto failover lagghash l2,l3,l4
laggport: em0 flags=5<MASTER,ACTIVE>
laggport: em1 flags=0<>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto failover lagghash l2,l3,l4 laggport: em0 flags=5<MASTER,ACTIVE> laggport: em1 flags=0<> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto failover lagghash l2,l3,l4
        laggport: em0 flags=5<MASTER,ACTIVE>
        laggport: em1 flags=0<>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

以上,failover モードの解説です.

loadbalance モード

loadbalance モードは対向スイッチが例えば Cisco 機器で FEC(FastEtherChannel) や GEC (GigabitEtherChannel) などのポートチャネル技術を備えている機器で利用可能な,アクティブ・アクティブな送受信が行えるモードです.

LACP が設定はできないけど,PortChannel は構成可能.という場合はこちらを利用します.
LACP が利用可能な場合は後述する LACP モードがお薦めです.

loadbalance モードの設定

loadbalance モードを設定する方法について2種類解説します.

コマンドラインでの構成

コマンドラインで構成するには次のとおり行います.インターフェイスは2つ,em0 と em1 を用いた場合で説明します.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1
ifconfig lagg0 create ifconfig em0 up ifconfig em1 up ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1

ifconfig lagg0 create」でリンクアグリゲーション用のインターフェイスを作成します.インターフェイス名は「laggX」である必要がありますので注意してください.

ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1」でリンクアグリゲーションのモードをフェイルオーバーにし,メンバーポートとして em0 と em1 を追加しています.

永続的に利用する場合

/etc/rc.conf に以下のように設定を行います.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1"
cloned_interfaces="lagg0" ifconfig_em0="up" ifconfig_em1="up" ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1"
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto loadbalance laggport em0 laggport em1"
スイッチ側の設定

以下,Cisco Catalyst 2960L の設定例です.「channgel-group 1 mode on」が FEC/GEC の設定となります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface GigabitEthernet0/15
description ### To_vg10_em1
switchport mode access
spanning-tree portfast edge
channel-group 1 mode on
interface GigabitEthernet0/16
description ### To_vg10_em0
switchport mode access
spanning-tree portfast edge
channel-group 1 mode on
interface Port-channel1
description ### To_vg10
switchport mode access
spanning-tree portfast edge
interface GigabitEthernet0/15 description ### To_vg10_em1 switchport mode access spanning-tree portfast edge channel-group 1 mode on interface GigabitEthernet0/16 description ### To_vg10_em0 switchport mode access spanning-tree portfast edge channel-group 1 mode on interface Port-channel1 description ### To_vg10 switchport mode access spanning-tree portfast edge
interface GigabitEthernet0/15
 description ### To_vg10_em1
 switchport mode access
 spanning-tree portfast edge
 channel-group 1 mode on

interface GigabitEthernet0/16
 description ### To_vg10_em0
 switchport mode access
 spanning-tree portfast edge
 channel-group 1 mode on

interface Port-channel1
 description ### To_vg10
 switchport mode access
 spanning-tree portfast edge
動作確認

上記の設定で構成した場合の通常時はこのような状態になります.em0 と em1 の両方が「ACTIVE」と記載されています.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto loadbalance lagghash l2,l3,l4
laggport: em0 flags=4<ACTIVE>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto loadbalance lagghash l2,l3,l4 laggport: em0 flags=4<ACTIVE> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto loadbalance lagghash l2,l3,l4
        laggport: em0 flags=4<ACTIVE>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

スイッチ上は次のように見えます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
c2960#show etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 2
Number of aggregators: 2
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) - Gi0/15(P) Gi0/16(P)
c2960#show etherchannel summary Flags: D - down P - bundled in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 U - in use N - not in use, no aggregation f - failed to allocate aggregator M - not in use, minimum links not met m - not in use, port not aggregated due to minimum links not met u - unsuitable for bundling w - waiting to be aggregated d - default port A - formed by Auto LAG Number of channel-groups in use: 2 Number of aggregators: 2 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) - Gi0/15(P) Gi0/16(P)
c2960#show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)          -        Gi0/15(P)   Gi0/16(P)

em0 をダウンさせた場合は次のようになります.「ACTIVE」が em1 のみになります.通信は切断されずに継続されます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto loadbalance lagghash l2,l3,l4
laggport: em0 flags=0<>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto loadbalance lagghash l2,l3,l4 laggport: em0 flags=0<> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto loadbalance lagghash l2,l3,l4
        laggport: em0 flags=0<>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

em0 を再度 up させると次のようになります.em0 と em1 が再度「ACTIVE」になります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto loadbalance lagghash l2,l3,l4
laggport: em0 flags=4<ACTIVE>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto loadbalance lagghash l2,l3,l4 laggport: em0 flags=4<ACTIVE> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto loadbalance lagghash l2,l3,l4
        laggport: em0 flags=4<ACTIVE>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

以上,loadbalance モードの解説です.

LACP モード

LACP モードは対向スイッチが LACP (Link Aggregation Control Protocol) をのポートチャネル技術を備えている機器で利用可能な,アクティブ・アクティブな送受信が行えるモードです.

loadbalance モードは Cisco の EtherChannel 専用なのに対して,こちらは IEEE 802.3ad という規格化されているものですので様々なネットワーク機器で対応しています.

また,Cisco も結構昔から LACP もサポートしており,FEC/GEC をサポートしなくなってきている製品も存在していますので,通常はこちらのモードを利用するケースが多いと思います.

LACP モードの設定

LACP モードを設定する方法について2種類解説します.

コマンドラインでの構成

コマンドラインで構成するには次のとおり行います.インターフェイスは2つ,em0 と em1 を用いた場合で説明します.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1
ifconfig lagg0 create ifconfig em0 up ifconfig em1 up ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1

ifconfig lagg0 create」でリンクアグリゲーション用のインターフェイスを作成します.インターフェイス名は「laggX」である必要がありますので注意してください.

ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1」でリンクアグリゲーションのモードをフェイルオーバーにし,メンバーポートとして em0 と em1 を追加しています.

永続的に利用する場合

/etc/rc.conf に以下のように設定を行います.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1"
cloned_interfaces="lagg0" ifconfig_em0="up" ifconfig_em1="up" ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1"
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto lacp laggport em0 laggport em1"
スイッチ側の設定

以下,Cisco Catalyst 2960L の設定例です.「channgel-group 1 mode active」が LACP の設定となります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface GigabitEthernet0/15
description ### To_vg10_em1
switchport mode access
spanning-tree portfast edge
channel-group 1 mode active
interface GigabitEthernet0/16
description ### To_vg10_em0
switchport mode access
spanning-tree portfast edge
channel-group 1 mode active
interface Port-channel1
description ### To_vg10
switchport mode access
spanning-tree portfast edge
interface GigabitEthernet0/15 description ### To_vg10_em1 switchport mode access spanning-tree portfast edge channel-group 1 mode active interface GigabitEthernet0/16 description ### To_vg10_em0 switchport mode access spanning-tree portfast edge channel-group 1 mode active interface Port-channel1 description ### To_vg10 switchport mode access spanning-tree portfast edge
interface GigabitEthernet0/15
 description ### To_vg10_em1
 switchport mode access
 spanning-tree portfast edge
 channel-group 1 mode active

interface GigabitEthernet0/16
 description ### To_vg10_em0
 switchport mode access
 spanning-tree portfast edge
 channel-group 1 mode active

interface Port-channel1
 description ### To_vg10
 switchport mode access
 spanning-tree portfast edge
動作確認

上記の設定で構成した場合の通常時はこのような状態になります.em0 と em1 の両方が「ACTIVE,COLLECTING,DISTRIBUTING」と記載されています.loadbalance モードと違い,LACP はネゴシエーションが行われますので,ネゴシエーションに失敗したインターフェイスは ACTIVE にはなりません.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto lacp lagghash l2,l3,l4
laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto lacp lagghash l2,l3,l4 laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto lacp lagghash l2,l3,l4
        laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
        laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

スイッチ上は次のように見えます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
c2960#show etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 2
Number of aggregators: 2
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Gi0/15(P) Gi0/16(P)
c2960#show etherchannel summary Flags: D - down P - bundled in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 U - in use N - not in use, no aggregation f - failed to allocate aggregator M - not in use, minimum links not met m - not in use, port not aggregated due to minimum links not met u - unsuitable for bundling w - waiting to be aggregated d - default port A - formed by Auto LAG Number of channel-groups in use: 2 Number of aggregators: 2 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) LACP Gi0/15(P) Gi0/16(P)
c2960#show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Gi0/15(P)   Gi0/16(P)

em0 をダウンさせた場合は次のようになります.「ACTIVE」が em1 のみになります.通信は切断されずに継続されます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto lacp lagghash l2,l3,l4
laggport: em0 flags=0<>
laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto lacp lagghash l2,l3,l4 laggport: em0 flags=0<> laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto lacp lagghash l2,l3,l4
        laggport: em0 flags=0<>
        laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

em0 を再度 up させると次のようになります.em0 と em1 が再度「ACTIVE」になります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto lacp lagghash l2,l3,l4
laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto lacp lagghash l2,l3,l4 laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto lacp lagghash l2,l3,l4
        laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
        laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

以上,LACP モードの解説です.

round-robin モード

round-robin モードはちょっと特殊です.送受信を NIC をラウンドロビンで行います.スケジューラーがアクティブなインターフェイスを決定し送信インターフェイスを適宜変更していきます.受信はその際のアクティブなインターフェイスから入ってきます.
対向のスイッチではポートチャネルの構成をとる必要はありません.

注意点は,対向スイッチから見て mac address table がしょっちゅう変更されることです.

round-robin モードの設定

round-robinモードを設定する方法について2種類解説します.

コマンドラインでの構成

コマンドラインで構成するには次のとおり行います.インターフェイスは2つ,em0 と em1 を用いた場合で説明します.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1
ifconfig lagg0 create ifconfig em0 up ifconfig em1 up ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1
ifconfig lagg0 create
ifconfig em0 up
ifconfig em1 up
ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1

ifconfig lagg0 create」でリンクアグリゲーション用のインターフェイスを作成します.インターフェイス名は「laggX」である必要がありますので注意してください.

ifconfig lagg0 inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1」でリンクアグリゲーションのモードをラウンドロビンにし,メンバーポートとして em0 と em1 を追加しています.

永続的に利用する場合

/etc/rc.conf に以下のように設定を行います.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1"
cloned_interfaces="lagg0" ifconfig_em0="up" ifconfig_em1="up" ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1"
cloned_interfaces="lagg0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg0="inet 192.168.241.220 netmask 255.255.255.0 laggproto roundrobin laggport em0 laggport em1"
動作確認

上記の設定で構成した場合の通常時はこのような状態になります.em0 と em1 両方が「ACTIVE」と記載されているとおり,送信は両方が Active となります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto roundrobin lagghash l2,l3,l4
laggport: em0 flags=4<ACTIVE>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto roundrobin lagghash l2,l3,l4 laggport: em0 flags=4<ACTIVE> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto roundrobin lagghash l2,l3,l4
        laggport: em0 flags=4<ACTIVE>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

この状態で通信を行うと問題なく出来ている状態になりますが,ping を行うと次のように DUP が表示されます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ping 192.168.241.254
PING 192.168.241.254 (192.168.241.254): 56 data bytes
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.335 ms
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.430 ms (DUP!)
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.282 ms
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.347 ms (DUP!)
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.230 ms
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.283 ms (DUP!)
^C
--- 192.168.241.254 ping statistics ---
3 packets transmitted, 3 packets received, +3 duplicates, 0.0% packet loss
round-trip min/avg/max/stddev = 0.230/0.318/0.430/0.063 ms
# ping 192.168.241.254 PING 192.168.241.254 (192.168.241.254): 56 data bytes 64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.335 ms 64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.430 ms (DUP!) 64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.282 ms 64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.347 ms (DUP!) 64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.230 ms 64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.283 ms (DUP!) ^C --- 192.168.241.254 ping statistics --- 3 packets transmitted, 3 packets received, +3 duplicates, 0.0% packet loss round-trip min/avg/max/stddev = 0.230/0.318/0.430/0.063 ms
# ping 192.168.241.254
PING 192.168.241.254 (192.168.241.254): 56 data bytes
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.335 ms
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.430 ms (DUP!)
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.282 ms
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.347 ms (DUP!)
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.230 ms
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.283 ms (DUP!)
^C
--- 192.168.241.254 ping statistics ---
3 packets transmitted, 3 packets received, +3 duplicates, 0.0% packet loss
round-trip min/avg/max/stddev = 0.230/0.318/0.430/0.063 ms

また,スイッチの MAC アドレステーブルを見てみると次のとおり常に変更が入ります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
c2960#show mac address-table | inc 0026.55da.c6b5
1 0026.55da.c6b5 DYNAMIC Gi0/15
c2960#show mac address-table | inc 0026.55da.c6b5
1 0026.55da.c6b5 DYNAMIC Gi0/16
c2960#show mac address-table | inc 0026.55da.c6b5
1 0026.55da.c6b5 DYNAMIC Gi0/15
c2960#show mac address-table | inc 0026.55da.c6b5
1 0026.55da.c6b5 DYNAMIC Gi0/16
c2960#show mac address-table | inc 0026.55da.c6b5 1 0026.55da.c6b5 DYNAMIC Gi0/15 c2960#show mac address-table | inc 0026.55da.c6b5 1 0026.55da.c6b5 DYNAMIC Gi0/16 c2960#show mac address-table | inc 0026.55da.c6b5 1 0026.55da.c6b5 DYNAMIC Gi0/15 c2960#show mac address-table | inc 0026.55da.c6b5 1 0026.55da.c6b5 DYNAMIC Gi0/16
c2960#show mac address-table | inc 0026.55da.c6b5
   1    0026.55da.c6b5    DYNAMIC     Gi0/15
c2960#show mac address-table | inc 0026.55da.c6b5
   1    0026.55da.c6b5    DYNAMIC     Gi0/16
c2960#show mac address-table | inc 0026.55da.c6b5
   1    0026.55da.c6b5    DYNAMIC     Gi0/15
c2960#show mac address-table | inc 0026.55da.c6b5
   1    0026.55da.c6b5    DYNAMIC     Gi0/16

em0 をダウンさせた場合は次のようになります.「ACTIVE」が em1 のみになります.通信は切断されずに継続されます.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto roundrobin lagghash l2,l3,l4
laggport: em0 flags=0<>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto roundrobin lagghash l2,l3,l4 laggport: em0 flags=0<> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 down
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto roundrobin lagghash l2,l3,l4
        laggport: em0 flags=0<>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

この場合の ping は DUP は発生しません.(インターフェイスが1つだけなので当然ですが)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ping 192.168.241.254
PING 192.168.241.254 (192.168.241.254): 56 data bytes
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.334 ms
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.235 ms
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.229 ms
^C
--- 192.168.241.254 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.229/0.266/0.334/0.048 ms
# ping 192.168.241.254 PING 192.168.241.254 (192.168.241.254): 56 data bytes 64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.334 ms 64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.235 ms 64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.229 ms ^C --- 192.168.241.254 ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.229/0.266/0.334/0.048 ms
# ping 192.168.241.254
PING 192.168.241.254 (192.168.241.254): 56 data bytes
64 bytes from 192.168.241.254: icmp_seq=0 ttl=64 time=0.334 ms
64 bytes from 192.168.241.254: icmp_seq=1 ttl=64 time=0.235 ms
64 bytes from 192.168.241.254: icmp_seq=2 ttl=64 time=0.229 ms
^C
--- 192.168.241.254 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.229/0.266/0.334/0.048 ms

em0 を再度 up させると次のようになります.em0 と em1 が再度「ACTIVE」になります.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
ether 00:26:55:da:c6:b5
inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
laggproto roundrobin lagghash l2,l3,l4
laggport: em0 flags=4<ACTIVE>
laggport: em1 flags=4<ACTIVE>
groups: lagg
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up # ifconfig lagg0 lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP> ether 00:26:55:da:c6:b5 inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255 laggproto roundrobin lagghash l2,l3,l4 laggport: em0 flags=4<ACTIVE> laggport: em1 flags=4<ACTIVE> groups: lagg media: Ethernet autoselect status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig em0 up
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
        ether 00:26:55:da:c6:b5
        inet 192.168.241.220 netmask 0xffffff00 broadcast 192.168.241.255
        laggproto roundrobin lagghash l2,l3,l4
        laggport: em0 flags=4<ACTIVE>
        laggport: em1 flags=4<ACTIVE>
        groups: lagg
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

以上,roundrobin モードの解説です.

コメント

タイトルとURLをコピーしました