Capture and Save Packets in a File in Linux.

0 votes

Hi Guys,

I am trying to save the packets in a file so that I can analyze the external packets. How can I do that?

Oct 4 in Linux Administration by akhtar
• 33,720 points
35 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use tcpdump command to save your packets. You can pass -w in tcpdump command. It will save the output in a file as shown below.

$ tcpdump -w 0001.pcap -i eth0
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
4 packets captured
4 packets received by filter
0 packets dropped by kernel
answered Oct 4 by MD
• 79,930 points

Related Questions In Linux Administration

0 votes
1 answer

How to display captured packets in HEX and ASCII in Linux?

Hi@akhtar, To display the packet value you can ...READ MORE

answered Oct 4 in Linux Administration by MD
• 79,930 points
41 views
0 votes
1 answer

How to capture only TCP packets in Linux?

Hi@akhtar, You can use tcpdump command for this ...READ MORE

answered Oct 4 in Linux Administration by MD
• 79,930 points
29 views
0 votes
1 answer

Capture packets from destination IP in Linux.

Hi@akhtar, To capture packets from destination IP, say you ...READ MORE

answered Oct 4 in Linux Administration by MD
• 79,930 points
28 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,030 points
491 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
222 views
0 votes
2 answers

Install postgreSQL on Ubuntu

Follow the below commands to install PostgreSQL (PSQL) ...READ MORE

answered Nov 11 in Database by Prachi
• 140 points
191 views
0 votes
1 answer

Access progrs prompt without switching accounts

Use the following to get the postgres prompt ...READ MORE

answered Mar 22, 2019 in Database by Mahi
126 views
0 votes
1 answer

How to check permissions of a file in the Linux system?

Hi@akhtar, If you prefer using the command line, ...READ MORE

answered Aug 13 in Linux Administration by MD
• 79,930 points
148 views
0 votes
1 answer

How to capture Packets from Specific Interface in Linux?

Hi@akhtar, You can use tcpdump command in your ...READ MORE

answered Oct 3 in Linux Administration by MD
• 79,930 points
32 views