linux查看谁在ping我

tcpdump 是 Linux 上可用的最强大和使用最广泛的 命令行 数据包嗅探器(包分析器)工具。

机器A:

命令:
tcpdump -i 网卡名称 icmp and icmp[icmptype]=icmp-echo -n

root@user:~# tcpdump -i eth0 icmp and icmp[icmptype]=icmp-echo -n
ERROR: ld.so: object '/usr/local/lib/lib.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp5s0f0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
16:00:24.776571 IP 03.005.016.31 > 04.06.008.004: ICMP echo request, id 572, seq 136, length 64
16:00:25.777665 IP 03.005.016.31 > 04.06.008.004: ICMP echo request, id 572, seq 137, length 64
这里就可以查看到啦~

机器B:

去ping机器A

你可能感兴趣的:(linux查看谁在ping我)