Linux ETH Bridging LFS

Turn your Linux server into a humble switch… Not so humble though.
Linux From Scratch specific.

What you need:
Kernel Version 2.4 or higher.
Kernel Configuration ‘802.1d Ethernet Bridging’ build in or module.
A working network configuration with atleast 2 Eth’s (nic’s)
Package ‘bridge-utils’ installed.

What you get:
A network switch with a working IP connection for the server it self to use.

Configuration:

# /etc/sysconfig/ifconfig.eth0
ONBOOT=no
IFACE=eth0
SERVICE=ipv4-static
# /etc/sysconfig/ifconfig.eth1
ONBOOT=no
IFACE=eth1
SERVICE=ipv4-static

etc. etc. for all network cards you want to participate in the bridge.

Then setup a virtual device so that the server as an IP address of it’s own.
Like below.

# /etc/sysconfig/ifconfig.br0
ONBOOT=yes
IFACE=br0
SERVICE="bridge ipv4-static"
IP=192.168.1.1
GATEWAY=192.168.1.254
PREFIX=24
BROADCAST=192.168.1.255
CHECK_LINK=no
STP=no
INTERFACE_COMPONENTS="eth0 eth1"
IP_FORWARD=true

Set the bridging driver to not pass packets to iptables.

# echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables.

Or if you choose to do pass packets to iptables then set iptables forwarding chain to ACCEPT.

note*
The BLFS book has a error in the example #/etc/sysconfig/ifconfig.br0
Instead of the INTERFACES argument use INTERFACE_COMPONENTS.
(edit)
This has been fixed as per SVN 2013 version.