Page 1 of 1

Questions about network bridged mode

Posted: 29. Apr 2009, 16:04
by fdelente
Hello.

I'm trying to understand the bridged mode of VirtualBox. So far I think it works that way:
* I declare that my net card in the guest will use interface wlan0 of my host; so eth0 in the guest is linked to wlan0 on the host, that is every packet that is sent to/received from eth0 on the guest goes through/comes from wlan0 on the host, right?
* If my guest has a fixed IP (192.168.25.5), then I must in the host redirect all traffic to/from 192.168.25.5 to wlan0, right?

I tried it and I can't ping the guest. I tried to set up the kernel routing table so that traffic to/from 192.168.25.* goes to wlan, but it doesn't work:

Code: Select all

# route add 192.168.25.0 wlan0
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.25.0    *               255.255.255.255 UH    0      0        0 wlan0
so 192.168.25.0 is recognized as a machine IP, not a network IP... Giving

Code: Select all

# route add -net 192.168.25.0 netmask 255.255.255.0 wlan0
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.25.0    *               255.255.255.0   U     0      0        0 wlan0
works but the virtual machine on 192.168.25.5 doesn't answer to ping.

Thanks for any help.

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 16:31
by Perryg
The host is using (what ever) to connect to the Internet.
You setup the guest in Vbox to use bridged mode and it uses a virtual adapter to connect to the adapter on the host (shows up in the VBox network setup).
You only need to tell the guest to use the Virtual adapter (more than likely eth0) in your case.
The guest will see this as a wired interface and then communicate with the host and the Internet.
You do not try to connect directly to the host adapter from within the guest itself.

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 16:50
by fdelente
Perryg wrote:The host is using (what ever) to connect to the Internet.
My host is using wlan0 (WIFI connection to an access-point).
You setup the guest in Vbox to use bridged mode
Done that.
and it uses a virtual adapter to connect to the adapter on the host (shows up in the VBox network setup).
When I choose Bridged mode for the guest, I have two choices: eth0 and wlan0, as I have both an ethernet card and a WIFI card in my physical machine. I chose wlan0 because it's the interface the host uses to connect to the internet.
You only need to tell the guest to use the Virtual adapter (more than likely eth0) in your case.
I tell the guest which interface the host uses to connect to the internet, right?
The guest will see this as a wired interface and then communicate with the host and the Internet.
You do not try to connect directly to the host adapter from within the guest itself.
I can't configure anything on the guest, it's a closed box that I can only boot and connect to through a web interface. I cannot change its IP whatsoever, and cannot change the interface it uses for networking. It uses eth0 because I enabled only Card#1 for the guest in VirtualBox.

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 17:41
by Perryg
OK so you can not configure anything on the guest because it is a closed system. What are the requirements of the closed system? DHCP? NAT? Bridged? Does it have a static address that it must use?

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 18:12
by fdelente
Perryg wrote:OK so you can not configure anything on the guest because it is a closed system. What are the requirements of the closed system? DHCP? NAT? Bridged? Does it have a static address that it must use?
It has a static address, 192.168.25.5, that cannot be changed. An apache server is running on it, and the only way I can contact it is through a web browser: http://192.168.25.5.

I succeeded in doing that using the host-only mode; however, the people that set up the server also need access to it. When I contact the server through the browser, I can go to a redirection page that asks me for a port number, and that port opens a tunnel from the guest server to the central server of the people that created my guest server (don't ask me why, I don't know more). So for example, giving port number 5678 for the tunnel redirection, going to http://centralserver:5678 redirects to my guest server, so this guest is available on the internet.

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 20:15
by Sasquatch
Didn't you start a topic about this earlier last week? This scenario sounds all too familiar.

Re: Questions about network bridged mode

Posted: 29. Apr 2009, 21:22
by Perryg
Yes he did and marked as resolved on the 25th under a different topic.
Since this is a software issue complicated by the vendor and is not really a VirtualBox issue You need to contact them and get their guidance. This falls totally outside of VBox scope.

Locking topic.