Sponsored Content
Operating Systems Linux Debian tcpdump filter (mis)behaviour Post 302505349 by Hollinch on Wednesday 16th of March 2011 06:33:14 PM
Old 03-16-2011
tcpdump filter (mis)behaviour

Hello, I am a bit puzzled. I am trying to capture data using tcpdump on a bonded interface, which works fine until I add a filter, then nothing is seen nor captured by libpcap/tcpump.

I have interfaces eth3 and eth4 bonded to bond0 because I am using a tap in a firewall connection to monitor all in and outgoing traffic.

All is fine if I just run tcpdump on the bond0 interface - all traffic is correctly shown. As soon as I specify a filter nothing seems to be seen nor captured anymore.

Some examples of command lines I tried:
Code:
/usr/local/sbin/tcpdump -i bond0 -nn tcp port 80
/usr/local/sbin/tcpdump -i bond0 -nn tcp port http



For example, without filters
output is shown as here (and http traffic was seen to be present):

Code:
root@lins01:~# /usr/local/sbin/tcpdump -i bond0 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 96 bytes
23:07:30.871053 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 2019718192, win 382, options [nop,nop,TS val 1091628665 ecr 724203], length 112
23:07:30.871291 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 1, win 382, options [nop,nop,TS val 1091628665 ecr 724203], length 112
23:07:30.871540 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 1, win 382, options [nop,nop,TS val 1091628665 ecr 724203], length 192
23:07:30.871553 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 1, win 382, options [nop,nop,TS val 1091628665 ecr 724203], length 192
23:07:30.892570 IP 192.168.192.1.58229 > 192.168.192.239.22: Flags [.], ack 112, win 6032, options [nop,nop,TS val 724205 ecr 1091628665], length 0
23:07:30.892773 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 1, win 382, options [nop,nop,TS val 1091628670 ecr 724205], length 384
23:07:30.892780 IP 192.168.192.239.22 > 192.168.192.1.58229: Flags [P.], ack 1, win 382, options [nop,nop,TS val 1091628670 ecr 724205], length 192

With a valid filter specified it sits forever, and finally when I terminate tcpdump it shows 0 packets captured, 0 packets received by filter and 0 packets dropped by kernel. As if no traffic of the specified nature was present, while I am certain it is.

The OS is Debian 5.0.8, with tcpdump version 3.9.8 and libpcap version 0.9.8. I also tried to upgrade to tcpdump 4.0.0 and libpcap 1.0.0, but the result is the same.

I tried to remove the bond and just monitor on one of the individual interfaces, but this still did not produce any results with filters specified (without filters I correctly see half of my traffic, send or receive, depending on which interface I select).

Anyone has any suggestions what to try to get filters working?

Many thanks in advance for your help.


 

7 More Discussions You Might Find Interesting

1. Programming

How To Use tcpdump

I have two net-card. one is 172.16.24.99(ENG) ,another is 172.16.25.99(ENG-B). Both masks is 255.255.255.0. I will monitor data on the tcp port 8055 in ENG, How do I set option of tcpdump command (2 Replies)
Discussion started by: chenhao_no1
2 Replies

2. UNIX for Dummies Questions & Answers

tcpdump

does anybody know what the -d -dd and -ddd options are used for ? thanks (2 Replies)
Discussion started by: ant04
2 Replies

3. Shell Programming and Scripting

Report a missing property and property value mis match script.

Hi All, I have 2 properties files - one is a master templete and other one is a node specific properties file, I need to comapre these 2 properties files and make sure the node Specific properties file contains all the properties in the master temple properties file else report the missing... (5 Replies)
Discussion started by: jayka
5 Replies

4. Debian

Tcpdump Help !

Hi. Need Help with TcpDump Trying to sniff associatio-request with tcpdump but when i run this tcpdump -i eth0 wlan subtype assoc-req i get this error can anyone help me with this error ? Thanks alot !!:) (1 Reply)
Discussion started by: SoulZB
1 Replies

5. IP Networking

TCPdump

I've recently started learning to use TCPdump, and I find it pretty interesting. There's one thing I don't understand. When I tell it to capture packets on, say, the WiFi interface en1, it often captures packets sent or received by other hosts on the network. How can it do this? My... (3 Replies)
Discussion started by: Ultrix
3 Replies

6. Shell Programming and Scripting

sed to remove newline chars based on pattern mis-match

Greetings Experts, I am in AIX; I have a file generated through awk after processing the input files. Now I need to replace or remove the new-line characters on all lines that doesn't have a ; which is the last character on the line. I tried to use sed 's/\n/ /g' After checking through the... (6 Replies)
Discussion started by: chill3chee
6 Replies

7. War Stories

The (Mis)Information Age – The End of the World as We Know It and What Vault7 Teaches Us

I hope you will enjoy reading this essay I wrote: The (Mis)Information Age – The End of the World as We Know It and What Vault7 Teaches Us If you are a true "IT person" i.e. a software developer, code or deep system admin, I think you will resonate with the theme of my essay. I could... (8 Replies)
Discussion started by: Neo
8 Replies
IpfilterDlfConverter(3pm)				  LogReport's Lire Documentation				 IpfilterDlfConverter(3pm)

NAME
Lire::Firewall::IpfilterDlfConverter - convert ipf (ipmon) logs to firewall DLF DESCRIPTION
Lire::Firewall::IpfilterDlfConverter converts Ipfilter logs into firewall DLF format. Input for this converter is the standard ipf syslog log file as produced by ipmon. IP Filter is shipped with FreeBSD, OpenBSD (up to 2.9) and some other OS's. EXAMPLE
A ipfilter logfile which looks like Oct 30 07:42:29 rolle ipmon[16747]: 07:42:28.585962 ie0 @0:9 b 192.168.48.1,45085 -> 192.168.48.2,22 PR tcp len 20 64 -S OUT Oct 30 07:40:24 rolle ipmon[16747]: 07:40:23.631307 ep1 @0:6 b 192.168.26.5,113 -> 192.168.26.1,3717 PR tcp len 20 40 -AR OUT Oct 30 07:42:29 rolle ipmon[16747]: 07:42:28.585962 ie0 @0:9 b 192.168.48.1,45085 -> 192.168.48.2,22 PR tcp len 20 64 -S OUT Oct 30 07:44:11 rolle ipmon[16747]: 07:44:10.605416 2x ep1 @0:15 b 192.168.26.1,138 -> 192.168.26.255,138 PR udp len 20 257 IN Oct 30 07:44:34 rolle ipmon[16747]: 07:44:33.891869 ie0 @0:10 b 192.168.48.1,23406 -> 192.168.48.2,22 PR tcp len 20 64 -S OUT Oct 30 07:49:13 rolle ipmon[16747]: 07:49:12.554420 ep1 @0:15 b 210.132.100.117 -> 192.168.26.5 PR icmp len 20 56 icmp 3/3 for 192.168.26.5,61915 - 210.132.100.117,53 PR udp len 20 23040 IN Oct 30 07:50:23 rolle ipmon[16747]: 07:50:22.908107 ep1 @0:15 b 210.132.100.117 -> 192.168.26.5 PR icmp len 20 56 icmp 3/3 for 192.168.26.5,4480 - 210.132.100.117,53 PR udp len 20 19712 IN Oct 30 07:56:11 rolle ipmon[16747]: 07:56:11.113029 2x ep1 @0:15 b 192.168.26.1,138 -> 192.168.26.255,138 PR udp len 20 257 IN (that's: .... 'PR' protocol 'len' length_of_ip_headers_saved packetlength direction) will get converted to something like 994398737 denied igmp 100.187.115.1 - ep1 LIRE_NOTAVAIL 224.0.0.2 - 56 994398861 denied igmp 100.187.115.1 - ep1 LIRE_NOTAVAIL 224.0.0.1 - 56 994398862 denied igmp 100.187.115.1 - ep1 LIRE_NOTAVAIL 224.0.0.2 - 56 994406849 denied udp 192.168.26.4 137 ie0 LIRE_NOTAVAIL 192.168.26.255 137 116 994406850 denied udp 192.168.26.4 137 ie0 LIRE_NOTAVAIL 192.168.26.255 137 116 994406866 denied udp 192.168.26.4 137 ie0 LIRE_NOTAVAIL 192.168.26.255 137 98 SEE ALSO
ipl(4) for description of log structure. The ipmon.c source (e.g. on http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/ src/usr.sbin/ipmon/Attic/ipmon.c?rev=1.27& content-type=text/plain&hideattic=0 ) for the specification of the log syntax. The IP Filter webpage on http://coombs.anu.edu.au/~avalon/ip-filter.html AUTHOR
Joost van Baal <joostvb@logreport.org>, Wessel Dankers <wsl@logreport.org> VERSION
$Id: IpfilterDlfConverter.pm,v 1.7 2009/03/15 08:10:55 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001-2003 Stichting LogReport Foundation LogReport@LogReport.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2009-03-15 IpfilterDlfConverter(3pm)
All times are GMT -4. The time now is 02:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy