LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-10-2013, 07:13 PM   #1
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
tshark: want udp, bootp details only, not Frame, Ether, IP details


Hi Guys,

I'm using tshark to get detailed info on dhcp pkts.
Found this
Code:
tshark -i eth0   -V -f "udp port 67 || udp port 68"
here http://networkingbodges.blogspot.com...ne-liners.html, which seems to do the trick nicely.
However, it shows all the details for all the fields for all the layers ie Frame, Ether, IP, udp, bootp.
I only need to see the udp and bootp blocks of output.
Does anyone know how to restrict/filter to just those?

I found an option -O protocols on one man page, but it appears my install (RHEL6, wireshark 1.2.15) doesn't support it.

I did think tweaking the capture filter or creating a display filter to add to the cmd would do it, but I'm new to tshark and haven't figured it out yet.

NB: this is a cli only server, so most webpages talking about the GUI aren't terribly helpful.


UPDATED:
Ok, resorted to a sed hack, but I'd be interested to know/learn how to do it in tshark; I'm sure it can be done.
Code:
tshark -i eth0   -V -f "udp port 67 || udp port 68"|sed -n '/^User Datagram/,/Padding/p;/Padding/i\\n'

Last edited by chrism01; 09-10-2013 at 10:10 PM.
 
Old 09-11-2013, 01:29 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by chrism01 View Post
However, it shows all the details for all the fields for all the layers ie Frame, Ether, IP, udp, bootp. I only need to see the udp and bootp blocks of output. Does anyone know how to restrict/filter to just those?
I would use capture filters to restrict what's being captured as that keeps all the information in place. If you don't all you'll get is mutilated output you can't work with later on should you so desire. Displaying saved pcap contents is another story. Determining the maximum length of the headers and ditching those should give you the payload. See 'man tcpdump' about header notation or "slice" in 'man wireshark-filters'?
 
  


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
Details about ddrescue Woodsman Linux - Software 1 02-17-2013 06:08 AM
rpm details ramunaidu9 Linux - General 4 11-11-2009 09:15 AM
how to extract details by just using IP ? wrapster Solaris / OpenSolaris 8 08-26-2008 04:37 PM
Details about repositories... and not only ! kantor_98 Linux - Newbie 1 04-25-2007 11:29 AM
Mount in details cyrius Linux - General 3 12-15-2004 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:31 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