Help With Networking - Bridge Networking Not Working

Discussions related to using VirtualBox on Linux hosts.
Post Reply
SupaRice
Posts: 6
Joined: 25. Jun 2008, 00:48

Help With Networking - Bridge Networking Not Working

Post by SupaRice »

So I've got Ubuntu 8.04, and I installed the latest version of VirtualBox via the .deb from the site. I then followed the directions in the user manual for setting up a bridge interface and assigning a vbox0 to it. My WindowsXP guest networking doesn't seem to work though. I've combed through some of the threads on here and on ubunutforums and can't figure out what I've got wrong.

I did:

Code: Select all

sudo apt-get install bridge-utils
sudo VBoxAddIF vbox0 <user> br0
chmod 666 /dev/net/tun
And my ifconfig:

Code: Select all

br0       Link encap:Ethernet  HWaddr 00:1d:09:9c:8a:bd  
          inet addr:172.20.227.210  Bcast:172.20.227.255  Mask:255.255.255.0
          inet6 addr: fe80::21d:9ff:fe9c:8abd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8387 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7701 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7205789 (6.8 MB)  TX bytes:1290801 (1.2 MB)

eth0      Link encap:Ethernet  HWaddr 00:1d:09:9c:8a:bd  
          inet6 addr: fe80::21d:9ff:fe9c:8abd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1045924 errors:0 dropped:0 overruns:0 frame:0
          TX packets:549302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:1555093968 (1.4 GB)  TX bytes:40731369 (38.8 MB)
          Memory:fdfc0000-fdfe0000 

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:2293 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2293 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:130742 (127.6 KB)  TX bytes:130742 (127.6 KB)

vbox0     Link encap:Ethernet  HWaddr 00:ff:de:c5:08:d4  
          inet6 addr: fe80::2ff:deff:fec5:8d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:134 errors:0 dropped:0 overruns:0 frame:0
          TX packets:230 errors:0 dropped:31 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:22009 (21.4 KB)  TX bytes:17184 (16.7 KB)
And my /etc/network/interfaces

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address 172.20.227.210
        netmask 255.255.255.0
        network 172.20.227.0
        broadcast 172.20.227.255
        gateway 172.20.227.1
        dns-nameservers 172.20.227.209
        dns-search here.com
        bridge_ports eth0
I also entered "host interface" under attached to in the network settings, and entered "vbox0" under "interface name".

I'm sure this is something simple and dumb, anyone know what I've done wrong?
SupaRice
Posts: 6
Joined: 25. Jun 2008, 00:48

Post by SupaRice »

Also of interest is that if I give the guest a static IP, and ping from him to the default gateway I get no ICMP when doing a TCPDUMP on the eth0 and br0 interfaces. I do see the pings when I TCPDUMP the vbox0.
SupaRice
Posts: 6
Joined: 25. Jun 2008, 00:48

Post by SupaRice »

And it seems that now, I end up getting connectivity problems on the host. I end up with the static on br0 and a DHCP address on eth0.

Arrrgh!
SupaRice
Posts: 6
Joined: 25. Jun 2008, 00:48

Post by SupaRice »

Anybody?
bundabrg
Posts: 47
Joined: 22. Feb 2008, 04:01

Post by bundabrg »

It all looks quite correct.

Can you confirm the bridge is up and running? IE: -

Code: Select all

brclt show
It should list both 'eth0' and 'vbox0' as interfaces..

Also the fact you get DHCP on eth0 sounds like you may have edited /etc/network/interfaces and changed eth0 from 'manual' to 'dhcp'?

Finally, I doubt this is the case, but sometimes NetworkManager gets in the way. Just make sure (if you're running it) that its not automatically configuring eth0 (It shouldn't if you've set it in /etc/network/interfaces as you posted).
phantom21
Posts: 17
Joined: 31. Jul 2007, 17:00
Location: Queens, NY

that's brctl

Post by phantom21 »

the actual command to show whether a bridge is up is:

brctl show

Mark
SupaRice
Posts: 6
Joined: 25. Jun 2008, 00:48

Post by SupaRice »

Well...... After rebooting, it seems to work now.... :?
pete_l
Posts: 62
Joined: 23. May 2008, 15:10

Post by pete_l »

SupaRice wrote:Well...... After rebooting, it seems to work now.... :?
Yes - that's what brought my 8.04 bridged configuration to life.
The manual seems to be a bit optimistic with the statement that
you only have to restart the networking interface. Maybe that works
OK with other Linux/Unix versions.

Just in case anyone's interested, here's my barebones /etc/network/interfaces file:

Code: Select all

auto lo
iface lo inet loopback

# set up bridge for Virtualbox "host interface networking"

auto eth1
iface eth1 inet manual
  up ifconfig eth1 0 0 0 0 up
  down ifconfig eth1 down

auto br0
iface br0 inet dhcp
  bridge_ports eth1
Post Reply