After extensive testing, I believe that the combination
netfilter-iproute2-bridge does not work. The following has been set up
on a machine:
- A transparent bridge between eth0 and eth1 (Bridge code patched, so
it act as a hub)
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
brctl stp br0 off
- Marking certain sessions with netfilter
iptables -t mangle -A PREROUTING -m conntrack --ctorigsrc <address> -j
MARK --set-mark 1
iptables -t mangle -A PREROUTING -m mark --mark 1 -j LOG --log-prefix
"Mark: " #used only for testing
- ip2routing based on netfilter marks
ip rule add fwmark 1 table 2
ip route add 0/0 dev eth2 table 2
A simple drawing of the setup. Notice that the box is located off the
main wire.
External net |
------------ eth2
| +--+--+
TAP----eth0+ +eth1--
| +-----+
------------
Internal net
All interfaces are configured as follows:
ip addr add 0.0.0.0 dev {eth0, eth1, eth2, br0}
ip link set {eth0, eth1, eth2, br0} arp off up
The marking of packets works correctly (log as expected), but iproute2
does not perform routing.
Any suggestions to why this does not work?
-
BTW, using the netfilter route patch/module is not an option as this
removes state entries from /proc/net/ip_conntrack.
I recently found a similar case on this group:
http://groups.google.com/groups?hl=e...5bc.0407202219
..8daacc3%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF
-8%26selm%3Dd10945bc.0407202219.8daacc3%2540posting .google.com