Skip to content

Instantly share code, notes, and snippets.

@ronokdev
Created July 12, 2018 14:09
Show Gist options
  • Save ronokdev/eba6f4a5a51d7174a92b674cb3205fd9 to your computer and use it in GitHub Desktop.
Save ronokdev/eba6f4a5a51d7174a92b674cb3205fd9 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/'
@ronokdev
Copy link
Author

ronokdev commented Jul 12, 2018

To Check the eth0 IP address, we need to run the below COMMAND
cat /etc/sysconfig/network-scripts/ifcfg-eth0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment