LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-20-2009, 09:11 PM   #1
bourne
Member
 
Registered: Feb 2006
Location: Toronto, Ontario
Distribution: Fedora 10, centos
Posts: 181

Rep: Reputation: 30
VirtualBox Bridged Network help


Hey guys,

I recently upgraded to Fedora 11 and found out that VMware 1.0.5 doesn't seem to work as it did in Fedora 10.
I decided to give VirtualBox a try and have run into problems trying to get the bridged network feature to work.

I have created this file under: /etc/sysconfig/network-scripts/ifcfg-br0
Code:
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=192.168.1.1
GATEWAY=192.168.1.1
IPADDR=192.168.1.101
NETMASK=255.255.255.0
ONBOOT=yes
SEARCH="provider"
And I edited this file: /etc/sysconfig/network-scripts/ifcfg-eth0
Code:
# Networking Interface
DEVICE=eth0
HWADDR=00:A0:D1:41:B1:F1
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
BRIDGE=br0
I am able to get the br0 up and running and I have connection to the internet on the HOST machine. However when I run the VM in VirtualBox it is unable to obtain an IP from my DHCP server. I have changed the interface that the VM uses to the br0 but it still isn't able to get an address. I am wondering if there is a step that I am missing? I have pieced together all that I have done from various posts but still seem to be missing something. Can anyone help me shed some light on this problem?


Thank you in advance


Cheers

Todd
 
Old 07-21-2009, 04:38 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello bourne

You also need to set up "tap"s into the bridge for the VirtualBox VMs. I found a lot of ill-informed chat on the Internet about how to do this and eventually realised that VirtualBox's own documentation is the most accurate and almost complete.

Here's a commented /etc/interfaces file for two VirtualBox VMs. You'll have to translate from /etc/interfaces to /etc/sysconfig/network-scripts but the architecture should be the same.
Code:
# The loopback network interface
auto lo
iface lo inet loopback

# eth0 is the physical interface.
# Bridging software will configure eth0 when it is added as a port to br0 (below)
# This minimal configuration avoids message "Ignoring unknown interface eth0=eth0"
auto eth0
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

# tap0 is a tap into the brige below for use by VirtualBox.  
# * Guest OS will configure, hence "manual"
# * VirtualBox will be running with owner c (and group vboxusers), hence user c
# * "ifconfig" is part of ifupdown package
# * "tunctl_user" is part of tunctl package 
auto tap0 
iface tap0 inet manual 
up ifconfig $IFACE 0.0.0.0 up 
down ifconfig $IFACE down 
tunctl_user c 

# tap1, same as tap0, for second VirtualBox VM
auto tap1 
iface tap1 inet manual 
up ifconfig $IFACE 0.0.0.0 up 
down ifconfig $IFACE down 
tunctl_user c 

# br0 is a bridge connecting physical interface eth0 to OS, tap0 and tap1
# * Bridge port stanzas must appear earlier
# * Static configuration
# * No need for spanning tree protocol (stp) because no other bridges on network
auto br0 
iface br0 inet static
address 192.168.1.47
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0 tap0 tap1
bridge_maxwait 0
bridge_stp off
Best

Charles
 
Old 07-21-2009, 07:25 AM   #3
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
What version of VirtualBox are you running? I run Debian (haven't played with another distro for a while) and also Windows Vista and XP and Server 2003 and have run the 2.x series VirtualBox on all of them, you don't even need to set up bridged networking anymore, Set that information in the VM settings and select the appropriate adapter, no need to ad a br interface or tap interfaces, etc...
 
Old 07-21-2009, 01:41 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello scheidel21
Quote:
Originally Posted by scheidel21 View Post
What version of VirtualBox are you running? I run Debian (haven't played with another distro for a while) and also Windows Vista and XP and Server 2003 and have run the 2.x series VirtualBox on all of them, you don't even need to set up bridged networking anymore, Set that information in the VM settings and select the appropriate adapter, no need to ad a br interface or tap interfaces, etc...
Thanks for the "heads up". I'm running VirtualBox 2.1.2, just about to change to 3.0.2. The bridging setup is untouched since installing 1.6.0.

As it says in the VirtualBox 3.0.0 User Manual, The way bridged networking works has been completely rewritten with VirtualBox 2.0 and 2.1, depending on the host operating system. From the user perspective, the main difference is that complex configuration is no longer necessary on any of the supported host operating systems. That makes things easier and boot a little quicker

@bourne: Sorry about the out-of-date information

Best

Charles
 
Old 07-21-2009, 04:06 PM   #5
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
It's ok, I make it complicated myself anyways, I run VBox on my laptop and have the VMs bridged to the wireless, but critical vms that I want netwworkign with all the time I bridge with a dummy adapter I set up on a seperate class C subnet. And I understand about the network hassles, back when I was playing with XEN it was a bear, I eventually had to set up dummy networkign for the xen machine and run the host with proxy software to get internet access, the only nice advantage to that was that regardless of whether the host was connected via wireless or wired I always had Internet if the host had Internet.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VirtualBox-2.2 - bridged networking on Slackware-12.2 botnet Linux - Software 10 05-02-2009 01:56 AM
cannot set up network with suse vmware using bridged network config. lxvor SUSE / openSUSE 1 02-08-2009 03:50 PM
Bridged networking intermittently drops network connection besson3c Linux - Networking 0 09-17-2008 07:31 PM
Bridged network on VMWARE, Debian hangs firsara Linux - Software 0 08-02-2005 04:54 AM
vmware bridged network homestead1000 Linux - Networking 1 01-21-2004 04:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration