networking:tcpdump
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| networking:tcpdump [2022/11/23 12:49] – external edit 127.0.0.1 | networking:tcpdump [2025/08/24 17:09] (current) – bstafford | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| On Linux, to capture data on a port and write to '' | On Linux, to capture data on a port and write to '' | ||
| + | |||
| + | To capture traffic on a server (192.168.11.153) where the client (1921.68.99.74) is accessing TCP-443 on the server. | ||
| + | < | ||
| + | * Name Resolution: Use -n to disable hostname and port number resolution for faster output. | ||
| + | * Verbose Output: Use -v, -vv, or -vvv for more detailed output. | ||
| + | * Packet Size: Use -s < | ||
| + | * Output to File: Use -w < | ||
| + | * Read from File: Use -r < | ||
| + | * Quotes: Use single quotes around filter expressions containing special characters (like parentheses) to prevent shell interpretation | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | < | ||
| + | |||
| + | Tcpdump filters allow you to capture specific types of network traffic based on various criteria, making it easier to analyze and troubleshoot network issues. You can filter by protocol (TCP, UDP, ICMP, etc.), IP address (source or destination), | ||
| + | |||
| + | |||
| + | Basic Filters: | ||
| + | * Protocol: tcp, udp, icmp, arp, ip, ether | ||
| + | * Host: host 192.168.1.1 (captures traffic to or from this IP) | ||
| + | * Source Host: src host 192.168.1.1 | ||
| + | * Destination Host: dst host 192.168.1.1 | ||
| + | * Port: port 80 (captures traffic on port 80) | ||
| + | * Source Port: src port 80 | ||
| + | * Destination Port: dst port 80 | ||
| + | * MAC Address: ether src aa: | ||
| + | |||
| + | Advanced Filters (Combining Criteria): | ||
| + | * Using and, or, and not: | ||
| + | * host 192.168.1.1 and port 80 (captures traffic to/from 192.168.1.1 on port 80) | ||
| + | * port 80 or port 443 (captures traffic on port 80 or 443) | ||
| + | * not port 22 (captures traffic not on port 22) | ||
| + | * Combining with other primitives: | ||
| + | * ether src 00: | ||
| + | |||
| + | Example Usages: | ||
| + | Captures all TCP traffic on the eth0 interface destined for or originating from port 80 | ||
| + | < | ||
| + | Captures all traffic related to the host 192.168.1.100 on any interface. | ||
| + | < | ||
| + | Captures all traffic on the eth0 interface with the specified MAC address as the source. | ||
| + | < | ||
| + | |||
| + | Important Notes: | ||
| + | * Interface Specification: | ||
| + | * Name Resolution: Use -n to disable hostname and port number resolution for faster output. | ||
| + | * Verbose Output: Use -v, -vv, or -vvv for more detailed output. | ||
| + | * Packet Size: Use -s < | ||
| + | * Output to File: Use -w < | ||
| + | * Read from File: Use -r < | ||
| + | * Quotes: Use single quotes around filter expressions containing special characters (like parentheses) to prevent shell interpretation | ||
| + | |||
networking/tcpdump.1669207782.txt.gz · Last modified: by 127.0.0.1
