1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-24 01:22:10 +02:00
tldr/pages/common/tcpdump.md
2016-01-08 09:38:59 +01:00

27 lines
633 B
Markdown

# tcpdump
> Dump traffic on a network.
- Capture the traffic of a specific interface:
`tcpdump -i {{eth0}}`
- Capture all TCP traffic showing contents (ASCII) in console:
`tcpdump -A tcp`
- Capture the traffic from or to a host:
`tcpdump host {{www.example.com}}`
- Capture the traffic from a specific interface, source, destination and destination port:
`tcpdump -i {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port 80`
- Capture the traffic of a network:
`tcpdump net {{192.168.1.0/24}}`
- Capture all traffic except traffic over port 22 and save to a dump file:
`tcpdump -w dumpfile.pcap not port 22`