Host/Guest Networking

Discussions related to using VirtualBox on Linux hosts.
Post Reply
OmahaVike1
Posts: 11
Joined: 13. Jun 2008, 06:17

Host/Guest Networking

Post by OmahaVike1 »

Hello,

If there is an existing thread, I apologize in advance for not being able to find it.

I am experiencing some very intriguing results with my setup, and am curious if anyone has had experience in this and would be willing to help.

Problem:
Guest CAN connect to host, host CANNOT connect (directly) to guest.

Facts:
Host = Ubuntu Hardy (desktop)
Guest = Ubuntu Hardy (server)
Guest can connect to host and general internet without incident. It's working great.
Host cannot directly connect to guest, but can connect to guest through hardware router port forwarding.
Host has two NIC cards installed. One for its primary use, and the other is bridged to the guest.


Before I spill a load of network settings or XML files, has anyone seen problems with the host not being able to connect to the guest, while the rest of the world can connect to the guest?

If I can supply any helpful information, please let me know.

Thanks in advance for any and all consideration!
Graff
Posts: 5
Joined: 17. Jun 2008, 16:06

Post by Graff »

hi!
you have to setup a bridge to and connect virtual nics of your guests to it, and then statically assign net parametrs as in local net, that's all.
in this situation the good chiose is using scripts for creating tun/tap devices and connecting them to the bridge.
OmahaVike1
Posts: 11
Joined: 13. Jun 2008, 06:17

Post by OmahaVike1 »

i guess an easier way to state the problem is like this: everyone else on my network (router and a vista machine) can connect to the guest, but the host cannot.

thanks for the follow-up Graff. i believe i do have a bridge set up, but perhaps not correctly.

check it out...

host ifconfig

Code: Select all

br0       Link encap:Ethernet  HWaddr 00:50:04:62:70:ff  
          inet addr:192.168.1.210  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fe62:70ff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:704 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:62470 (61.0 KB)  TX bytes:5867 (5.7 KB)

eth0      Link encap:Ethernet  HWaddr 00:50:8d:73:88:1c  
          inet addr:192.168.1.201  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:8dff:fe73:881c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11430 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10959 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10186903 (9.7 MB)  TX bytes:2040141 (1.9 MB)
          Interrupt:18 Base address:0x7000 

eth1      Link encap:Ethernet  HWaddr 00:50:04:62:70:ff  
          inet6 addr: fe80::250:4ff:fe62:70ff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:697 errors:0 dropped:0 overruns:0 frame:0
          TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:73074 (71.3 KB)  TX bytes:11043 (10.7 KB)
          Interrupt:20 Base address:0x8000 

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

vbox0     Link encap:Ethernet  HWaddr 00:ff:4c:37:a3:7f  
          inet6 addr: fe80::2ff:4cff:fe37:a37f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:634 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:5146 (5.0 KB)  TX bytes:2972 (2.9 KB)
Machine's XML file (note that i'm using an irregular port, which i can still connect to through my router's external IP -- which is then forwarded to 192.168.1.210):

Code: Select all

<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http1/HostPort" value="50888"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http1/GuestPort" value="50888"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http1/Protocol" value="TCP"/>
now, something of note might be that the VM's ifconfig is 192.168.1.210, which matches the br0 interface. other than this, i am at a total loss for words.

thanks again for helping me through this.
Graff
Posts: 5
Joined: 17. Jun 2008, 16:06

Post by Graff »

hm...
i think the problem is in routing.
as i understand, on host you have 2 nics connected to netwok 192.168.1.x
show "route" command output from the host.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

OmahaVike1 wrote:now, something of note might be that the VM's ifconfig is 192.168.1.210, which matches the br0 interface. other than this, i am at a total loss for words.

thanks again for helping me through this.
Now there is your problem. It's the same problem as this thread: http://forums.virtualbox.org/viewtopic.php?t=7317
You can't use one IP address for two machines. Set them correctly and it will work again. Easiest way is to change the Host bridge to 209 or someting. Don't use the same address that already exist in your network and because the Guest will be part of your network, you can't set it the way you have. That is also why your Host could not connect to the guest, it tried to connect to itself.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
OmahaVike1
Posts: 11
Joined: 13. Jun 2008, 06:17

Post by OmahaVike1 »

(solved)

thank you, Sasquatch. that did the trick.

i had remembered reading about the actual interface conflicting with the guest IP, but nothing of sort on the bridge. seems that all three need to be independent of one another.

thanks again!
Post Reply