Route HTTP traffic from a public IP to private IP (Need Help)
Can someone guide me through how to translate one of my public ip to a private ip created by vm?
I would like remote clients to access a website hosted inside the vm. I have the virtual NIC setup already at the host and at the vm client, so I can view the website (at the host server) by typing the vm private ip at
the broswer. I am running server 2008. client vm is ubuntu running ipblock and apache at port80.
My server (host) has several ip's as follow:
public - xx.xx.20.20 - (main ip) currently hosting a website with iis7 with port 80
public - xx.xx.40.40 - currently hosting another website with iis7 with port 80
public - xx.xx.40.41 - not in use (but would like ip translate to 192.168.1.101 and host a website with apache inside the vm)
private - 192.168.56.102 (created by virtualbox - virtual NIC)
My virualpc (client) has the following ip:
private - 192.168.56.101
I've been working on this for several days already with RRAS's NAT, but still couldn't get it work. Any help would be greatly appreciated.
Dan
April 3rd, 2011 1:08pm
Here is what I've tried so far (without success yet):
First approach
1) Set virtualbox (vm) network adapters to host-only adapter and this NIC as private ip of 192.168.56.101.
2) At host, the server has a virtual NIC created by vm and the IP is 192.168.56.102. I can view the vm hosted website by typing the vm ip 192.168.56.101 at the broswer.
3) virtualbox (vm) has no internet access, and I am ok with that for now as long as website works at the host.
4) I enabled RRAS NAT function and added the public ip and range at the properties of the public ip, added restriction to point xx.xx.40.41 to 192.168.56.101. Added special port 80 for both xx.xx.40.41 and 192.168.56.101.
Second approach
1) Set virtualbox network adapters at NAT. I get internet access at the VM and I am able to view the website with
http://localhost. I can also do port forwarding with virtualbox which allows you to enter host ip/port and client ip/port (doesn't seems to work regardless of different input). With this setup, the vm private ip becomes 10.0.2.15
2) At host, the server ip remains the same at 192.168.56.102. I am not able to view the website by typing 10.0.2.15 at the browser. Different setting at RRAS did not help.
Third approach
1) Set VM network adapter to bridge. It doesn't work because there is no DHCP. Server (host) uses static ip.
Hope it makes sense.
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2011 1:24pm
Port forwarding and NAT is the way to go. You should not need to install RRAS. The NAT software built into VirtualBox and its built-in port forwarding should be all you need. If you can't sort it out from VirtualBox help, post in the "VirtualBox on
Windows Hosts" forum.
Bill
April 4th, 2011 1:09pm
Thanks MVP
I will give it a try!
Dan
Free Windows Admin Tool Kit Click here and download it now
April 4th, 2011 8:19pm