https://www.howtouselinux.com/post/tcpdump-udp
tcpdump is a powerful command-line network packet analyzer used for network troubleshooting and analysis. To capture UDP packets using tcpdump, you can use specific filtering options to narrow down the traffic you want to capture.
Capture all UDP traffic To capture all UDP packets, you can use the following command:
sudo tcpdump udp
Here's the information converted to Markdown format:
udp
: Capture all UDP traffic.-i <interface>
: Specify the network interface to listen on.port <port_number>
: Filter by a specific UDP port.host <ip_address>
: Capture traffic from/to a specific IP.src/dst host <ip_address>
: Capture UDP packets from/to a specific source/destination IP.-X
: Show detailed packet content in hexadecimal and ASCII.-w <file_name>
: Write captured packets to a file.-c <count>
: Limit the number of packets captured.
By using these commands and filters, you can effectively capture and analyze UDP traffic using tcpdump
.