Skip to content

Instantly share code, notes, and snippets.

@tanvir86
Forked from ronokdev/How to do TCPDUMP
Created July 19, 2018 05:16
Show Gist options
  • Save tanvir86/eb49b7b18f5989b451a85c7409dd11c1 to your computer and use it in GitHub Desktop.
Save tanvir86/eb49b7b18f5989b451a85c7409dd11c1 to your computer and use it in GitHub Desktop.
How to do TCPDUMP
::: RefUrl
→ https://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/
→ https://linuxtechlab.com/learn-use-tcpdump-command-examples/
→ https://www.thegeekstuff.com/2010/08/tcpdump-command-examples
::: Install TCPdump command → yum install tcpdump
::: To write tcpdump from 'server_A'(eth0) IP to 'server_B'
→ tcpdump -w fileName.pcap server_A_ip -i eth0 server_B_ip
::: Example :
Suppose , we want to get the Tcp-Dump from eth0 to 192.168.22.22 and store the it to a file.
For this we have to run the below command :
→ tcpdump -w test_v2.pcap -A -i eth0 dst 192.168.22.22
→ The 'test_v2.pcap' is a wireshark file.
→ Need to have wireshark installed for opening the file.
→ 'test_v2.pcap' → will be available on centos path → '/root/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment