Tuesday, August 05, 2008

Setup network bridge in Debian and RedHat Linux

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 brd + dev br0

To configure routing on that bridge use the following command. This sets default gateway

#> route add default gw dev br0.

In Debian use the following commands

To install bridge-utils

aptitude install bridge-utils

Then issue following commands

auto br0
iface br0 inet static
bridge_ports eth0

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.


>#man brctl


Gr33n3gg said...

In Debian, you put all those commands in /etc/network/interfaces NOT /etc/rc.local

vinayan said...

Yes, Thanks for the correction..

Anonymous said...

Creating a bridge with only one port (via "bridge_ports eth0" in /etc/network/interfaces, as per your example) isn't very useful.

This should be amended to "bridge_ports all" or specify the relevant interfaces to be used, eg. "bridge_ports eth0 eth1".

More information on this is available in /usr/share/doc/bridge-utils/README.Debian.gz (Etch) or within the bridge-utils-interfaces(5) man page (Lenny).

Anonymous said...

Can anyone recommend the well-priced Managed Service program for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central remote windows login
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

I truly believe that we have reached the point where technology has become one with our society, and I am 99% certain that we have passed the point of no return in our relationship with technology.

I don't mean this in a bad way, of course! Ethical concerns aside... I just hope that as technology further develops, the possibility of copying our brains onto a digital medium becomes a true reality. It's one of the things I really wish I could see in my lifetime.

(Posted on Nintendo DS running [url=http://kwstar88.livejournal.com/491.html]R4[/url] DS QDos)

Arjun said...

"Remove the ip address of the ethernet interfaces"

is this necessary ?

Anonymous said...

efficient pour traiter les contractures [url=http://www.salevivi.com]ヴィトン バッグ[/url]pungent fragrance that is not overpowering [url=http://www.salevivi.com]ヴィトン バッグ[/url]protection of your child viiiHassle free [url=http://www.salevivi.com]ルイヴィトンのアウトレット[/url]range of applications of the Class IV Laser http://www.salevivi.com[/url] push on January Twenty five 1990 In the http://www.salevivi.com[/url] crashes Q What is a Tether The tether is