LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2011, 01:52 PM   #1
newbie_techie
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
Unhappy Help with tcpdump


Hi,
I have a big collection of traffic traces taken using tcpdump and I am now interested in extracting just the timestamp, MAC src/dst, IP src/dst and transport protocol port number. I tried to extract just this information using tcpdump and awk in conjunction (something like this tcpdump -nr try -vvv -e | awk '{print $1, $2, $4, $25, $27}'). But this fits the pattern for tcp/udp packets, in case where there are some other packets, this fails totally.

If in case this packet is something else, then I either want to skip it from the final output or have some visible indication of which packet it is.

How do I do this using tcp dump?

I am using a pcap file as an input.
 
Old 10-03-2011, 02:21 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Assuming I understand your question, you can have tcpdump do some of the lifting for you with a filter.

Code:
# tcpdump -r dump.file udp or tcp
For more info about filters, see the manpages for tcpdump(8) and/or pcap_filter(7). (Depends on your system.)
 
Old 10-03-2011, 02:29 PM   #3
newbie_techie
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
hi,
Thanks for the response..I had already tried this, but when I ran this on a very small trace file (60packets), it was really slow when compared to what I had mentioned earlier. Is this normal? the running time is something like 30 seconds, which I dont understand why.
 
Old 10-03-2011, 03:18 PM   #4
newbie_techie
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Just to make my case simpler, how do i filter or export timestamp, MAC src/dst, IP src/dst and transport protocol port number from large trace files into a text file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tcpdump? hadimotamedi Linux - Newbie 3 02-20-2010 04:35 AM
about tcpdump bulkathos Linux - Networking 1 05-11-2008 02:02 PM
tcpdump lakshminarayan Linux - Security 2 07-21-2006 03:50 AM
help tcpdump blackzone Linux - Networking 1 10-08-2004 07:07 AM
tcpdump gbell72 Linux - Security 5 09-18-2003 02:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration