From: Mike Wright <xktnniuymlla@mailinator.com>
To: "Snyder, Brian" <bsnyder@idirect.net>
Cc: netfilter@lists.netfilter.org
Subject: Re: Question about iptables and bridging
Date: Fri, 15 Dec 2006 14:08:10 -0800 [thread overview]
Message-ID: <45831CCA.2000907@mailinator.com> (raw)
In-Reply-To: <C874DBE9D30B584587F8CD0EC34DA8BE0377F879@EX00.idirect.net>
Snyder, Brian wrote:
> Hi all,
>
> I am currently using iptablesv1.3.5 on fedora core 5. At this point I
> am just playing around and trying to learn the system, but my general
> idea is to setup my linux box as a bridge. Ultimatly I then plan on
> using firewalling to redirect/drop whatever traffic is deemed worthy.
>
> So I have linux setup correctly as a bridge as so:
>
> br0 : inet addr - 172.20.134.7
> eth0 and eth1 are unaddressed and part of the bridge.
>
> I set this up as follows:
> sudo ifdown eth1
> sudo ifdown eth1
> sudo ifconfig eth0 0.0.0.0
> sudo ifconfig eth1 0.0.0.0
> sudo brctl addbr "br0"
> sudo brctl setfd br0 0
> sudo brctl addif br0 eth1
> sudo brctl addif br0 eth0
> sudo ifup br0
> sudo ifconfig br0 172.20.134.7 netmask 255.255.0.0
> sudo ip route add default 172.20.255.254
>
>
>
> Now my problem with iptable is the following:
>
> I tried to setup a rule to look for ICMP from a particular interface as
> such.
>
> iptables -t filter -A FORWARD -p icmp -i eth0
> iptables -t filter -A FORWARD -p icmp -i eth1
> iptables -t filter -A FORWARD -p icmp -i br0
>
> Now, the only filter that ever matches any packets is br0. So because
> of the way the bridge works, if I can't use eth0 or eth1 as input/output
> interfaces, then I can't really tell 'direction' of traffic between my
> lan and my wan.
>
> Is there something I am missing here? I would assume there is a way to
> do this (tell direction over bridge) but I don't know what it is.... so
> any help or pointers would be greatly appreciated.
Hi Brian,.
iptables -match physdev
From the iptables manpage: This module matches on the bridge port input
and output devices enslaved to a bridge device.
HTH
next prev parent reply other threads:[~2006-12-15 22:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-15 20:23 Question about iptables and bridging Snyder, Brian
2006-12-15 22:08 ` Mike Wright [this message]
2006-12-16 2:05 ` Grant Taylor
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=45831CCA.2000907@mailinator.com \
--to=xktnniuymlla@mailinator.com \
--cc=bsnyder@idirect.net \
--cc=netfilter@lists.netfilter.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