跳转到主内容

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

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

适用于

ONTAP 9.2 至 9.9

说明

在 ONTAP 9.2 至 9.9 系统上捕获数据包跟踪(tcpdump)的过程。

操作步骤

 

警告

  • 尽可能在单个客户端 IP 上过滤数据包跟踪
    • 如果有多个客户端受到影响,请选择 1 个进行故障排除
  • 在最小值为4096的系统上使用-buffer标志,以确保跟踪不会过滤数据包
  • 不要按照此过程捕获网络端口中接收的CRC错误。

 

::> network tcpdump start -node <node> -port <port/ifgrp/vlan> -address <client-ip/lif-ip/etc.> -buffer-size 2097151

注:  

  • -node-port 是必需的
  • 此命令不能对节点或端口使用通配符
  • 如果 ifgrp(例如 a0a)具有 VLAN(例如 a0a-117),指定 a0a 将仅捕获本地 VLAN(未标记)流量
  • -address 选项可以指定 仅一个 IP 地址来过滤跟踪。
  • -protocol-port 选项允许对 TCP 和 UDP 流量按一个端口过滤跟踪。
  • 滚动轨迹:

::> network tcpdump start -node cl1-n1 -port e0b -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。
     
  • 显示正在运行的数据包跟踪(network tcpdump show (netapp.com/cn)):

::> network tcpdump show

 ::> tcpdump stop -node <node> -port [*|<port>]

  • 要停止所有痕迹:

::> tcpdump stop *

::> network tcpdump trace show

注意: ONTAP 将跟踪文件存储在 /mroot/etc/log/packet_traces

::> network tcpdump trace delete -node <node> -trace-file *

  • 通过 Web 浏览器检索数据包跟踪:
    • http(s)://<CLUSTER_MGMT_IP>/spi/<NODE_NAME>/etc/log/packet_traces/

注意: 访问 SPI 需要集群凭据

空间注意事项

  • 如果收集大量跟踪,请使用 df -h 命令确认节点的根卷具有足够空间。
    • 在开始数据包跟踪之前,应提供两倍以上的总跟踪大小(文件大小乘以跟踪次数)。
  • 默认情况下,跟踪文件会添加到快照副本中,因此 vol0(根卷)可能会很快填满,导致中断
    • 要避免使用快照中捕获的跟踪文件占用根卷空间:
      • 从正在收集跟踪的节点的节点外壳禁用节点根卷上的自动快照

::> run -node <node> -command "vol options vol0 nosnap on" 

::> 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"

追加信息

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.