취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 
cancel
505
VIEWS
0
Helpful
0
의견
socui
Cisco Employee
Cisco Employee
 
Ethanalzyer ?
NX-OS 에 내장된, Front-panel port 로부터 CPU로 (inband); mgmt port 로 부터 CPU로 (mgmt) 로 연결된 링크에서 패킷을 캡쳐하는 도구로서, CPU로 향하거나 CPU 가 생성한 패킷을 분석하는 Tool 입니다.
Nexus 9K,7K,5K,3K 모두 사용 가능합니다.
 
사용 시나리오:
Control plane 패킷이나, CPU 로 향하는 패킷에 대해서 존재여부, 패킷 내용 분석 등을 빠르게 장비에서 직접 할 필요가 있을 경우 많이 사용하게 됩니다.
 
사용 예시:
N9K 사이에 L3 port 로 연결 및 OSPF neighbor 맺어짐
Topology:
1.jpg
 
Scenario 1: inband/mgmt 어떤 패킷들이 생성될지 확인:
 
Inband:
ethanalyzer local interface inband limit-captured-frames 100   
>>> limit-captured-frames 는 캡쳐할 패킷 갯수. 0 이면 무제한을 의미합니다.
>>> 해당 명령어는 terminal 에서 보이나 저장은 되지 않습니다.

 

N9K-1(config)# ethanalyzer local interface inband limit-captured-frames 100
Capturing on 'ps-inb'
1     1 2023-09-27 01:02:22.160647050     10.1.1.1 → 224.0.0.5    OSPF 82 Hello Packet
2     2 2023-09-27 01:02:22.859986431     10.1.1.2 → 224.0.0.5    OSPF 82 Hello Packet
3     3 2023-09-27 01:02:25.042162617 24:6c:84:34:f1:1a → 01:00:0c:cc:cc:cc CDP 270 Device ID: N9K-1(FLM27150L1L)  Port ID: Ethernet1/3 
4     4 2023-09-27 01:02:25.303417755 24:6c:84:34:f2:a7 → 01:00:0c:cc:cc:cc CDP 241 Device ID: N9K-2(FLM27150NDP)  Port ID: Ethernet1/3 
    5 2023-09-27 01:02:26.927019757     10.1.1.2 → 10.1.1.1     ICMP 98 Echo (ping) request  id=0x835a, seq=0/0, ttl=255
    6 2023-09-27 01:02:26.927499493     10.1.1.1 → 10.1.1.2     ICMP 98 Echo (ping) reply    id=0x835a, seq=0/0, ttl=255 (request in 5)
Ping 패킷, OSPF hello packet, CDP packet 등이 캡쳐 되었습니다.
 
Mgmt.:
N9K-1(config)# ethanalyzer local interface mgmt limit-captured-frames 0
Capturing on 'eth1'
1     1 2023-09-27 01:04:39.655596767 10.140.248.111 → 10.207.212.184 TCP 60 47007 → 22 [ACK] Seq=1 Ack=1 Win=64992 Len=0
2     2 2023-09-27 01:04:40.173085171 10.207.212.184 → 10.140.248.111 SSH 278 Server: Encrypted packet (len=224)
    3 2023-09-27 01:04:40.466585932 10.140.248.111 → 10.207.212.184 TCP 60 47007 → 22 [ACK] Seq=1 Ack=225 Win=65392 Len=0
    4 2023-09-27 01:04:40.689977697 10.207.212.184 → 10.140.248.111 SSH 262 Server: Encrypted packet (len=208)
SSH 등 패킷 캡쳐 되었습니다.
 
 
Scenario 2. 캡쳐 필터링
2.1 display-filter >>> wireshark 에서 필터링 하는 방법 사용  (예) ospf; icmp; ip.dst == x.x.x.x
2.2 capture-filter >>> tcmpdump 에서 필터링 하는 방법 사용 (예) tcp port x ; host x.x.x.x
 
2.1
N9K-1(config)# ethanalyzer local interface inband display-filter icmp limit-captured-frames 0
Capturing on 'ps-inb'
    2 2023-09-27 01:09:22.808507462     10.1.1.2 → 10.1.1.1     ICMP 98 Echo (ping) request  id=0x7d60, seq=0/0, ttl=255
3 2023-09-27 01:09:22.808995879     10.1.1.1 → 10.1.1.2     ICMP 98 Echo (ping) reply    id=0x7d60, seq=0/0, ttl=255 (request in 2)
>모든 ICMP 패킷을 캡쳐
 
N9K-1(config)# ethanalyzer local interface inband display-filter " ip.dst == 10.1.1.2 " limit-captured-frames 0
Capturing on 'ps-inb'
    4 2023-09-27 01:10:20.363488594     10.1.1.1 → 10.1.1.2     ICMP 98 Echo (ping) reply    id=0xec60, seq=0/0, ttl=255 (request in 3)
    6 2023-09-27 01:10:20.364912923     10.1.1.1 → 10.1.1.2     ICMP 98 Echo (ping) reply    id=0xec60, seq=256/1, ttl=255 (request in 5)
> 모든 DIP 10.1.1.2 인 패킷을 캡쳐
 
2.2
N9K-1(config)# ethanalyzer local interface inband capture-filter " host 10.1.1.2 " limit-captured-frames 0
Capturing on 'ps-inb'
1     1 2023-09-27 01:11:29.977195200     10.1.1.2 → 224.0.0.5    OSPF 82 Hello Packet
       2 2023-09-27 01:11:37.052418251     10.1.1.2 → 10.1.1.1     ICMP 98 Echo (ping) request  id=0x4363, seq=0/0, ttl=255
       3 2023-09-27 01:11:37.052859742     10.1.1.1 → 10.1.1.2     ICMP 98 Echo (ping) reply    id=0x4363, seq=0/0, ttl=255 (request in 2)
 
N9K-1(config)# ethanalyzer local interface inband capture-filter " tcp port 22 " limit-captured-frames 0
Capturing on 'ps-inb'
2    1 2023-09-27 01:12:45.134121459     10.1.1.2 → 10.1.1.1     SSH 102 Client: Encrypted packet (len=36)
      2 2023-09-27 01:12:45.135192378     10.1.1.1 → 10.1.1.2     SSH 102 Server: Encrypted packet (len=36)
 

 

Scenario 3. 패킷 내용을 직접 장비에서 확인:
 
NX-OS 내장 wireshark 으로 패킷 디테일 정보 확인
 
N9K-1(config)# ethanalyzer local interface inband limit-captured-frames 0 detail
Frame 2: 82 bytes on wire (656 bits), 82 bytes captured (656 bits) on interface ps-inb, id 0
    Interface id: 0 (ps-inb)
        Interface name: ps-inb
Ethernet II, Src: 24:6c:84:34:f2:a7, Dst: 01:00:5e:00:00:05
    Destination: 01:00:5e:00:00:05
        Address: 01:00:5e:00:00:05
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
    Source: 24:6c:84:34:f2:a7
        Address: 24:6c:84:34:f2:a7
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 10.1.1.2, Dst: 224.0.0.5
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
        1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)
        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
    Total Length: 68
    Identification: 0xd825 (55333)
    Flags: 0x0000
        0... .... .... .... = Reserved bit: Not set
        .0.. .... .... .... = Don't fragment: Not set
        ..0. .... .... .... = More fragments: Not set
    Fragment offset: 0
    Time to live: 1
    Protocol: OSPF IGP (89)
    Header checksum: 0xf573 [validation disabled]
    [Header checksum status: Unverified]
    Source: 10.1.1.2
    Destination: 224.0.0.5
Open Shortest Path First
    OSPF Header
        Version: 2
        Message Type: Hello Packet (1)
        Packet Length: 48
        Source OSPF Router: 10.1.1.2
        Area ID: 0.0.0.0 (Backbone)
        Checksum: 0xd090 [correct]
        Auth Type: Null (0)
        Auth Data (none): 0000000000000000
    OSPF Hello Packet
        Network Mask: 255.255.255.0
        Hello Interval [sec]: 10
        Options: 0x02, (E) External Routing
            0... .... = DN: Not set
            .0.. .... = O: Not set
            ..0. .... = (DC) Demand Circuits: Not supported
            ...0 .... = (L) LLS Data block: Not Present
            .... 0... = (N) NSSA: Not supported
            .... .0.. = (MC) Multicast: Not capable
            .... ..1. = (E) External Routing: Capable
            .... ...0 = (MT) Multi-Topology Routing: No
        Router Priority: 1
        Router Dead Interval [sec]: 40
        Designated Router: 10.1.1.2
        Backup Designated Router: 10.1.1.1
        Active Neighbor: 10.1.1.1
 

 

Scenario 4. 캡쳐한 패킷을 bootflash 에 저장
 
N9K-1(config)# ethanalyzer local interface inband limit-captured-frames 0 write bootflash:test.pcap display
Write >>> 저장할 directory 및 파일명 지정
Display >>> 저장 하면서 terminal 에 캡쳐한 패킷 보여짐
Capturing on 'ps-inb'
1     1 2023-09-27 01:21:30.745650249     10.1.1.1 → 224.0.0.5    OSPF 82 Hello Packet
2     2 2023-09-27 01:21:32.157809498     10.1.1.2 → 224.0.0.5    OSPF 82 Hello Packet
 
N9K-1(config)# dir bootflash:test.pcap
       5520    Sep 27 01:22:47 2023  test.pcap
 
해당 파일을 bootflash 에서 download 하여 PC wireshark 에서 open 가능
 

 

Scenario 5. SPAN to CPU  
Warning: 실망에서 사용하는건 권장 드리지 않습니다.
 
Front port 패킷을 span 하고자 하나, 따로 PC 나 계측기 사용이 어려운 경우, CPU 로 SPAN 하고 ethanalyzer 로 패킷 캡쳐 및 저장 가능.
 
Config:
N9K-1(config)# show run monitor
 
!Command: show running-config monitor
!Running configuration last done at: Wed Sep 27 01:25:45 2023
!Time: Wed Sep 27 01:25:51 2023
!
version 10.2(5) Bios:version 01.08
monitor session 1
  source interface Ethernet1/3 both
  destination interface sup-eth0
no shut
!
 
캡쳐:
N9K-1(config)# ethanalyzer local interface inband mirror limit-captured-frames 0
>>> mirror: ethanalyzer span 에서 받은 패킷만 캡쳐, CPU 에서 발생했거나, inband 로부터 받는 패킷은 캡쳐 하지 않습니다.
Capturing on 'ps-inb'
    1 2023-09-27 01:26:43.902939875     10.1.1.2 → 10.1.1.1     ICMP 98 Echo (ping) request  id=0xd86e, seq=0/0, ttl=255
    2 2023-09-27 01:26:43.904757647     10.1.1.2 → 10.1.1.1     ICMP 98 Echo (ping) request  id=0xd86e, seq=256/1, ttl=255
 
위에서 소개한 필터링, 저장 등 기능 모두 사용 가능합니다.
 

 

 

시작하기

상단의 검색창에 키워드, 문구, 또는 질문을 입력하여 궁금한 내용을 찾아보세요.

이곳에서의 여러분의 여정이 훌륭하기를 바랍니다! 시스코 커뮤니티에 빠르게 익숙해지는 데 도움이 되는 몇 가지 링크를 준비했습니다.

빠른 링크