You are not logged in.

#1 2009-03-04 15:40:15

mightybyte
Member
Registered: 2009-03-04
Posts: 2

Network Bridge Problem [solved]

I've been trying to get an ethernet bridge working on x86_64 without success.  I'm using dhcp on my network and without bridging here is the output from ifconfig:

host ~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1C:C4:AD:18:5A
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:c4ff:fead:185a/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:51058 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10517472 (10.0 Mb)  TX bytes:5620540 (5.3 Mb)
          Interrupt:17

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:405496 (395.9 Kb)  TX bytes:405496 (395.9 Kb)

I found some several howtos that indicated the following approach to starting the bridge.

brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
dhcpcd br0

When I do this, my external network goes down after the "brctl addif" command and doesn't come back up with the dhcpcd command.  I've also tried to get this to work through the normal network configuration in /etc/conf.d/bridges and /etc/rc.conf, but was unsuccessful there as well.  I want to get it working manually before I try to use the automatic configuration approach.  Ultimately my goal is to use the bridge with a tap interface to let a KVM guest access the external network.  But first I need to get my local machine working through the bridge.  Anyone know how to solve this problem or at least point me in the right direction?  Nothing I've found so far has worked.

Last edited by mightybyte (2009-03-05 12:50:53)

Offline

#2 2009-03-04 18:28:13

mcover
Member
From: Germany
Registered: 2007-01-25
Posts: 134

Re: Network Bridge Problem [solved]

How ironic, I just replied to another thread about bridge usage.

See thread: http://bbs.archlinux.org/viewtopic.php?id=66703
However in the above thread, its about bridging two physical networks together. Since you probably want to use a VM, I modified the code.

However see the full modified script for tun/tap/qemu usage below:
http://pastebin.ca/1352845

Do you want to use qemu with kvm?

If so, specify -net user -net tap,[..,]script=thescript on cmdline to start qemu with tun/tap (tough the bridge needs to be setup before).

m.

Offline

#3 2009-03-05 12:50:31

mightybyte
Member
Registered: 2009-03-04
Posts: 2

Re: Network Bridge Problem [solved]

Your script worked.  I think the only differences from what I was trying before were the "brctl setfd" and "brctl sethello" lines.  That, and possibly the promiscuous mode, although I know I tried that at least once.  I am using this to network with qemu with kvm.  It is working now too.  Thanks for the help.

Offline

#4 2010-01-19 22:54:54

conrausch
Member
Registered: 2010-01-19
Posts: 2

Re: Network Bridge Problem [solved]

Offline

Board footer

Powered by FluxBB