跳转到主内容

如何捕获ONTAP 9.2到9.9系统上的数据包跟踪(tcpdump)

Views:
239
Visibility:
Public
Votes:
4
Category:
ontap-9
Specialty:
nas
Last Updated:

适用场景

ONTAP 9.2至9.9

问题描述

操作步骤 、用于在ONTAP 9.2至9.9系统上捕获数据包跟踪(tcpdump)。

操作步骤

 

  • 始终尽可能在单个客户端IP上筛选数据包跟踪
  • 如果多个客户端受到影响、请选择1以关注故障排除
  • -buffer在最小值为4096的系统上使用此标志、以确保跟踪不会筛选数据包
  • 请勿按照此操作步骤捕获 网络端口中收到的CRC错误。
  • 简单跟踪:

::> network tcpdump start -node <node> -port <port-or-ifgrp> -address <ip-to-filter-on> -buffer-size 2097151

注意:ip-to-filter-on可以是客户端地址或选定端口上的LIF

  • 此操作将在指定节点上的指定端口上启动数据包跟踪(此命令不能对节点或端口使用通配符、文件大小为1 GB)。
  • 停止数据包跟踪:  ::> tcpdump stop -node <node> -port [*|<port>]
  • 一个用于停止所有跟踪的简单命令是 ::> tcpdump stop *
  • 要显示数据包跟踪文件、请执行以下操作:

::> network tcpdump trace show

  • 数据包跟踪存储在以下路径中:

/mroot/etc/log/packet_traces

  • 删除旧数据包跟踪

::> network tcpdump trace delete ?
   [-node] <nodename>         Node Name
   [-trace-file] <text>       Trace File

必填字段
  • -node
  • -port 必须是单个物理 端口(例如e0g)或虚拟端口(例如 a0a-16)
    • 注意:选择-port a0a将仅捕获未标记VLAN的流量 
    • 如果LIF位于VLAN上、则通过指定VLAN标记编号(示例 -port a0a-16)来捕获托管LIF的VLAN上的流量
选项

::> network tcpdump start -node <node> -port <port> ?
  [[-address] <IP Address>]    IP Address 
  [ -protocol-port {1..65535} ]  Protocol Port Number
  [ -file-size {1..65536} ]    Trace File Size in MB
  [ -rolling-traces {1..64} ]   Number of Rolling Trace Files

  

  • port字段为必填字段
  • -address此选项只能指定一个IP地址来筛选跟踪。
  • -protocol-port通过选项、可以按一个端口筛选TCP和UDP流量的跟踪。
  • -file-size此选项允许修改跟踪文件的默认大小(1024 MB)。
  • -rolling-traces选项用于指定使用滚动数据包跟踪时要保存的跟踪文件数。
    • 注意: 如果 -rolling-traces 不使用、则会使用包含2个文件的滚动跟踪。
  • 确保节点的根卷具有足够的空间如果需要收集大型跟踪文件、您可以使用"f -h"命令对其进行检查
    • 在开始数据包跟踪之前、应提供两倍以上的总跟踪大小(文件大小乘以跟踪数)。
  • 请注意、默认情况下、跟踪文件将添加到Snapshot副本中、并且vol0 (根卷)可能会很快填满、从而导致中断
  • 要避免在快照中捕获跟踪文件时占用根卷空间、请使用以下两个选项之一
    • 从要收集跟踪的节点的nodeshell禁用节点根卷上的自动快照
      • ::> run -node <node> -command "vol options vol0 nosnap on" 
        • 已禁用自动Snapshot副本。您可能会考虑根据空间要求删除vol0的旧快照。 
    • 删除跟踪期间创建的快照
      • ::> run -node <node> -command "snap list vol0"
      • :::> run -node <node> -command "snap delete vol0 <snap name> "
  • 数据包跟踪收集完成后、如果根卷快照最初已启用、请重新启用它们
    • 来自已禁用Snapshot的节点的nodeshell
      • ::> run -node <node> -command "vol options vol0 nosnap off"
滚动跟踪示例
::> network tcpdump start -node <node> -port <port-or-ifgrp> -file-size 512 -rolling-traces 4 -address 10.1.1.2 -protocol-port 445
  • 此跟踪最多可汇总4个每个大小为512 MB的跟踪文件(最早的文件先删除)。
  • 它会跟踪选定端口、并筛选IP地址10.1.1.2和TCP/UDP端口445。]
正在检索数据包跟踪
  • 可以使用您选择的Web浏览器从以下位置下载数据包跟踪:

<CLUSTER_MGMT_IP> ://http/spI/http/etc/log/package_traces/<NODE_NAME>

要访问此SPI、需要集群凭据

 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.
Scan to view the article on your device