All of lore.kernel.org
 help / color / mirror / Atom feed
From: s24067@rmc.ca
To: bridge@osdl.org
Subject: [Bridge] Bridging firewall issue - which interface are packets coming from?
Date: Sun, 21 Oct 2007 00:21:57 -0400	[thread overview]
Message-ID: <f64cba9929b9.471a9ba5@rmc.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

Hello folks, I'm hoping someone can help me here. I'll try to describe the problem in detail.

I'm attempting to set up a bridging firewall using libipq. I'm running on Ubuntu Server 7.04, out of the box kernel (2.6.20)
My bridge is set up with the following commands:
--
brctl addbr br0 
brctl stp br0 off
brctl addif br0 eth1
brctl addif br0 eth2
ifconfig eth1 down
ifconfig eth2 down
ifconfig eth1 0.0.0.0 up
ifconfig eth2 0.0.0.0 up
ifconfig br0 0.0.0.0 up
--

IP queue is set up with the following:
--
iptables -A FORWARD -j QUEUE
modprobe ip_queue
--


The bridge works fine. Traffic is sent back and forth. My libipq app can see traffic and stop it. However, one thing I would like to be able to find out in user space is which interface a packet arrived on (ie/ which direction it's going). As far as IPQ is concerned, all packets are arriving and leaving on br0.
After reading a bit more about netfilter, iptables and the FIREWALL document distributed with brctl, I figured my best bet would be do something like this:
iptables -A INPUT -i eth1 -j MARK --set-mark 1
iptables -A INPUT -i eth2 -j MARK --set-mark 2

This way I could just check the mark value when the packet got sent to QUEUE (and up to user space) from the FORWARD chain. However, this doesn't work. From everything I can tell, packets traversing the bridge do not even go through the INPUT chain, as I can put in this rule:
iptables -A INPUT -j DROP

yet traffic still flows through fine (as long as my libipq app is running).


Does anyone here have any ideas? I would really appreciate any suggestions.

Cheers,
David Vessey



[-- Attachment #2: Type: text/html, Size: 1723 bytes --]

             reply	other threads:[~2007-10-21  4:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21  4:21 s24067 [this message]
2007-10-22 16:13 ` [Bridge] Bridging firewall issue - which interface are packets coming from? Stephen Hemminger

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=f64cba9929b9.471a9ba5@rmc.ca \
    --to=s24067@rmc.ca \
    --cc=bridge@osdl.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 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.