大网数据广告活动
服务器运维问答

Tcpdump output file is not storing the destination IP address and port number

· 52CE 我爱测

I'm capturing tcpdump packets. Even though, when I want to see the output by tcpdump -r I see destination hostname instead of address IP and service name instead of port number. Example: tcpdump -w /home/backup/out.bin -nn -i ens…

问题原文

原帖链接 · user3637971 · CC BY-SA 4.0

I'm capturing tcpdump packets. Even though, when I want to see the output by tcpdump -r I see destination hostname instead of address IP and service name instead of port number.

Example:

tcpdump -w /home/backup/out.bin -nn -i ens192 '(dst port 80)'

After a minute Ctrl + C to stop the process

Then:

tcpdump -r /home/backup/out.bin

It shows:

12:01:28.079940 IP 192.168.1.20.50704 > app.server.http: Flags [.], ack 4196894497, win 229, options [nop,nop,TS val 875454090 ecr 3736039484], length 0
12:01:28.080841 IP 192.168.1.20.50704 > app.server.http: Flags [.], ack 93, win 229, options [nop,nop,TS val 875454091 ecr 3736039485], length 0
12:01:28.080863 IP 192.168.1.20.50704 > app.server.http: Flags [P.], seq 0:95, ack 93, win 229, options [nop,nop,TS val 875454091 ecr 3736039485], length 95

It should show the IP address and port number instead of app.server.http.

What can I do for this case?

已采纳解答

原帖链接 · Tero Kilkanen · CC BY-SA 4.0

The captured data itself does contain the IP addresses and port numbers. However, tcpdump does reverse lookups for IP addresses and port numbers during display. One can use -n to disable reverse lookups.

So, you should use

tcpdump -n -r /home/backup/out.bin

to display the capture.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-11-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。