Netscaler mpx packet capture
nstrace
Section titled “nstrace”Path は /var/nstrace
オプションは大量にあるが、そのオプションが必須で必要なことは少ない
大体 ↓ ぐらいで足りる。 filter 部分は必要に応じて書き換える。独自のフィルタ式なので書き方注意。
-link ENABLE はリクエストのバックポストもキャプチャしてくれるので便利。
インライン構成の VIP へのリクエストをキャプチャする場合、配下サーバとの通信も一緒に取ってくれる。
stop nstrace は忘れないように。
start nstrace -size 0 -filesize 1024 -traceBuffers 65535 -link ENABLED -filter "CONNECTION.IP.EQ(210.171.63.8)"stop nstrace取ったキャプチャは、キャプチャを開始したタイムスタンプのディレクトリの中にある。
14:25 nsroot@mpx-Primary> start nstrace -size 0 -filesize 1024 -traceBuffers 65535 -link ENABLED -filter "CONNECTION.IP.EQ(192.168.0.2)" Done14:25 nsroot@mpx-Primary> stop nstrace Done14:28 nsroot@mpx-Primary> shellCopyright (c) 1992-2013 The FreeBSD Project.Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved.
root@mpx01# ls -la /var/nstrace/total 24drwxr-xr-x 12 root wheel 512 Oct 22 14:25 .drwxr-xr-x 41 root wheel 1024 Oct 22 12:54 ..drwxr-xr-x 2 root wheel 512 Oct 22 14:25 22Oct2020_14_20_11drwxr-xr-x 2 root wheel 512 Oct 22 14:28 22Oct2020_14_25_35root@mpx01# ls -la /var/nstrace/22Oct2020_14_25_35total 34212drwxr-xr-x 2 root wheel 512 Oct 22 14:28 .drwxr-xr-x 12 root wheel 512 Oct 22 14:25 ..-rw-r--r-- 1 root wheel 34979840 Oct 22 14:28 nstrace1.cap # 多いと複数ファイルに分割されるnstcpdump.sh
Section titled “nstcpdump.sh”tcpdump をラップした nstcpdump.sh というものもある。使い方は tcpdump と同じ。 メーカ曰く、 nstcpdump.sh は nstrace よりも負荷がかかるため、稼働環境では nstrace を推奨とのこと。
root@mpx01# nstcpdump.sh -hnstcpdump.sh: utility to view/save/sniff LIVE packet capture on NETSCALER boxtcpdump version 4.9.1libpcap version 1.0.0OpenSSL 1.0.2r-fips 26 Feb 2019Usage: tcpdump [-aAbdDefhHIKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ] [ -i interface ] [ -M secret ] [ --number ] [ -Q in|out|inout ] [ -r file ] [ -s snaplen ] [ -T type ] [ --version ] [ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ] [ -z postrotate-command ] [ -Z user ] [ expression ]
NOTE: tcpdump options -i, -r and -F are NOT SUPPORTED by this utility