Top Nav

Howto Configure Ethernet Bridge

Let’s assume you have a server with two Ethernet network interface. You wish to bridge traffic between the interfaces. Here are the commands to setup the bridge:

1. Take eth0 off line

2. Take eth1 off line

3. Define a bridge named “bridge01”

4. Add eth0 to the bridge named “bridge01”

5. Add eth1 to the bridge named “bridge01”

6. Bring up the Ethernet interfaces with no IP addresses:

7. Bring the bridge online with a single ip address

Try to test by ping from one side of the bridge to the other. It may take up to 30 seconds for the ping to start running due to the learning phase on the bridge.

If it fails then double check the above setup. Take a look at the MAC addresse that the bridge sees with:

Verify that there is no bridge filtering is turned on:

Also might need to enable IP forwarding in /etc/sysctl or with:

If you actually want to be able to filter via iptables, the bridged traffic then turn on bridge-nf for iptables:

Now bridged packets will be passed through the FORWARD chain. So for example to log all packets one could do:

or to block all UDP traffic:

Additional resources:

NetBridge
Ethernet Bridge + netfilter Howto
Bridge-nf FAQ