bridge and FORWARD chain
Friends,
I have a linux bridge, using bridge-utils... I've worked with bridges before and never had the problem I'm having now...
The packets go from interface to interface, but never reach the FORWARD chain on iptables... How is that possible?
Here's an example... The bridge has an uptime of 17hrs, working with no problems at all, yet, no packets on FORWARD chain...
# uptime 17:54:46 up 17:54, load average: 0.00, 0.00, 0.00 # iptables -L -vn Chain INPUT (policy ACCEPT 5262 packets, 1012K bytes) pkts bytes target prot opt in out source destination
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2953 packets, 940K bytes)
pkts bytes target prot opt in out source destination
The main reason of this bridge is to filter some unwanted traffic coming from the network behind it... So, I need the FORWARD chain for that...
Anything on /proc or something that can disable it?
Signature · 1 line
Marcelus Trojahn
Marcelus,
I only know a little about bridging so if I'm wrong please jump in. Netfilter is designed to work on the interface that the data is traveling across. When you have two interfaces that are bridged they are now one interface. You need to treat the bridge as such. If you have the following:
eth0 - inet
eth1 - DMZ
eth2 - lan
brd0 - (eth0 + eth1)
Forwarding from eth0+eth1 is automatically occurring (via the bridge). Forward rules on eth0 or eth1 no longer apply as it's brd0
Now forwarding from brd0 to/from eth2 should work.
If you need to limit forward traffic between eth0 to eth1 you need to look towards ebtables.
That's my understanding.
Hope that helps.
Gary Wayne Smith
Quoted 34 lines · Marcelus Trojahn
Friends,
I have a linux bridge, using bridge-utils... I've worked with bridges
before
and never had the problem I'm having now...The packets go from interface to interface, but never reach the FORWARD
chain
on iptables... How is that possible?Here's an example... The bridge has an uptime of 17hrs, working with
no
problems at all, yet, no packets on FORWARD chain...# uptime 17:54:46 up 17:54, load average: 0.00, 0.00, 0.00 # iptables -L -vn Chain INPUT (policy ACCEPT 5262 packets, 1012K bytes) pkts bytes target prot opt in out source destinationChain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source
destinationChain OUTPUT (policy ACCEPT 2953 packets, 940K bytes)
pkts bytes target prot opt in out source
destinationThe main reason of this bridge is to filter some unwanted traffic coming
from
the network behind it... So, I need the FORWARD chain for that...Anything on /proc or something that can disable it?
Delron,
I understand that but my experience differs...
When I was researching about linux bridges, before I installed the first one, I read that I'd need to use ebtables to filter the traffic but I still tried iptables and, for my surprise, it worked...
That's why I can't understand why this won't work in this new bridge... What would explain it working in the old one? The only difference on the old one is that I have an interface out of the bridge...
Signature · 4 lines
Marcelus Trojahn Tuesday, January 24, 2006, 4:12:56 PM, voce escreveu:
Quoted 39 lines
Hi Marcelus
You would not see any packets at Layer 3 - Its a bridge, bridging at Layer 2.
You would need to route in order to see packets entering the chains.
Cheers
Delron
Quoted 28 lines
Friends,
I have a linux bridge, using bridge-utils... I've worked with bridges before and never had the problem I'm having now...
The packets go from interface to interface, but never reach the FORWARD chain on iptables... How is that possible?
Here's an example... The bridge has an uptime of 17hrs, working with no problems at all, yet, no packets on FORWARD chain...
# uptime 17:54:46 up 17:54, load average: 0.00, 0.00, 0.00 # iptables -L -vn Chain INPUT (policy ACCEPT 5262 packets, 1012K bytes) pkts bytes target prot opt in out source destinationChain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destinationChain OUTPUT (policy ACCEPT 2953 packets, 940K bytes)
pkts bytes target prot opt in out source destinationThe main reason of this bridge is to filter some unwanted traffic coming from the network behind it... So, I need the FORWARD chain for that...
Anything on /proc or something that can disable it?
Michael,
Yes, I did setup 2 bridges that still work today and have iptables rules on the FORWARD chain...
This new one, specifically, is different... It's a linux-based firmware to an Access-Point... So, I have no control how the kernel was compiled or even can't tell... The only thing I can edit on this firmware is 1 file that I can add some commands and make my own script...
I'll try some rules in mangle table to see if it works...
Signature · 3 lines
Marcelus Trojahn Wednesday, January 25, 2006, 1:46:38 AM, voce escreveu:
Quoted 106 lines
Hello,
How did you setup your bridge ?
I have setup bridges in the past and packets do go through the foward chain, also you can do filtering at other tables besdies the forward table. For example if you setup a bridge and wanted to use a layer7 filter then you would need to setup your filters on the mangle table.
To setup a bridge I would use the following:
3 interfaces - 2 for the bridge and 1 for management. Lets say eth0 is the management interface.
I have used the following in a script:
#Bringing up interfaces with no IP
echo "Bringing up eth1"
ifconfig eth1 upecho "Bringing up eth2"
ifconfig eth2 up# Creating bridge
echo "Creating bridge device"
brctl addbr br0#Add ethernet interfaces
echo "Adding eth1 to br0 device"
/usr/sbin/brctladdif br0 eth1echo "Adding eth2 to br0 device"
/usr/sbin/brctladdif br0 eth2#Turn off spanning tree protoco
echo "Turning STP off"
/usr/sbin/brctlstp br0 off#Bringing up bridge device
echo "Starting bridge ... 30 second to packet transfer available" ifconfig br0 upThen I use iptables to do nice things.
In my kernel I have the following:
CONFIG_BRIDGE_NETFILTER=y
#
# Bridge: Netfilter Configuration
#CONFIG_BRIDGE_NF_EBTABLES=mCONFIG_BRIDGE_EBT_BROUTE=mCONFIG_BRIDGE_EBT_T_FILTER=mCONFIG_BRIDGE_EBT_T_NAT=mCONFIG_BRIDGE_EBT_802_3=mCONFIG_BRIDGE_EBT_AMONG=mCONFIG_BRIDGE_EBT_ARP=mCONFIG_BRIDGE_EBT_IP=mCONFIG_BRIDGE_EBT_LIMIT=mCONFIG_BRIDGE_EBT_MARK=mCONFIG_BRIDGE_EBT_PKTTYPE=mCONFIG_BRIDGE_EBT_STP=mCONFIG_BRIDGE_EBT_VLAN=mCONFIG_BRIDGE_EBT_ARPREPLY=mCONFIG_BRIDGE_EBT_DNAT=mCONFIG_BRIDGE_EBT_MARK_T=mCONFIG_BRIDGE_EBT_REDIRECT=mCONFIG_BRIDGE_EBT_SNAT=mCONFIG_BRIDGE_EBT_LOG=mCONFIG_BRIDGE_EBT_ULOG=m
CONFIG_BRIDGE=yMichael
-----Original Message-----
From: [email protected] on behalf of Marcelus Trojahn
Sent: Tue 1/24/2006 12:23 PM
To: [email protected]
Subject: bridge and FORWARD chainFriends,
I have a linux bridge, using bridge-utils... I've worked with bridges before and never had the problem I'm having now...
The packets go from interface to interface, but never reach the FORWARD chain on iptables... How is that possible?
Here's an example... The bridge has an uptime of 17hrs, working with no problems at all, yet, no packets on FORWARD chain...
# uptime 17:54:46 up 17:54, load average: 0.00, 0.00, 0.00 # iptables -L -vn Chain INPUT (policy ACCEPT 5262 packets, 1012K bytes) pkts bytes target prot opt in out source destinationChain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destinationChain OUTPUT (policy ACCEPT 2953 packets, 940K bytes)
pkts bytes target prot opt in out source destinationThe main reason of this bridge is to filter some unwanted traffic coming from the network behind it... So, I need the FORWARD chain for that...
Anything on /proc or something that can disable it?