シナプス技術者ブログ

シナプスの技術者公式ブログ。インターネットで、鹿児島の毎日を笑顔にします。

LACP関連コマンドの復習

こんにちは。ネットワーク課の若松です。 シナプスではデータセンタ内の機器間や、データセンタ間の接続にLAGという技術/機能を使っております。 今回このLAGを複数のメーカのルータやスイッチに設定しましたので、そのコマンド等を紹介させていただきます。

LAGとは

LAGとは Link Aggregation Groupの略です。ネットワーク機器間の複数の物理ポートを束ねて論理的に単一のリンクを形成する技術です。

LAGの例

LAGの特徴

LAGには以下のような特徴があります。

冗長性と可用性の確保
遠隔地にある拠点間や、機器間のリンクが1本切れても動作の継続(トラフィックを流し続けること)が可能です。 例えば、拠点間の回線事業者を別々にすることで、片方の回線に故障が発生しても残った回線でサービス継続が可能です。

トラフック分散/帯域の増加
複数のリンクでトラフィックを分散させることができます。 n本のリンクで構成した場合、(LAGを動作させる機器の実装にもよりますが)見かけ上n倍の帯域になります。

コスト削減
例えば1Gbpsで帯域不足になる場合でも、10GbpsのIFを備えたルータ/スイッチを新たに導入するのではなく、1Gbps×2本で2Gbpsや、1Gbps×3本で3GbpsというようにLAGを構成すれば既存ハードウェアの延命とコスト削減(設備投資の先送り)が可能となります。

LAGの種類

LAGの挙動の種類

LAGの挙動の種類としては以下があります。

  • スタティック(手動で固定的にLAGを設定)
  • ダイナミック( 対向先ポートとネゴシエーションし、対向のポート設定次第でLAG構成の有無が決まる)

LAGのプロトコルの種類

対向先ポートとネゴシエーションする場合のプロトコルは、主に PAgPLACP が挙げられます。
PAgPはCisco社独自のプロトコルで、Cisco社製の機器間でないと使用することが出来ません。
LACPはIEEE 802.3adで策定され、多数の機器メーカが採用していますので、異なるメーカの機器間(もちろんCisco社製品間)でも使用が可能です。
なお、LAGにはIEEE 802.3ad とは別に IEEE 802.1AX というものもありますが、今回はIEEE 802.3adのほうについて説明します。

LAG導入の必須条件

LAG導入の必須条件としては以下のようなものがあります。

  • 双方の機器がLAGに対応していること。
  • LAGに指定したポートのIF設定(ポート速度、デュプレックスモード、フロー制御等)が一致していること。
  • 同一のVLANに属していること。

検証環境

検証で使用した機器

今回以下の機種にて検証しました。

メーカ 型番 ルータOS その他
Cisco NCS55A1 24Q6H SS IOS XR 7.11系 以降 NCS55A1 と表記
Cisco Catalyst9500-16X IOS XE 17.09系 以降 Cat9500 と表記
Juniper ACX7100-48L Junos OS Evolved 23.2系 以降 ACX7100 と表記

検証前提

設定の前提は以下の通りです。

項目 設定内容
モード Active
LACPDU送信間隔 1秒

LACPDU:Link Aggregation Control Protocol Data Units、LACP制御用フレームのこと

ネットワーク構成

今回以下のようなネットワーク構成で検証しました。

ネットワーク構成

各機器の設定

NCS55A1の設定

NCS55A1でLACPを使う場合、Bundle-Ether XXXという論理IFを作り、物理IF側の設定で bundle id XXX mode active という設定を入れることで論理IFのメンバーに追加します。

interface Bundle-Ether111                ←論理IFの作成
 description Cat9500 Po111
 ipv4 address 192.0.2.1 255.255.255.252

interface TenGigE0/0/0/16                ←以降物理IFの設定
 description Cat9500 Te1/0/11
 bundle id 111 mode active
 lacp period short
!
interface TenGigE0/0/0/17
 description Cat9500 Te1/0/12
 bundle id 111 mode active
 lacp period short
!
interface TenGigE0/0/0/18
 description Cat9500 Te1/0/13
 bundle id 111 mode active
 lacp period short

Cat9500の設定

Cat9500でLACPを使う場合、Port-Chanennl XXXという論理IFを作り、物理IF側の設定で channel-group XXX mode active という設定を入れることで論理IFのメンバーに追加します。
検証環境では2つの論理IF(Port-channel111とPort-channel121)を作っています。

interface Port-channel111                ←論理IFの作成
 description NCS55A1 BE111
 no switchport
 ip address 192.0.2.2 255.255.255.252
 no ip redirects

interface Port-channel121                 ←論理IFの作成
 description ACX7100 ae121
 no switchport
 ip address 192.0.2.6 255.255.255.252
 no ip redirects

interface TenGigabitEthernet1/0/11           ←以降物理IFの設定
 description NCS55A1 TenGigE0/0/0/16
 no switchport
 no ip address
 channel-group 111 mode active
  lacp rate fast
!
interface TenGigabitEthernet1/0/12
 description NCS55A1 TenGigE0/0/0/17
 no switchport
 no ip address
 channel-group 111 mode active
 lacp rate fast
!
interface TenGigabitEthernet1/0/13
 description NCS55A1 TenGigE0/0/0/18
 no switchport
 no ip address
 channel-group 111 mode active
 lacp rate fast
!
interface TenGigabitEthernet1/0/14
 description ACX7100 et-0/0/16
 no switchport
 no ip address
 channel-group 121 mode active
 lacp rate fast
!
interface TenGigabitEthernet1/0/15
 description ACX7100 et-0/0/17
 no switchport
 no ip address
 channel-group 121 mode active
 lacp rate fast
!
interface TenGigabitEthernet1/0/16
 description ACX7100 et-0/0/18
 no switchport
 no ip address
 channel-group 121 mode active
 lacp rate fast

ACX7100の設定

ACX7100でLACPを使う場合、ae XXXという論理IFを作り、物理IF側の設定で set interfaces et-0/0/YY ether-options 802.3ad aeXXX という設定を入れることで論理IFのメンバーに追加します。

set chassis aggregated-devices ethernet device-count 1
set interfaces et-0/0/16 description “CAT9500 Te1/0/14"          ←物理IFの設定
set interfaces et-0/0/16 ether-options 802.3ad ae121
set interfaces et-0/0/17 description “CAT9500 Te1/0/15"
set interfaces et-0/0/17 ether-options 802.3ad ae121
set interfaces et-0/0/18 description “CAT9500 Te1/0/16"
set interfaces et-0/0/18 ether-options 802.3ad ae121
set interfaces ae121 description “Cat9500 Po121"              ←論理IFの作成
set interfaces ae121 aggregated-ether-options lacp active
set interfaces ae121 aggregated-ether-options lacp periodic fast
set interfaces ae121 unit 0 family inet address 192.0.2.5/30

各機器の動作確認

NCS55A1の確認

論理インターフェースの確認

論理IFの状態の確認をするには show interfaces bundle-ether XXX というコマンドを入力します。
今回は"BW 30000000 "となっていることで帯域が30Gbpsあることや、TenGigE0/0/0/16~TenGigE0/0/0/18がメンバーであることが分かります。

RP/0/RP0/CPU0:NCS55A1#show interfaces bundle-ether 111
Bundle-Ether111 is up, line protocol is up
  Interface state transitions: 3
  Hardware is Aggregated Ethernet interface(s), address is 0caf.315f.dead
  Description: Cat9500 Po111
  Internet address is 192.0.2.1/30
  MTU 1514 bytes, BW 30000000 Kbit (Max: 30000000 Kbit)
     reliability 255/255, txload 60/255, rxload 6/255
  Encapsulation ARPA,
  Full-duplex, 30000Mb/s
  loopback not set,
  Last link flapped 3w6d
  ARP type ARPA, ARP timeout 04:00:00
    No. of members in this bundle: 3
      TenGigE0/0/0/16              Full-duplex  10000Mb/s    Active
      TenGigE0/0/0/17              Full-duplex  10000Mb/s    Active
      TenGigE0/0/0/18              Full-duplex  10000Mb/s    Active
  Last input 00:00:00, output 00:00:00
  Last clearing of "show interface" counters never
(以下略)

LACPの状態確認

show bundle bundle-ether XXX コマンドで指定したリンク バンドルに関する情報を確認出来ます。

RP/0/RP0/CPU0:NCS55A1#show bundle bundle-ether 111
Bundle-Ether111
  Status:                                    Up
  Local links <active/standby/configured>:   3 / 0 / 3
  Local bandwidth <effective/available>:     30000000 (30000000) kbps
  MAC address (source):                      0caf.315f.dead (Chassis pool)
  Inter-chassis link:                        No
  Minimum active links / bandwidth:          1 / 1 kbps
  Maximum active links:                      64
  Wait while timer:                          2000 ms
  Load balancing:
    Link order signaling:                    Not configured
    Hash type:                               Default
    Locality threshold:                      None
  LACP:                                      Operational
    Flap suppression timer:                  Off
    Cisco extensions:                        Disabled
    Non-revertive:                           Disabled
  mLACP:                                     Not configured
  IPv4 BFD:                                  Not configured
  IPv6 BFD:                                  Not configured

  Port                  Device           State        Port ID         B/W, kbps
  --------------------  ---------------  -----------  --------------  ----------
  Te0/0/0/16            Local            Active       0x8000, 0x0003    10000000
      Link is Active
  Te0/0/0/17            Local            Active       0x8000, 0x0002    10000000
      Link is Active
  Te0/0/0/18            Local            Active       0x8000, 0x0001    10000000
     Link is Active

show lacp bundle bundle-ether XXX で 指定したLACP ポートとそのピアに関する情報を表示できます。

RP/0/RP0/CPU0:NCS55A1#show lacp bundle bundle-ether 111
State: a - Port is marked as Aggregable.
       s - Port is Synchronized with peer.
       c - Port is marked as Collecting.
       d - Port is marked as Distributing.
       A - Device is in Active mode.
       F - Device requests PDUs from the peer at fast rate.
       D - Port is using default values for partner information.
       E - Information about partner has expired.

Bundle-Ether111
  Port          (rate)  State    Port ID       Key    System ID
  --------------------  -------- ------------- ------ ------------------------
Local
  Te0/0/0/16        1s  ascdAF-- 0x8000,0x0003 0x006f 0x8000,0c-af-31-5f-64-e2
   Partner          1s  ascdAF-- 0x8000,0x010c 0x006f 0x8000,e4-1f-7b-a8-53-00
  Te0/0/0/17        1s  ascdAF-- 0x8000,0x0002 0x006f 0x8000,0c-af-31-5f-64-e2
   Partner          1s  ascdAF-- 0x8000,0x010d 0x006f 0x8000,e4-1f-7b-a8-53-00
  Te0/0/0/18        1s  ascdAF-- 0x8000,0x0001 0x006f 0x8000,0c-af-31-5f-64-e2
   Partner          1s  ascdAF-- 0x8000,0x010e 0x006f 0x8000,e4-1f-7b-a8-53-00

  Port                  Receive    Period Selection  Mux       A Churn P Churn
  --------------------  ---------- ------ ---------- --------- ------- -------
Local
  Te0/0/0/16            Current    Fast   Selected   Distrib   None    None
  Te0/0/0/17            Current    Fast   Selected   Distrib   None    None
  Te0/0/0/18            Current    Fast   Selected   Distrib   None    None

show bundle brief でサマリを表示できます。

RP/0/RP0/CPU0:NCS55A1#show bundle brief

Name   | IG       | State         | LACP | BFD |     Links     | Local b/w, |
       |          |               |      |     | act/stby/cfgd |    kbps    |
-------|----------|---------------|------|-----|---------------|------------|
BE111            - Up              On     Off         3 / 0 / 3     30000000

Cat9500の動作確認

論理IFの確認

論理IFの状態の確認をするには show interfaces Port-channel XXX というコマンドを入力します。
"BW 30000000"となっていることで帯域が30Gbpsになっていることが分かります。

Cat9500#show interfaces Port-channel 111
Port-channel111 is up, line protocol is up (connected)
  Hardware is EtherChannel, address is e41f.7ba8.dead (bia e41f.7ba8.dead)
  Description: NCS55A1 Be111
  Internet address is 192.0.2.2/30
  MTU 1500 bytes, BW 30000000 Kbit/sec, DLY 10 usec,
     reliability 255/255, txload 7/255, rxload 60/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 10Gb/s, link type is auto, media type is N/A
  input flow-control is on, output flow-control is unsupported
  Members in this channel: Te1/0/11 Te1/0/12 Te1/0/13
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/375/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 7060379000 bits/sec, 699128 packets/sec
  5 minute output rate 838885000 bits/sec, 264633 packets/sec
(以下略)

Cat9500#show interfaces Port-channel 121
Port-channel121 is up, line protocol is up (connected)
  Hardware is EtherChannel, address is e41f.7ba8.beef (bia e41f.7ba8.beef)
  Description: ACX7100 ae121
  Internet address is 192.0.2.6/30
  MTU 1500 bytes, BW 30000000 Kbit/sec, DLY 10 usec,
     reliability 255/255, txload 6/255, rxload 54/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 10Gb/s, link type is auto, media type is N/A
  input flow-control is on, output flow-control is unsupported
  Members in this channel: Te1/0/14 Te1/0/15 Te1/0/16
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 1/375/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 6468673000 bits/sec, 652838 packets/sec
  5 minute output rate 797975000 bits/sec, 281978 packets/sec
(以下略)

LACPの状態確認

show etherchannel summary コマンドでサマリを表示できます。

Cat9500#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      f - failed to allocate aggregator

        M - not in use, 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
------+-------------+-----------+-----------------------------------------------
111    Po111(RU)       LACP        Te1/0/11(P)     Te1/0/12(P)
                                   Te1/0/13(P)
121    Po121(RU)       LACP        Te1/0/14(P)     Te1/0/15(P)
                                   Te1/0/16(P)

show lacp internal コマンドで自身のLACPの状態を確認できます。

Cat9500#show lacp internal

Flags:  S - Device is requesting Slow LACPDUs
        F - Device is requesting Fast LACPDUs
        A - Device is in Active mode       P - Device is in Passive mode

Channel group 111
                                LACP port    Admin     Oper    Port        Port
Port          Flags   State     Priority     Key       Key     Number      State
Te1/0/11      FA      bndl      32768        0x6F      0x6F    0x10C       0x3F
Te1/0/12      FA      bndl      32768        0x6F      0x6F    0x10D       0x3F
Te1/0/13      FA      bndl      32768        0x6F      0x6F    0x10E       0x3F

Channel group 121
                                LACP port    Admin     Oper    Port        Port
Port          Flags   State     Priority     Key       Key     Number      State
Te1/0/14      FA      bndl      32768        0x79      0x79    0x10F       0x3F
Te1/0/15      FA      bndl      32768        0x79      0x79    0x110       0x3F
Te1/0/16      FA      bndl      32768        0x79      0x79    0x111       0x3F

show lacp neighbor コマンドで対向の機器のLACPの状態を確認できます。

Cat9500#show lacp neighbor

Flags:  S - Device is requesting Slow LACPDUs
        F - Device is requesting Fast LACPDUs
        A - Device is in Active mode       P - Device is in Passive mode

Channel group 111 neighbors
                     LACP port                      Admin  Oper   Port    Port
Port          Flags  Priority  Dev ID          Age  key    Key    Number  State
Te1/0/11      FA     32768     0caf.315f.dead   0s  0x0    0x6F   0x3     0x3F
Te1/0/12      FA     32768     0caf.315f.dead   0s  0x0    0x6F   0x2     0x3F
Te1/0/13      FA     32768     0caf.315f.dead   0s  0x0    0x6F   0x1     0x3F

Channel group 121 neighbors
                     LACP port                      Admin  Oper   Port    Port
Port          Flags  Priority  Dev ID          Age  key    Key    Number  State
Te1/0/14      FA     127       d499.6c30.beef   0s  0x0    0x7A   0x7     0x3F
Te1/0/15      FA     127       d499.6c30.beef   0s  0x0    0x7A   0x8     0x3F
Te1/0/16      FA     127       d499.6c30.beef   0s  0x0    0x7A   0x9     0x3F

ACX7100の動作確認

論理IFの確認

論理IFの状態の確認をするにはshow interfaces aeXXX というコマンドを入力します。
"Speed: 30Gbps"となっていることで帯域が30Gbpsであることや、et-0/0/16~et-0/0/18がメンバーであることが分かります。

staff@ACX7100> show interfaces ae121
Physical interface: ae121, Enabled, Physical link is Up
  Interface index: 1006, SNMP ifIndex: 629
  Description: Cat9500 Po121
  Link-level type: Ethernet, MTU: 1514, Speed: 30Gbps, BPDU Error: None, Ethernet-Switching (略)
  Minimum bandwidth needed: 1bps
  Device flags   : Present Running
  Interface flags: SNMP-Traps
  Current address: d4:99:6c:30:be:ef, Hardware address: d4:99:6c:30:be:ef
  Last flapped   : 2024-10-20 01:55:47 JST (4w 2d 03:52 ago)
  Input rate     : 401583640 bps (105598 pps)
  Output rate    : 1860689400 bps (203307 pps)
  Members:
      Statistics      Packets        pps            Bytes          bps
      et-0/0/16
        Input :  632333726878      41788  235416545861051    126290608
        Output: 1555354378459      56352 1929673215915529    480391240
      et-0/0/17
        Input :  634535433085      34222  231549019053309    149206296
        Output: 1591220404465      71002 1952080799578670    657269640
      et-0/0/18
        Input :  622655972586      29588  233813946364793    126086736
        Output: 1564874939669      75953 1931954891739263    723028520

  (以下略)

LACPの状態確認

show lacp interfaces aeXXX名でメンバーとなる物理IFや自身のポート(Actor)と対向するポート(Partner)の状態が分かります。

staff@ACX7100> show lacp interfaces ae121
Aggregated interface: ae121
    LACP state:       Role   Exp   Def  Dist  Col  Syn  Aggr  Timeout  Activity
      et-0/0/16      Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active
      et-0/0/16    Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active
      et-0/0/17      Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active
      et-0/0/17    Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active
      et-0/0/18      Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active
      et-0/0/18    Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active
    LACP protocol:        Receive State  Transmit State          Mux State
      et-0/0/16                 Current   Fast periodic Collecting distributing
      et-0/0/17                 Current   Fast periodic Collecting distributing
      et-0/0/18                 Current   Fast periodic Collecting distributing
  (以下略)

まとめ

各機器の設定/確認コマンド

NCS55A1(IOS XR)

  • 論理IF名は Bundle-Ether XXX
  • 物理IFには bundle id XXX mode active で関連づけ
  • LACP関連確認コマンドは以下
show bundle bundle-ether XXX
show bundle brief
show lacp bundle bundle-ether XXX

Cat9500(IOS XE)

  • 論理IF名は Port-channel XXX
  • 物理IFには channel-group XXX mode active で関連づけ
  • LACP関連確認コマンドは以下
show etherchannel summary
show lacp internal
show lacp neighbor

ACX7100(Junos OS Evolved)

  • 論理IF名は aeXXX
  • 物理IFには set interfaces et-0/0/YY ether-options 802.3ad aeXXX で関連づけ
  • LACP関連確認コマンドは以下
show lacp interfaces aeXXX

その他

  • 設定コマンドや確認コマンドを覚える前に、そもそもプロトコルや仕様をよく理解する必要があります。
  • メーカや、機種、ルータOS毎に設定コマンドや確認コマンドが異なるため注意が必要です。
  • 特に LACPDUの送信間隔の表記がルータOSによって、short/long だったり、fast/normal だったり、fast/slow だったりするので注意が必要です。