1 Bridging and firewalling
2 ------------------------
3 It is possible to use bridging in combination with firewalling. This is
4 a blatant violation of the OSI model, but it's very useful, so we don't
7 How do bridging and firewalling go together? First of all, you need a
8 kernel patch against the 2.4 kernel to actually make firewalling bridged
9 packets possible. You need to apply this patch to your kernel and recompile
10 it, or alternatively, download a pre-patched Red Hat 7.2 kernel RPM and use
11 that. The patch and kernel RPM are located at:
13 http://bridge.sourceforge.net/devel/bridge-nf/
15 Now if you boot with this kernel, you can use the regular iptables
16 firewalling as if you were doing routing. So, rules for forwarding are
17 added to the FORWARD chain, rules for input to the local machine are
18 added to the INPUT chain, etc. Things will work like you expect them to.
21 # iptables -A INPUT -i eth0 -j DROP
23 will drop all traffic coming from 'eth0', even if the interface the packets
24 are logically from is, say, 'br0'.
28 Lennert Buytenhek, November 7th 2001
33 --------------------------
34 Bridge+firewalling with 2.2 kernels is also possible, but deprecated. I
35 would severely recommend against using a 2.2 kernel and ipchains for bridge
36 firewalling. But if there's really a need, it's still possible. Apply the
37 extra firewalling patch available from the 'patches' section to your
38 already-patched-with-the-vanilla-bridge-patch 2.2 kernel, and recompile. Now
39 if you boot this kernel, the bridging code will check each to-be-forwarded
40 packet against the ipchains chain which has the same name as the bridge. So..
41 if a packet on eth0 is to be forwarded to eth1, and those interfaces are
42 both part of the bridge group br0, the bridging code will check the packet
43 against the chain called 'br0'. If the chain does not exist, the packet will
44 be forwarded. So if you want to do firewalling, you'll have to create the
45 chain yourself. This is important!