소개
이 문서에서는 Nexus 9000에서 mac 이동이 있을 때 문제를 해결하는 방법과 이를 방지하는 방법에 대해 설명합니다.
배경 정보
2018 Nov 14 15:53:26.943 N9K %-SLOT1-5-BCM_L2_LEARN_DISABLE: MAC Learning Disabled unit=0
2018 Nov 14 15:53:27.769 N9K %-SLOT1-5-BCM_L2_LEARN_ENABLE: MAC Learning Enabled unit=0
스위치에서 프레임을 수신하고 발신자의 MAC 주소를 수신한 LAN 포트와 연결할 때, 스위치에서 테이블이 어떻게 유지되는지 그리고 mac 학습의 개념을 이해하게 됩니다. 루프 조건에서는 동일한 MAC이 스위치의 서로 다른 두 포트를 통해 학습될 수 있습니다.
사전 요구 사항
스위치 및 NX-OS 컨피그레이션의 mac-learning 개념 이해
레이어 2 스위칭 문제 해결
토폴로지
+-----------+ Po6 +------------+
| N9K_1 +----------+ N9K_2 |
| +----------+ |
+-----------+ +--+---------+
1/3 | | 2/1
| |
| |
+-+---------------+--+
| Server |
+--------------------+
0000.117d.e02e
문제 해결 방법
BCM ASIC가 짧은 기간에 너무 많은 mac 주소를 학습하면 BCM_USD는 하드웨어에서 MAC 학습을 비활성화/활성화할 수 있으며 이 메시지가 나타납니다. 너무 많은 mac-moves/flaps/loops 또는 새로운 mac learn/moves가 특정 임계값을 초과하는 경우 발생할 수 있습니다. 기본적으로 Nexus9K에서는 스위치에 mac-moves가 있음을 구체적으로 알려주는 로그를 볼 수 없습니다. 그러나 이러한 움직임이 높을 경우 이러한 로그를 보게 됩니다.
2018 Nov 14 15:53:26.943 N9K %-SLOT1-5-BCM_L2_LEARN_DISABLE: MAC Learning Disabled unit=0
2018 Nov 14 15:53:27.769 N9K %-SLOT1-5-BCM_L2_LEARN_ENABLE: MAC Learning Enabled unit=0
2018 Nov 14 15:53:27.863 N9K %-SLOT1-5-BCM_L2_LEARN_DISABLE: MAC Learning Disabled unit=0
2018 Nov 14 15:53:28.770 N9K %-SLOT1-5-BCM_L2_LEARN_ENABLE: MAC Learning Enabled unit=0
이러한 메시지는 mac 테이블의 이벤트를 나타냅니다. 환경에서 mac 이동이 지속되면 이러한 메시지를 볼 수 있습니다. 기본적으로 스위치는 두 개 이상의 인터페이스에서 동일한 소스 MAC의 프레임을 매우 빠른 속도로 수신했습니다. 스위치에는 MAC "move-back"의 수를 계산하고 MAC 주소가 이동하는 횟수를 기준으로 무게를 측정하는 메커니즘이 있습니다. 동적 MAC 학습은 제어 평면을 보호하기 위해 스위치에 의해 비활성화됩니다.
이 시점에서 mac-move 카운트를 확인하여 디바이스에서 발생한 mac-move가 몇 건인지,
N9K# sh mac address-table notification mac-move
MAC Move Notify Triggers: 1
Number of MAC Addresses added: 612336
Number of MAC Addresses moved: 612328
Number of MAC Addresses removed: 0
"Number of MAC Addresses moved(이동된 MAC 주소 수)"의 출력은 스위치가 mac-moves를 경험했음을 나타냅니다.
설정
다음으로 명백한 것은 이 문제의 원인이 되는 mac 주소, vlan, 그리고 이 문제가 발생하는 인터페이스 정보를 파악하는 것입니다. 이 정보를 찾으려면 N9K 플랫폼에서 L2FM의 로깅 레벨을 기본값인 2에서 최대 5까지 높여야 합니다.
N9K# sho logging level l2fm
Facility Default Severity Current Session Severity
-------- ---------------- ------------------------
l2fm 2 2
0(emergencies) 1(alerts) 2(critical)
3(errors) 4(warnings) 5(notifications)
6(information) 7(debugging)
N9K# conf t
Enter configuration commands, one per line. End with CNTL/Z.
N9K(config)# logging level l2fm 5
N9K(config)# end
N9K# sho logging level l2fm
Facility Default Severity Current Session Severity
-------- ---------------- ------------------------
l2fm 2 5
0(emergencies) 1(alerts) 2(critical)
3(errors) 4(warnings) 5(notifications)
6(information) 7(debugging)
Any mac moves at this point can be seen in the syslogs:
2018 Nov 14 16:04:23.881 N9K %L2FM-4-L2FM_MAC_MOVE2: Mac 0000.117d.e02e in vlan 741 has moved between Po6 to Eth1/3
2018 Nov 14 16:04:23.883 N9K %L2FM-4-L2FM_MAC_MOVE2: Mac 0000.117d.e02e in vlan 741 has moved between Po6 to Eth1/3
이러한 경우 MAC 주소가 한 포트에서 다른 포트로 이동하는 횟수를 탐지하고 제한할 수 있습니다.
Cisco NX-OS Release 6.0(2)U3(1)까지 두 포트 간에 루프가 탐지되면 MAC 학습이 180초 동안 비활성화되었습니다.
그러나 7.0(3)I7(3)부터 시작하면 이제 "mac address-table loop-detect port-down" 명령을 사용할 때 이러한 루프가 탐지되면 하위 인터페이스 인덱스로 포트를 종료하도록 스위치를 구성할 수 있습니다.
N9K# conf t
Enter configuration commands, one per line. End with CNTL/Z.
N9K(config)# mac address-table loop-detect port-down
N9K(config)# exit
N9K#
이제 이 명령이 활성화된 후 추가 루프 탐지가 수행되면 인터페이스 인덱스가 더 낮은 인터페이스가 중단됩니다.
2018 Nov 13 19:33:54.773 N9K %ETHPORT-5-IF_DOWN_NONE: Interface port-channel6 is down (None)
2018 Nov 13 19:33:59.046 N9K %ETH_PORT_CHANNEL-5-PORT_DOWN: port-channel6: Ethernet2/1 is down
2018 Nov 13 19:33:59.049 N9K %ETH_PORT_CHANNEL-5-PORT_DOWN: port-channel6: Ethernet2/2 is down
2018 Nov 13 19:33:59.166 N9K %ETH_PORT_CHANNEL-5-FOP_CHANGED: port-channel6: first operational port changed from Ethernet2/1 to none
2018 Nov 13 19:33:59.235 N9K %ETHPORT-5-IF_DOWN_ERROR_DISABLED: Interface port-channel6 is down (Error disabled. Reason:error)
2018 Nov 13 19:33:59.244 N9K %ETHPORT-5-IF_DOWN_CFG_CHANGE: Interface Ethernet2/2 is down(Config change)
2018 Nov 13 19:33:59.252 N9K %ETHPORT-5-IF_DOWN_CFG_CHANGE: Interface Ethernet2/1 is down(Config change)
2018 Nov 13 19:34:05.269 N9K %ETHPORT-5-IF_DOWN_CHANNEL_ERR_DISABLED: Interface Ethernet2/2 is down (Channel error disabled)
2018 Nov 13 19:34:05.303 N9K last message repeated 1 time
2018 Nov 13 19:34:05.303 N9K %ETHPORT-5-IF_DOWN_CHANNEL_ERR_DISABLED: Interface Ethernet2/1 is down (Channel error disabled)
다음을 확인합니다.
현재 구성된 작업을 확인하려면 이 명령을 사용합니다.
N9K# show mac address-table loop-detect
Port Down Action Mac Loop Detect : disabled
기능에 따라 인터페이스의 인덱스를 확인하여 올바른 인터페이스가 비활성화되었는지 확인할 수 있습니다.
N9K# show system internal l2fm l2dbg macdb address 0000.117d.e02e vlan 741
Legend
------
Db: 0-MACDB, 1-GWMACDB, 2-SMACDB, 3-RMDB, 4-SECMACDB 5-STAGEDB
Src: 0-UNKNOWN, 1-L2FM, 2-PEER, 3-LC, 4-HSRP
5-GLBP, 6-VRRP, 7-STP, 8-DOTX, 9-PSEC 10-CLI 11-PVLAN
12-ETHPM, 13-ALW_LRN, 14-Non_PI_MOD, 15-MCT_DOWN, 16 - SDB
17-OTV, 18-Deounce Timer, 19-AM, 20-PCM_DOWN, 21 - MCT_UP
22-VxLAN, 23-L2RIB 24-CTRL, 25-UFDM
Slot:0 based for LCS 31-MCEC 20-OTV/ORIB
VLAN: 741 MAC: 0000.117d.e02e
Time If/swid Db Op Src Slot FE
Wed Nov 14 16:04:28 2018 0x16000005 0 UPDATE 3 0 0
Wed Nov 14 16:04:28 2018 0x16000005 0 REFRESH_DETECT 3 0 15
Wed Nov 14 16:04:28 2018 0x1a000400 0 UPDATE 3 0 0
Wed Nov 14 16:04:28 2018 0x1a000400 0 REFRESH_DETECT 3 0 15
Wed Nov 14 16:04:28 2018 0x16000005 0 UPDATE 3 0 0
N9K# show int snmp-ifindex
--------------------------------------------------------------------------------
Port IFMIB Ifindex (hex)
--------------------------------------------------------------------------------
mgmt0 83886080 (0x5000000 )
Eth1/1 436207616 (0x1a000000)
Eth1/2 436208128 (0x1a000200)
Eth1/3 436208640 (0x1a000400)
<snip>
Po6 369098757 (0x16000005)
기타 플랫폼
이러한 명령을 사용하여 다른 Nexus 플랫폼에서 mac 이동 알림을 활성화할 수 있습니다.
N3K:
mac address table notification mac-move
logging level fwm 6
logging monitor 6
N5K/N6K:
mac address table notification mac-move
logging level fwm 6
logging monitor 6
N7K/N9K:
logging level l2fm 5
IOS:
mac address table notification mac-move
Note: To revert/remove these commands, simply use the `no` version of each command.
이러한 명령은 버전 6.0(2)N2(1) 이상을 실행하는 Nexus5K/6K에서도 사용할 수 있어 포트를 종료합니다.
N5K(config)# mac address-table loop-detect ?
port-down Take port-down action for mac loop detection
N5K(config)# mac address-table loop-detect port-down
Further, the following command is available on the platform to err-disable the edge-port on the MAC move loop detection,
N5K(config)# mac address-table loop-detect port-down edge-port
Nexus 3000의 NX-OS 릴리스 6.0(2)A8(1)에서는 이러한 루프가 탐지될 때 인터페이스 인덱스가 더 낮은 포트를 종료하도록 작업을 구성할 수 있습니다.
N3K(config)# mac address-table loop-detect ?
port-down Take port-down action for mac loop detection
N3K(config)# mac address-table loop-detect port-down
The following command is available on this platform as well, to err-disable the edge-port on the MAC move loop detection,
N5K(config)# mac address-table loop-detect port-down edge-port
유용한 링크