PowerScale: Tcpdump를 사용하여 스위치 정보를 수집하는 방법
Summary: 이 문서에서는 패킷 캡처 툴을 사용하여 기본 스위치 정보를 수집하는 방법에 대해 설명합니다.
Instructions
이더넷 네트워크 스위치는 일반적으로 다음과 같은 포트 정보를 브로드캐스트합니다 port name, port description, system name, system description및 native vlan. CDP(Cisco Discovery Protocol)는 Cisco 스위치 플랫폼 전용입니다. LLDP(Link Layer Discovery Protocol)는 업계 표준에 가깝습니다.
이 항목에 대한 자세한 정보:
CDP - LLDP https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/cdp/configuration/15-mt/cdp-15-mt-book/nm-cdp-discover.html
- https://www.cisco.com/c/en/us/td/docs/routers/ncs4000/software/configure/guide/configurationguide/configurationguide_chapter_0111011.pdf
이 정보는 엔지니어가 노드 인터페이스가 물리적으로 연결될 수 있는 스위치 포트를 식별하는 데 도움이 될 수 있습니다. 케이블을 잘못된 스위치 포트에 연결하거나 포트 채널이 잘못된 물리적 포트로 구성될 수 있습니다. 포트를 식별하면 네트워크 엔지니어가 해당 인터페이스에 구성된 내용과 올바른지 신속하게 확인할 수 있습니다.
"주의 사항/문제"
- 이
tcpdump명령은 논리적 인터페이스에서 실행하면 안 됩니다. laggX 또는 vlanX와 같은 정보는 물리적 인터페이스에만 해당됩니다. - 이
tcpdump명령은 물리적 인터페이스에서만 실행해야 합니다. 1G, 10G, 25G, 40G 등입니다 - 인터페이스 쌍으로 데이터를 수집하는 것이 가장 좋습니다. 즉, mce 인터페이스에서 어그리게이션 문제를 조사하는 경우 mce2에서 수집한 다음 mce3에서 수집합니다.
- 노드의 인터페이스 상태가 "캐리어 없음"이면 패킷이 제대로 수신되지 않습니다. 이 문제는 물리적인 문제부터 해결해야 합니다.
- CDP/LLDP 트래픽(느림)은 스위치 포트에서 25-35초 사이에 전송됩니다.
- 시작 후 120초 후에도 출력이 없는 경우
tcpdump, 명령을 종료합니다. 스위치가 패킷을 전송하지 않을 수 있습니다.
다음 tcpdump 명령은 CDP 패킷만 수신하고 패킷을 인쇄한 다음 실행을 중지합니다(수동으로 인터페이스 입력).
tcpdump -ni <iface> -v -s0 -c1 '(ether[20:2]=0x2000)'
다음 tcpdump 명령은 LLDP 패킷만 수신하고 패킷을 인쇄한 다음 실행을 중지합니다(수동으로 인터페이스 입력).
tcpdump -ni <iface> -v -s0 -c1 '(ether[12:2]=0x88cc)'
다음 tcpdump 명령은 LLDP 및 CDP 패킷을 수신하고 수신된 첫 번째 패킷을 인쇄한 다음 실행을 중지합니다(수동으로 인터페이스 입력).
tcpdump -ni <iface> -v -s0 -c1 '(ether[12:2]=0x88cc or ether[20:2]=0x2000)'
Additional Information
사용할 명령은 스위치 공급업체에 따라 다릅니다.
CDP의 예(출력은 달라질 수 있음):
isilon-1# tcpdump -ni cxgb0 -v -s0 -c1 '(ether[20:2]=0x2000)'
tcpdump: WARNING: cxgb0: no IPv4 address assigned
tcpdump: listening on cxgb0, link-type EN10MB (Ethernet), capture size 65535 bytes
13:09:18.942158 CDPv2, ttl: 180s, checksum: 692 (unverified), length 248
Device-ID (0x01), length: 25 bytes: 'nx-5k(XXXXXXXXXXX)'
Address (0x02), length: 13 bytes: IPv4 (1) Y.Y.Y.Y
Port-ID (0x03), length: 11 bytes: 'Ethernet1/2'
Capability (0x04), length: 4 bytes: (0x00000228): L2 Switch, IGMP snooping
Version String (0x05), length: 66 bytes:
Cisco Nexus Operating System (NX-OS) Software, Version 4.1(3)N2(1)
Platform (0x06), length: 14 bytes: 'N5K-C5010P-BFS'
Native VLAN ID (0x0a), length: 2 bytes: 1XX
Duplex (0x0b), length: 1 byte: full
MTU (0x11), length: 4 bytes: 1500 bytes
System Name (0x14), length: 12 bytes: 'nx-5k'
System Object ID (not decoded) (0x15), length: 14 bytes:
0x0000: XYXY XYXY XYXY XYXY XYXY XYXY XYXY
Management Addresses (0x16), length: 13 bytes: IPv4 (1) Y.Y.Y.Y
Physical Location (0x17), length: 13 bytes: 0x00/snmplocation
1 packet captured
25 packets received by filter
0 packets dropped by kernel
LLDP의 예(출력은 달라질 수 있음):
isilon-1# tcpdump -ni ix0 -v -s0 -c1 '(ether[12:2]=0x88cc)'
tcpdump: WARNING: ix0: no IPv4 address assigned
tcpdump: listening on ix0, link-type EN10MB (Ethernet), capture size 65535 bytes
18:12:46.442857 LLDP, length 282
Chassis ID TLV (1), length 7
Subtype MAC address (4): xy:xy:xy:xy:xy:xy
Port ID TLV (2), length 13
Subtype Interface Name (5): Ethernet1/13
Time to Live TLV (3), length 2: TTL 120s
Port Description TLV (4), length 12: isi_node
System Name TLV (5), length xy: XXXXXX
System Description TLV (6), length 161
Cisco Nexus Operating System (NX-OS) Software ...truncated
System Capabilities TLV (7), length 4
System Capabilities [Bridge, Router] (0x0014)
Enabled Capabilities [Bridge, Router] (0x0014)
Management Address TLV (8), length 12
Management Address length 5, AFI IPv4 (1): Y.Y.Y.Y
Interface Index Interface Numbering (2): 1
Organization specific TLV (127), length 5: OUI Unknown (0x000142)
0x0000: 0001 XYXY XY
Organization specific TLV (127), length 6: OUI Ethernet bridged (0x0080c2)
Port VLAN Id Subtype (1)
port vlan id (PVID): 1XX
Management Address TLV (8), length 14
Management Address length 7, AFI 802 (6): xy:xy:xy:xy:xy:xy
Interface Index Interface Numbering (2): 1
End TLV (0), length 0
1 packet captured
3 packets received by filter
0 packets dropped by kernel