Sunday, October 4, 2009

Linux Ethernet Bridge

The Linux ethernet bridge can be used for connecting multiple ethernet devices together. The connection is fully transparent: hosts connected to one ethernet device see hosts connected to the other ethernet devices directly.

Requirements:
  1. Two Physical (Real) Network Card (NIC) (minimum)
  2. bridge-utils - This package contains utilities for configuring the Linux ethernet bridge.
Steps:
1. Zero IP the interfaces.
        # ifconfig eth0 0.0.0.0
        # ifconfig eth1 0.0.0.0

                OR

        # ifconfig eth0 up promisc
        # ifconfig eth1 up promisc


2. Create the bridge interface.
        # brctl addbr br0

3. Add interfaces to the bridge.
        # brctl addif br0 eth0
        # brctl addif br0 eth1

        OR

        # brctl addif br0 eth0 eth1

4. Put up the bridge.
        # ifconfig mybridge up

5. The virtual interface br0 can also be configured to take part in network. It behaves like real interface (like a normal network card).
        # ifconfig br0 192.168.200.100 netmask 255.255.255.0

2 comments:

  1. Should I change something if I'm using https://www.softinventive.com/total-network-monitor/ for creating bridge? Or you are nor very common with this software ?

    ReplyDelete
  2. not familiar with that software, but you do not need to change anything for creating bridge on linux

    ReplyDelete