0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

tcpdumpでICMPv6のtypeを指定する方法

Last updated at Posted at 2018-11-26

###Typeの指定

ICMPv6
sudo tcpdump -i eth0 "ip6[40] == 'type number' (or ...) && icmp6"

IPv4までのICMPパケットは

ICMP
sudo tcpdump -i eth0 "icmp[0] == 'type' "

であった。

ちなみに "[ ]" はヘッダのバイトオフセットを指定する。ip6[40]はIPv6ヘッダの40バイト目(ICMPv6 type)の値だ。

###ファイルに保存+標準出力
hoge.pcapというファイルに保存する。

write_and_stdout
sudo tcmpdump -w - | tee hoge.pcap | tcpdump -r -

-w - で標準出力にpcapバイナリを吐き出す
-r - で標準入力から読み込む(ここではpcapバイナリを読んでいる)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?