Etherealを使おう
http://www.space-peace.com/ethereal/ethereal_11_3.htm
キャプチャ結果を保存する場合、(テキスト版の場合は保存しないと意味ないが・・・)保存先を-wオプションで指定します。
[WINDOWS]C:\Program Files\Ethereal>tethereal -w c:\log
[UNIX]/usr/local/bin/tethereal -w /tmp/log
ほほー
非プロミスカスモードで静かにlog.capに出力
tshark -w /tmp/log.cap -q -p
SSH以外のパケットを取得
tshark -f "not port 22" -w /tmp/`hostname``date +%Y%m%d%H%M`log.cap -q -p &
ppp0のパケットを取得
tethereal -i ppp0 -f "not port 22" -w /tmp/log.cap -q -p
wiresharkではtsharkとなったようだ。
ls -l /usr/sbin/tethereal /usr/sbin/tethereal -> tshark
tsharkのインターフェイス指定
http://blog.hogeo.jp/2011/03/tshark-wiresharkcli.html
- D オプションで使用可能なインターフェースとそのIndexを確認することが出来ます。まずはこれを実行しましょう。
$ sudo tshark -D 1. eth0 2. any (Pseudo-device that captures on all interfaces) 3. lo
- i オプションでパケットキャプチャを行うインターフェースを指定します。指定しなければ一番Indexの若いインターフェースになります。下記の例では全てeth0インターフェースでキャプチャを開始します。
$ sudo tshark $ sudo tshark -i 1 $ sudo tshark -i eth0