[CentOS-virt] Virtual Box Host Networking problems

Todd and Margo Chester

ToddAndMargo at verizon.net
Sat Nov 10 20:18:25 UTC 2007


Todd and Margo Chester wrote:
> Dear Centos-Virt:
> 
> This is actually a second request for help on the
> same issue.  I finally got to try what several
> months ago was replayed to me and no joy was to
> be had.  I am afraid the original thread got stale
> and also had extra, unnecessary data in it.
> 
> Guest=XP Pro, SP2
> Host=CentOS5; # uname -r; 2.6.18-8.1.15.el5
> 
> VirtualBox-1.5.0_24069_rhel5-2.i586.rpm
> http://www.virtualbox.org/download/1.5.0/VirtualBox-1.5.0_24069_rhel5-1.i586.rpm.run 
> 
> 
> I have two nic: eth0 is the internal network; eth1 connects to a DSL modem.
> 
> I also have a fully functioning DHCP server on eth0 (works perfectly
> with Parallels for Linux).
> 
> The directions (from hell):
> http://www.virtualbox.org/download/UserManual.pdf
> 
> I am trying to set up a "host interface" network between
> my XP guest and my Linux host (eth0).
> 
> I do believe I don't have a clue as to how to set up
> a bridge on eth0.  Here is what I have so far:
> 
> ~~~~~~~~~~~~~~~~~
> ifcfg-br0:
> 
> DEVICE=br0
> TYPE=Bridge
> BOOTPROTO=static
> BROADCAST=192.168.255.255
> IPADDR=192.168.255.10
> NETMASK=255.255.255.0
> NETWORK=192.168.255.0
> GATEWAY=192.168.255.10
> ONBOOT=yes
> USERCTL=yes
> IPV6INIT=no
> PEERDNS=no
> 
> 
> ~~~~~~~~~~~~~~~~~
> ifcfg-eth0:
> 
> DEVICE=eth0
> TYPE=Ethernet
> BOOTPROTO=static
> BROADCAST=192.168.255.255
> IPADDR=192.168.255.12
> NETMASK=255.255.255.0
> NETWORK=192.168.255.0
> GATEWAY=192.168.255.10
> ONBOOT=yes
> USERCTL=yes
> IPV6INIT=no
> PEERDNS=no
> BRIDGE=br0
> 
> 
> ~~~~~~~~~~~~~~~~~
> ifcfg-vbox0:
> 
> DEVICE=vbox0
> TYPE=Ethernet
> BOOTPROTO=static
> BROADCAST=192.168.255.255
> IPADDR=192.168.255.14
> NETMASK=255.255.255.0
> NETWORK=192.168.255.0
> GATEWAY=192.168.255.10
> ONBOOT=yes
> USERCTL=yes
> IPV6INIT=no
> PEERDNS=no
> BRIDGE=br0
> 
> 
> When I fire up Virtual Box, my DCHP server
> offers it an IP, but I do not see the RX
> light flashing on my XP monitor icon in the
> far right of the status bar.  VB doesn't
> get an IP.  If I configure the VB NIC with
> a static address (I tried 192.168.255.20),
> again no receive light and the network
> won't work.
> 
> Also,  I have to "ifdown eth1" and "ifup eth1"
> to get the "G" (gateway) to show up on
> "netstat -rn".  Otherwise, no surfing the
> net with Firefox (Linux version).  Weird.
> 
> I am so very confused.  Can someone tell
> me what I am doing wrong?
> 
> Many thanks,
> -T
> _______________________________________________
> CentOS-virt mailing list
> CentOS-virt at centos.org
> http://lists.centos.org/mailman/listinfo/centos-virt
> 

I found a posting over on VB's forums:
 
http://forums.virtualbox.org/viewtopic.php?t=1636&highlight=bridging+host+interface

Here TonyM using the following in his rc.local:

/sbin/modprobe tun
/usr/sbin/brctl addbr br0
/sbin/ifconfig eth0 0.0.0.0 promisc
/usr/sbin/brctl addif br0 eth0
/sbin/ifconfig br0 192.168.1.10 netmask 255.255.255.0
/usr/bin/VBoxAddIF vbox0 oracle br0
/sbin/ifconfig vbox0 192.168.1.50 netmask 255.255.255.0
/sbin/service network restart

(No symptom change for me, so I put everything back
the way it was.  And, I did test it with my firewall
off.)

The Symptom, when starting XP in VB, was that it could
not get an IP address from my Linux Box's DHCP server.
But, in my messages log (tail -f /var/log/messages),
I can see my DHCP server valiantly trying to give it one:

Nov 10 12:04:20 rn1 dhcpd: DHCPDISCOVER from 08:00:27:d2:20:b8 
(vb-winxp) via eth0
Nov 10 12:04:21 rn1 dhcpd: DHCPOFFER on 192.168.255.197 to 
08:00:27:d2:20:b8 (vb-winxp) via eth0
Nov 10 12:04:24 rn1 dhcpd: DHCPDISCOVER from 08:00:27:d2:20:b8 
(vb-winxp) via eth0
Nov 10 12:04:24 rn1 dhcpd: DHCPOFFER on 192.168.255.197 to 
08:00:27:d2:20:b8 (vb-winxp) via eth0
Nov 10 12:04:32 rn1 dhcpd: DHCPDISCOVER from 08:00:27:d2:20:b8 
(vb-winxp) via eth0
Nov 10 12:04:32 rn1 dhcpd: DHCPOFFER on 192.168.255.197 to 
08:00:27:d2:20:b8 (vb-winxp) via eth0
Nov 10 12:04:49 rn1 dhcpd: DHCPDISCOVER from 08:00:27:d2:20:b8 
(vb-winxp) via eth0
Nov 10 12:04:49 rn1 dhcpd: DHCPOFFER on 192.168.255.197 to 
08:00:27:d2:20:b8 (vb-winxp) via eth0

Now this is interesting: the DHCP server is offering the
IP via eth0.  Should it not being offering it via br0 or
vbox0?  (I am afraid I do not understand this bridging so well.)

Question about bridging:  who talks to 127/0/0/1?  br0 or
eth0?  I am thinking that this is the sequence:
    127.0.0.1--> eth0 --> br0 --> vbox0 --> virtual box's nic
Am I correct?

So I am back to the symptom I had before: the VB NIC can
write to the host Linux system, but it can not read.

:'(  :'(   :'(

-T





More information about the CentOS-virt mailing list