LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   failed in debian to configure the net bridge (https://www.linuxquestions.org/questions/linux-networking-3/failed-in-debian-to-configure-the-net-bridge-727567/)

c-penguin 05-21-2009 11:27 AM

failed in debian to configure the net bridge
 
fllow these,
1. First install the bridge utilities (bridge-utils). package. You can do this fromthe command line as follows:

sudo apt-get install bridge-utils

2. Next, you must add an entry to the file /etc/network/interfacesto de-scribe the bridge. The following sample entry creates a bridgecalled br0, addsthe host ethernet interface eth0 to it and tells it toobtain an IP address usingDHCP so that the host remains able to accessthe network.

auto br0
iface br0 inet dhcp
bridge_ports eth0

You will probably want to change this to suit your own networkingneeds. Inparticular, you may want to assign a static IP address to thebridge.
3. Restart networking on the host:

sudo /etc/init.d/networking restart

After this the bridge will be recreated every time you boot your host system.

after above,the addresses of br0 and eth0 are the same,and my host(debian5)can't ping my local or outside,then I am so sad.
Does any one know about these?

c-penguin 05-22-2009 12:03 PM

Can anyone help me ?

herbie_popnecker 05-22-2009 03:05 PM

remember the bridge entirely replaces your NICs in /etc/network/interfaces, so:
Code:

auto lo
iface lo inet loopback

auto bridge01
iface bridge01 inet dhcp
  pre-up ifconfig eth0 down
  pre-up ifconfig eth1 down
  pre-up brctl addbr bridge01
  pre-up brctl addif bridge01 eth0
  pre-up brctl addif bridge01 eth1
  pre-up ifconfig eth0 0.0.0.0
  pre-up ifconfig eth1 0.0.0.0
  post-down ifconfig eth0 down
  post-down ifconfig eth1 down
  post-down ifconfig bridge01 down
  post-down brctl delif bridge01 eth0
  post-down brctl delif bridge01 eth1
  post-down brctl delbr bridge01

You can then apt-get install ntop or darkstat and point it at the bridge01 instead of eth0 or eth1 to watch traffic.
Oh yeah, sometimes it seems 'sudo /etc/init.d/networking restart' didn't actually clear the old file (in Ubuntu 9.04 I checked ifconfig and saw the old eth0 settings still) so I just rebooted and it works fine.

c-penguin 05-23-2009 10:03 AM

I also get one answer from orther forum:

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_maxwait 0
bridge_fd 0

and it work all right。

but I don't know the difference with yours. and I think this is more clearly.


All times are GMT -5. The time now is 12:21 PM.