LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-11-2010, 11:59 AM   #1
clcbluemont
Member
 
Registered: Feb 2009
Distribution: Slackware
Posts: 116
Blog Entries: 3

Rep: Reputation: 15
weird tcpdump behavior


Filters are not working when using tcpdump on eth1. Running CentOS 5.2 I can apply filters to eth0 captures but not eth1. For example this works, ssh traffic is not printed to the screen:
tcpdump not tcp port 22

This does not, it is as if the filter was not there, ie. I see everything:
tcpdump -i eth1 not tcp port 22

What is weirder is that the following command produces no output at all:
tcpdump -i eth1 tcp

Eth1 is connected to an HP switch port is set up as the monitor port.I have tried swapping an 3C905 for an Intel Pro 1000 with the same results. Any ideas what could be throwing a monkey wrench into tcpdump filter for eth1?
 
Old 03-11-2010, 12:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please show us the eth1 output with port 22 traffic shown. I don't think your filters are valid. "tcp port 22" isn't logical as I understand it, you'd say "tcp and port 22" which is functionally equivalent to "(ip proto tcp) and (port 22)"

Last edited by acid_kewpie; 03-11-2010 at 12:39 PM.
 
Old 03-11-2010, 03:22 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Or just leave out "tcp". You shouldn't be seeing any traffic on UDP or SCTP port 22, so blocking those out, too, wouldn't matter.
 
Old 03-14-2010, 04:43 PM   #4
clcbluemont
Member
 
Registered: Feb 2009
Distribution: Slackware
Posts: 116

Original Poster
Blog Entries: 3

Rep: Reputation: 15
The man page has an example that uses the exact syntax except it uses port 80. Also, I use this command on other interfaces and it works fine and I have been using it for years.

I am trying to figure out why it would work on one interface and not another in the same machine. Another symptom of the problem is that iptraf and tcptrack no longer see any tcp traffic. iptraf does see udp traffic. Rebooting swapping the NIC card from 3Com to Intel, nothign has fixed it. Very weird.
 
Old 03-14-2010, 05:54 PM   #5
Maligree
Member
 
Registered: Mar 2008
Distribution: Gentoo, CentOS, Fedora, Arch
Posts: 231
Blog Entries: 1

Rep: Reputation: 42
Looks like packets sent through that interface are being encapsulated into something else, such as PPPoE.

Tcpdump simply checks the regular offset of what it thinks is a regular IP header. In this case you need to make it look in a different place, a little bit further down the packet - due to the extra few bytes of the PPPoE (or different, just an example) header. So in case of a PPPoE encap:
Code:
tcpdump -i en0 ether[31]=6 // IP header protocol field set to tcp
tcpdump -i en0 ether[31]=17 // set to udp
.. and so on
Hope this clears it up.
 
Old 03-17-2010, 07:55 PM   #6
clcbluemont
Member
 
Registered: Feb 2009
Distribution: Slackware
Posts: 116

Original Poster
Blog Entries: 3

Rep: Reputation: 15
Thanks for the information. I will take a look at this. I have been called away on other duties. So I have not had time to return to the problem. Hopefully next week I can digest what you have written.
 
Old 04-05-2010, 12:59 PM   #7
clcbluemont
Member
 
Registered: Feb 2009
Distribution: Slackware
Posts: 116

Original Poster
Blog Entries: 3

Rep: Reputation: 15
Thumbs up Solved

"ethtool -s eth1" was giving me some weird data so changed the PCI slot and NIC. I am now able to see TCP traffic with various sniffer programs.
 
  


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
Weird behavior!! surfer41 Linux - Networking 1 04-25-2006 07:53 AM
Weird behavior Bassy Linux - Software 2 10-20-2005 01:32 PM
iptables ... weird behavior, please help! matrixcubed Linux - Networking 0 05-09-2005 09:44 AM
Weird Behavior in KDE 3.3 haldara Linux - Newbie 3 09-24-2004 10:59 AM
weird behavior in firefox sether *BSD 5 09-06-2004 04:05 PM

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

All times are GMT -5. The time now is 04:48 PM.

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