We can setup a network bridge in Debian and Redhat systems using the following methods
In RedHat Linux do the following
First install bridge-utils using yum or rpm or utility you like
Remove the ip address of the ethernet interfaces. You need a minimum of two
Then issue the following commands
#> brctl addbr br0
#> brctl addif br0 eth0
#> brctl addif br0 eth1
#> ip link set br0 up
And the bridge is ready.
To set ip address to bridge you can use
#> ip addr add 10.1.1.18/16 brd + dev br0
To configure routing on that bridge use the following command. This sets default gateway
#> route add default gw 10.1.1.1 dev br0.
In Debian use the following commands
To install bridge-utils
aptitude install bridge-utils
Then issue following commands
iface br0 inet static
To make the change permanent you have to enter these commands (except the installing command) in rc.local file in the /etc directory (Redhat ) /etc/network/interfaces ( for Debian based systems).
The brctl comes with various options inlcuding stp and others. Read manpage for details.