Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@vger.kernel.org
Subject: Re: Possible IPTables bug in INPUT interface filtering?
Date: Fri, 16 Apr 2010 17:23:12 +0200	[thread overview]
Message-ID: <4BC880E0.3070100@plouf.fr.eu.org> (raw)
In-Reply-To: <p2l464fbb2d1004152012p719184c9g57ac7c7562994929@mail.gmail.com>

Hello,

John Engelke a écrit :
> Hello IPFilter Guru World,

This list is about Netfilter, not IPFilter.

> I've encountered some strangeness in filtering on a multihomed Linux
> box, CentOS 5, x86_64, 2.6.18-164.15.1.el5, where using the interface
> flag (-i) does not work.
> 
> So this box has two interfaces on the local subnet, eth0 and eth1.

Are both interfaces connected to the same subnet ? If so, I don't call
this "multihomed".

> I
> would like to restrict VNC to only one of the interfaces, eth1. At the
> start, VNC does not work. So I add this:
> 
> -A INPUT -i eth1 -p tcp -m multiport --port 5900 -j ACCEPT
> 
> Then, VNC starts working on eth0 AND eth1.

Are you sure ? How do you know ?

> Since I know the address of eth1, I then put it in explicitly as:
> 
> -A INPUT -i eth1 -p tcp -d 192.168.1.34 -m multiport --port 5900 -j ACCEPT
> 
> Amazingly, this works and now VNC traffic is only allowed on eth1
> (address 192.168.1.34). So I believe I am concluding correctly that
> interface filtering *does not work* for INPUT statements in multihomed
> machines. I also wonder if it does not work at all for any interface.

It works for lots of people - including myself - who run multihomed
boxes such as routers.

If both interfaces are connected to the same subnet, by default your box
accepts packets destined to any local non-loopback address on any
interface, including packets destined to the address assigned to eth1 on
eth0 and vice versa. This is because Linux enforces the "weak" host model.

  reply	other threads:[~2010-04-16 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16  3:12 Possible IPTables bug in INPUT interface filtering? John Engelke
2010-04-16 15:23 ` Pascal Hambourg [this message]
2010-04-19 22:15   ` John Engelke
2010-04-20 10:37     ` Pascal Hambourg
2010-04-21 18:27 ` Narendra Choyal
2010-04-21 21:30   ` Richard Horton
2010-04-21 22:10     ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC880E0.3070100@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox