Как заставить tcpdump не сохранять данные пакетов в файл?

Здравствуйте.

Записываю при помощи tcpdump сетевой трафик в бинарный файл (опция -w) , но в файл он пишет целиком пакеты, как сделать так чтобы в файл писал только заголовки (ip,tcp,udp) , копия просмотренного youtube не нужна :)

По сути нужны только адреса, порты и длина пакета
  • Вопрос задан
  • 80 просмотров
Пригласить эксперта
Ответы на вопрос 1
@q2digger
никого не трогаю, починяю примус
Укажите сколько именно брать от пакетика.

-s 96

Из доки:

Snarf snaplen bytes of data from each packet rather than the default of 68 (with NIT, the minimum is actually 96). 68 bytes is adequate for IP, ICMP, TCP and UDP but may truncate protocol information from name server and NFS packets (see below). Packets truncated because of a limited snapshot are indicated in the output with ``[|proto]'', where proto is the name of the protocol level at which the truncation has occurred. Note that taking larger snapshots both increases the amount of time it takes to process packets and, effectively, decreases the amount of packet buffering. This may cause packets to be lost. You should limit snaplen to the smallest number that will capture the protocol information you're interested in.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы