24

Can I somehow monitor incoming pings on a Linux machine? netcat doesn't seem to support that.

3 Answers 3

39

You can use tcpdump ip proto \\icmp to monitor incoming pings (ICMP echo requests)

3
  • 2
    works in macos as well. you might need to use sudo Oct 4, 2021 at 15:18
  • does this also log ipv6 pings?
    – xeruf
    Sep 27, 2023 at 5:29
  • I guess you would specify icmp6 Sep 27, 2023 at 8:52
3

You could setup a rule in iptables that logs icmp packets.

1

If you want something nicer than tcpdump (GUI and stuff), you can try with Wireshark.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .