Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-15-2012, 11:00 AM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Rep:
|
capturing packets with tcpdump
Hello
I have a lot of processes in the network between network elements.
I want to capture some HTTP/SOAP packets which contain specific value. This packet can arrive at any time so it's not possible to capture all the traffic as there is a lot of it.
Is it possible to set some filter to capture only those packets?
|
|
|
06-15-2012, 12:17 PM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
Yes, it's possible.
|
|
|
06-15-2012, 12:37 PM
|
#3
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Original Poster
Rep:
|
How?
|
|
|
06-15-2012, 12:49 PM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
A BPF filter can help with protocol (TCP) port (80) and packet headers like SYN, narrowing down the amount of traffic you log with tcpdump, tshark or whatever you use. And although the application interprets the payload as XML SOAP IIRC is just plain text you can grep.
|
|
|
06-15-2012, 01:55 PM
|
#5
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Original Poster
Rep:
|
so if i'll execute
tcpdump -s0 -w file.cap -i eth0 |grep 42507
will work?
|
|
|
06-15-2012, 04:18 PM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,415
|
Yeah, it'll work.
But what the result is remains to be seen using grep in that way.
Better save the capture though and use Wireshark as it has a lot of dissectors.
|
|
|
All times are GMT -5. The time now is 06:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|