Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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バイナリを読んでいる)

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away