LACP in N9K

오백만원 2021. 4. 4. 01:44

<Port Channels>

 

포트 채널(etherchannel in IOS, port sharing in EXOS)은 여러 개의 물리적인 포트를 하나의 논리적인 포트로 묶는 것이다. 

-> Increased bandwidth(*load balanced) 

-> Redundancy(stays operational as long as at least one physical interface within the port channel is operational)  

 

- N9K 기준 static, LACP 모두 32개까지 묶을 수 있다. 

- L2 포트채널 구성을 완료한 이후 모든 설정은 포트채널에 해야 한다. (하더라도 적용되지 않거나 포트채널에 적용된 설정이 우선한다)

 

 

<Port Channels - Compatibility Requirements>

 

- Network Layer (you cannot add a Layer 3 interface to a Layer 2 channel group)

- Speed Capability & Configuration

- Duplex Capability & Configuration

- Media type (fiber of copper)

- Port mode 

- VLAN Configuration (Access VLAN / Trunk native VLAN / Tagged or untagged / Allowed VLAN list)

- MTU Size

- SPAN (you cannot add a SPAN source or a destination port) 

- Flow-control Capacity & Configuration

등등,, 중에서 빨강색만 전부 맞으면 강제로 add 가능하고 (force) 

switch(config)# int eth1/4
switch(config-if)# channel-group 1 force

show port-channel compatibility-parameters 명령어로 설명과 함께 호환성 인자들을 확인할 수 있다. 

switch# show port-channel compatibility-parameters 
* port mode . . . . 

 

 

<Port Channels - Load Balancing>

 

- 디폴트로 제공되며, L2(==Non-IP)는 src-dst mac , L3(==IP)는 src-dst ip-l4port 방식이 디폴트이다.

switch# show port-channel load-balance 
 System config: 
  Non-IP: src-dst mac 
  IP: src-dst ip-l4port  rotate 0
Port Channel Load-Balancing Configuration for all modules:
Module 1:
  Non-IP: src-dst mac
  IP: src-dst ip-l4port rotate 0

- 로드밸런싱 모드는 모든 포트채널에 적용된다. (포트채널마다 다르게 설정할 수 없다) 

- symmetric hashing(inbound/outbound traffic이 동일한 물리 포트를 타는) 을 제공하는 알고리즘은 src-dst ip, src-dst ip-l4port(L3 default) 이다.  

 

 

<channel modes for individual links in a port channel>

 

- passive (in LACP negotiation) : LACP가 설정되어 있고, LACP 패킷에는 응답은 하지만 LACP 협상을 먼저 시도하지는 않는다.

- active (in LACP negotiation) : LACP가 설정되어 있고, LACP 패킷을 보내며 협상을 먼저 시도한다. 

- on (static) : 디폴트 모드. LACP가 설정되어 있지 않고, LACP 패킷에 응답하지 않아 협상 불가, LACP 채널에 조인하지 못한다. 

 

 

 

<LACP>

 

Link Aggregation Control Protocol, IEEE 802.1AX, IEEE 802.1ad 에 정의된 표준 프로토콜이다. 

 

<LACP channel modes>

 

- passive (in negotiation) : LACP가 설정되어 있고, LACP 패킷에는 응답은 하지만 LACP 협상을 먼저 시도하지는 않는다.

- active (in negotiation) : LACP가 설정되어 있고, LACP 패킷을 보내며 협상을 먼저 시도한다. 

-> 양쪽 다 passive 모드인 경우 협상 불가

 

<LACP ID Parameters>

 

- LACP system priority

  LACP를 구성한 시스템은 모두 LACP system priority 값을 가진다. (디폴트 32768, 1~65535 값으로 설정 가능) 

  LACP는 이 LACP system priority 값과 MAC Addr 값으로 system ID를 만들고 다른 장비들과의 LACP 협상에 사용한다. 

 LACP system ID = LACP system priority & MAC Addr

 

- LACP port priority 

  LACP가 설정된 포트는 모두 LACP port priority 값을 가진다. (디폴트 32768, 1~65535 값으로 설정 가능) 

 port ID = LACP port priority & port number

 

 

switch(config)# feature lacp

<LACP L2, switch: active, switch2: passive mode>

switch(config)# int eth1/1-4
switch(config-if-range)# channel-group 1 mode active
switch(config)# int po1
switch(config-if)# switchport access vlan 100
switch(config-if-range)# show port-channel sum
Flags:  D - Down        P - Up in port-channel (members)
        I - Individual  H - Hot-standby (LACP only)
        s - Suspended   r - Module-removed
        b - BFD Session Wait
        S - Switched    R - Routed
        U - Up (port-channel)
        p - Up in delay-lacp mode (member)
        M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports      Channel
--------------------------------------------------------------------------------
1     Po1(SU)     Eth      LACP      Eth1/1(P)    Eth1/2(P)    Eth1/3(P)
                                     Eth1/4(P)    

 

switch-2(config-if-range)# int eth1/1-4
switch-2(config-if-range)# channel-group 1 mode passive
switch-2(config-if-range)# show port-channel sum
Flags:  D - Down        P - Up in port-channel (members)
        I - Individual  H - Hot-standby (LACP only)
        s - Suspended   r - Module-removed
        b - BFD Session Wait
        S - Switched    R - Routed
        U - Up (port-channel)
        p - Up in delay-lacp mode (member)
        M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports      Channel
--------------------------------------------------------------------------------
1     Po1(SU)     Eth      LACP      Eth1/1(P)    Eth1/2(P)    Eth1/3(P)
                                     Eth1/4(P)    

 

 

 

<LACP L3, switch: active, switch2: passive mode>

switch(config)# int eth1/5-8 
switch(config-if-range)# no shut
switch(config-if-range)# channel-group 2 mode active
switch(config-if-range)# int po2
switch(config-if)# no switchport
switch(config-if)# ip address 1.1.1.1/24
switch(config-if)# show port-channel sum
Flags:  D - Down        P - Up in port-channel (members)
        I - Individual  H - Hot-standby (LACP only)
        s - Suspended   r - Module-removed
        b - BFD Session Wait
        S - Switched    R - Routed
        U - Up (port-channel)
        p - Up in delay-lacp mode (member)
        M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports      Channel
--------------------------------------------------------------------------------
1     Po1(SD)     Eth      LACP      Eth1/1(D)    Eth1/2(D)    Eth1/3(D)
                                     Eth1/4(D)    
2     Po2(RU)     Eth      LACP      Eth1/5(P)    Eth1/6(P)    Eth1/7(P)
                                     Eth1/8(s) 
switch-2(config)# int eth1/5-8 
switch-2(config-if-range)# no shut
switch-2(config-if-range)# channel-group 2 mode passive
switch-2(config-if-range)# int po2
switch-2(config-if)# no switchport 
switch-2(config-if)# ip addr 1.1.1.10/24
switch-2(config-if)# end
switch-2# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
36 bytes from 1.1.1.10: Destination Host Unreachable
Request 0 timed out
64 bytes from 1.1.1.1: icmp_seq=1 ttl=254 time=69.097 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=254 time=11.788 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=254 time=7.533 ms
switch-2(config-if)# show port-channel sum
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports Channel
--------------------------------------------------------------------------------
1     Po1(SD)     Eth      LACP      Eth1/1(s)    Eth1/2(s)    Eth1/3(s)
                                     Eth1/4(s)    
2     Po2(RU)     Eth      LACP      Eth1/5(P)    Eth1/6(P)    Eth1/7(P)
                                     Eth1/8(s)    

 

Eth1/8이 올라오지 않고 suspending 상태지만 포트 채널은 UP이다.

lacp min-links 설정을 해 보았다.  (RM, 연동 끊김) 

 

switch(config-if)# int po2
switch(config-if)# lacp min-links 4
switch(config-if)# show port-channel sum
Flags:  D - Down        P - Up in port-channel (members)
        I - Individual  H - Hot-standby (LACP only)
        s - Suspended   r - Module-removed
        b - BFD Session Wait
        S - Switched    R - Routed
        U - Up (port-channel)
        p - Up in delay-lacp mode (member)
        M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports      Channel
--------------------------------------------------------------------------------
1     Po1(SD)     Eth      LACP      Eth1/1(D)    Eth1/2(D)    Eth1/3(D) 
                                     Eth1/4(D)    
2     Po2(RM)     Eth      LACP      Eth1/5(D)    Eth1/6(D)    Eth1/7(D)
                                     Eth1/8(D)   
switch(config-if)# ping 1.1.1.10
PING 1.1.1.10 (1.1.1.10): 56 data bytes
ping: sendto 1.1.1.10 64 chars, No route to host
Request 0 timed out
ping: sendto 1.1.1.10 64 chars, No route to host
Request 1 timed out
ping: sendto 1.1.1.10 64 chars, No route to host
^C
--- 1.1.1.10 ping statistics ---
3 packets transmitted, 0 packets received, 100.00% packet loss

 

 

 

 

 

 

 

 

아래 링크를 보고 공부했다. 

www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/interfaces/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_Interfaces_Configuration_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Interfaces_Configuration_Guide_chapter_0110.html#concept_98946DAEC5AA41B085E5D04709CDCB4B