* Packet capturing, iptables and eth0 vs. dummy0
@ 2004-11-17 20:30 DervishD
2004-11-17 20:46 ` Don Lafontaine
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: DervishD @ 2004-11-17 20:30 UTC (permalink / raw)
To: Linux-kernel
Hi all :)
I've noticed that, no matter what filtering is iptables doing,
tcpdump gets all packets from interface eth0 as seen in the bus, but
doesn't do the same in dummy0. I'll explain it further...
Let's say that I'm filtering all incoming TCP SYN packets on all
interfaces that have a destination port of 6666 (for example), and
I'm listening, with tcpdump, to all packets in eth0. Well, I use
another computer to try to connect to port 6666 of the machine
running tcpdump and the packet filter, and obviously I'm unable to
connect (without the filter I can do it normally), but I see the SYN
packets in the output of tcpdump.
If I do exactly the same from the machine running tcpdump and the
filter, I cannot connect (without the filter I can), but no output
comes from tcpdump, which is exactly what I expected in the case
explained in the paragraph above.
Is is normal? Is normal that tcpdump shows packets before they
enter the filter when the interface is a real one (eth0) but no when
you access through a dummy interface or localhost, or am I missing
anything?
Thanks a lot in advance :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Packet capturing, iptables and eth0 vs. dummy0
2004-11-17 20:30 Packet capturing, iptables and eth0 vs. dummy0 DervishD
@ 2004-11-17 20:46 ` Don Lafontaine
2004-11-17 21:00 ` Martin Josefsson
2004-11-17 21:38 ` Harald Welte
2 siblings, 0 replies; 6+ messages in thread
From: Don Lafontaine @ 2004-11-17 20:46 UTC (permalink / raw)
To: Linux-kernel
That's because when you try locally, you end up using lo0, not eth0.
On Wed, 17 Nov 2004 21:30:33 +0100, DervishD <lkml@dervishd.net> wrote:
> Hi all :)
>
> I've noticed that, no matter what filtering is iptables doing,
> tcpdump gets all packets from interface eth0 as seen in the bus, but
> doesn't do the same in dummy0. I'll explain it further...
>
> Let's say that I'm filtering all incoming TCP SYN packets on all
> interfaces that have a destination port of 6666 (for example), and
> I'm listening, with tcpdump, to all packets in eth0. Well, I use
> another computer to try to connect to port 6666 of the machine
> running tcpdump and the packet filter, and obviously I'm unable to
> connect (without the filter I can do it normally), but I see the SYN
> packets in the output of tcpdump.
>
> If I do exactly the same from the machine running tcpdump and the
> filter, I cannot connect (without the filter I can), but no output
> comes from tcpdump, which is exactly what I expected in the case
> explained in the paragraph above.
>
> Is is normal? Is normal that tcpdump shows packets before they
> enter the filter when the interface is a real one (eth0) but no when
> you access through a dummy interface or localhost, or am I missing
> anything?
>
> Thanks a lot in advance :)
>
> Raúl Núñez de Arenas Coronado
>
> --
> Linux Registered User 88736
> http://www.dervishd.net & http://www.pleyades.net/
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Don Lafontaine
http://www.avsim.com/hangar/utils/freefd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Packet capturing, iptables and eth0 vs. dummy0
2004-11-17 20:30 Packet capturing, iptables and eth0 vs. dummy0 DervishD
2004-11-17 20:46 ` Don Lafontaine
@ 2004-11-17 21:00 ` Martin Josefsson
2004-11-17 23:14 ` DervishD
2004-11-17 21:38 ` Harald Welte
2 siblings, 1 reply; 6+ messages in thread
From: Martin Josefsson @ 2004-11-17 21:00 UTC (permalink / raw)
To: DervishD; +Cc: Linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]
On Wed, 2004-11-17 at 21:30, DervishD wrote:
> Hi all :)
>
> I've noticed that, no matter what filtering is iptables doing,
> tcpdump gets all packets from interface eth0 as seen in the bus, but
> doesn't do the same in dummy0. I'll explain it further...
[snip]
> If I do exactly the same from the machine running tcpdump and the
> filter, I cannot connect (without the filter I can), but no output
> comes from tcpdump, which is exactly what I expected in the case
> explained in the paragraph above.
>
> Is is normal? Is normal that tcpdump shows packets before they
> enter the filter when the interface is a real one (eth0) but no when
> you access through a dummy interface or localhost, or am I missing
> anything?
Try sniffing on the 'lo' interface instead of 'dummy0' since all packets
generated by the local machine destined for the local machine goes via
the ´lo' interface. ipaddresses looks like they belong to interfaces but
that's not the case with linux, they belong to the machine.
'ip route list table local'
All packets destined for entries marked as "local" will go through the
'lo' interface.
--
/Martin
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Packet capturing, iptables and eth0 vs. dummy0
2004-11-17 20:30 Packet capturing, iptables and eth0 vs. dummy0 DervishD
2004-11-17 20:46 ` Don Lafontaine
2004-11-17 21:00 ` Martin Josefsson
@ 2004-11-17 21:38 ` Harald Welte
2004-11-17 23:17 ` DervishD
2 siblings, 1 reply; 6+ messages in thread
From: Harald Welte @ 2004-11-17 21:38 UTC (permalink / raw)
To: Linux-kernel
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
On Wed, Nov 17, 2004 at 09:30:33PM +0100, DervishD wrote:
> Hi all :)
Hi!
please send netfilter/iptables related questions to the respective
lists:
netfilter@lists.netfilter.org (for user questions)
netfilter-devel@lists.netfilter.org (for development issues)
> I've noticed that, no matter what filtering is iptables doing,
> tcpdump gets all packets from interface eth0 as seen in the bus,
This is correct. iptables is a IPv4 packet filter. It is part of the
IPv4 stack. tcpdump uses PF_PACKET which attaches right above the
NIC driver, therefore you capture packets way before they enter the IPv4
stack.
> Raúl Núñez de Arenas Coronado
--
- Harald Welte <laforge@gnumonks.org> http://www.gnumonks.org/
============================================================================
Programming is like sex: One mistake and you have to support it your lifetime
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Packet capturing, iptables and eth0 vs. dummy0
2004-11-17 21:00 ` Martin Josefsson
@ 2004-11-17 23:14 ` DervishD
0 siblings, 0 replies; 6+ messages in thread
From: DervishD @ 2004-11-17 23:14 UTC (permalink / raw)
To: Martin Josefsson; +Cc: Linux-kernel
Hi Martin :)
* Martin Josefsson <gandalf@wlug.westbo.se> dixit:
> > Is is normal? Is normal that tcpdump shows packets before they
> > enter the filter when the interface is a real one (eth0) but no when
> > you access through a dummy interface or localhost, or am I missing
> > anything?
> Try sniffing on the 'lo' interface instead of 'dummy0' since all packets
> generated by the local machine destined for the local machine goes via
> the ´lo' interface. ipaddresses looks like they belong to interfaces but
> that's not the case with linux, they belong to the machine.
That seemed to be the problem, thanks :)))
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Packet capturing, iptables and eth0 vs. dummy0
2004-11-17 21:38 ` Harald Welte
@ 2004-11-17 23:17 ` DervishD
0 siblings, 0 replies; 6+ messages in thread
From: DervishD @ 2004-11-17 23:17 UTC (permalink / raw)
To: Harald Welte; +Cc: Linux-kernel
Hi Harald :)
* Harald Welte <laforge@gnumonks.org> dixit:
> On Wed, Nov 17, 2004 at 09:30:33PM +0100, DervishD wrote:
> please send netfilter/iptables related questions to the respective
> lists:
> netfilter@lists.netfilter.org (for user questions)
> netfilter-devel@lists.netfilter.org (for development issues)
This time the iptables issue was just... collateral, so to say.
The problem was with tcpdump since I knew that packets were being
filtered.
> > I've noticed that, no matter what filtering is iptables doing,
> > tcpdump gets all packets from interface eth0 as seen in the bus,
> This is correct. iptables is a IPv4 packet filter. It is part of the
> IPv4 stack. tcpdump uses PF_PACKET which attaches right above the
> NIC driver, therefore you capture packets way before they enter the IPv4
> stack.
OK, I didn't see the problem from that perspective. Anyway, using
'lo' instead of 'dummy' solved the problem :)
Thanks for the help :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-11-18 6:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-17 20:30 Packet capturing, iptables and eth0 vs. dummy0 DervishD
2004-11-17 20:46 ` Don Lafontaine
2004-11-17 21:00 ` Martin Josefsson
2004-11-17 23:14 ` DervishD
2004-11-17 21:38 ` Harald Welte
2004-11-17 23:17 ` DervishD
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.