↑ ↓ select, Enter open, Esc close

Capture network traffic on a port with tcpdump

Adjust the values, the command updates live
root@server
tcpdump -i any -nn -c 100 port 25

Shows the packets on all interfaces that involve the given port and exits after the given count. -nn disables DNS and port name resolution and keeps the output fast. This clarifies whether requests reach the server at all and whether it replies.

Note: With -w datei.pcap the capture is saved for Wireshark. If needed, install the package with apt install tcpdump.

Also searched as

  • tcpdump capture specific port
  • check if traffic reaches server
  • sniff packets on port 25

Related one-liners

All in Network

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.