CDE(SE/SR/CDSM) では、tcpdump コマンドを使用してpacket captureを取得できます。
CDEのトラブルシューティング時に tcpdump を使う必要がある場合の基本的な packet capture の
取得方法について説明します。
ステップ 1
tcpdump -D コマンドで、packet capture を取得するインターフェースを確認します。
SE#tcpdump -D
1.bond0 ##bond0 は Portchannel 1 に相当します。
2.eth0 ##eth0 は GigabitEthernet 1/0 に相当します。
3.eth1
4.any (Pseudo-device that captures on all interfaces)
5.lo
ステップ 2
インターフェース (bond0) を選択して、取得するパケット量 (1600 bytes) を指定し
CDE のローカルファイル (/local1/test.pcap) として保存します。
SE#tcpdump -i bond0 -s 1600 -w /local1/test.pcap
tcpdump: listening on bond0, link-type EN10MB (Ethernet), capture size 1600 bytes
ステップ 3
取得したパケットキャプチャのファイルをwireshark等のツールで確認する場合、
FTP経由で、一旦FTPサーバーにファイルをアップロードします。
SE#copy disk ftp 192.168.88.31 / test.pcap test.pcap
Enter username for remote ftp server: cisco
Enter password for remote ftp server:
Initiating FTP upload...
Sending: USER cisco
Password required for cisco.
Sending: PASS ********
User cisco logged in.
Sending: TYPE I
Type set to I.
Sending: PASV
Entering Passive Mode (192,168,88,31,6,185).
Sending: CWD /
CWD command successful. "/" is current directory.
Sending PASV
Entering Passive Mode (192,168,88,31,6,186).
Sending: STOR test.pcap
Opening data connection for test.pcap.
File received ok
Sent 24 bytes
取得したファイルを wireshark で見たところ
CDE に作成された pcap ファイルを削除する場合は、delfile コマンドで削除します。
SE#delfile test.pcap
また、tcpdump コマンドのオプションは tcpdump -h で確認できます。
SE#tcpdump -h
tcpdump version 3.9.8
libpcap version 0.9.8
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
[ -W filecount ] [ -y datalinktype ] [ -Z user ]
[ expression ]