0

My computer is running on Windows 8. My web server is running on apache in Lubuntu 13.04 on VirtualBox. apache web server on VirtualBox, Lubuntu 13.04

I have went to http://www.whatismyip.com and tried going to that IP address on my browser. It sent me to my router's homepage (dd-wrt firmware)

VirtualBox IP address: 10.0.2.15 brings me to the 'It works' page too.

ifconfig

Tried port forwarding:

portforward

but it does not work.

If you require more information, please kindly make a comment below.

2 Answers 2

2

You have to configure port forwarding on your router to redirect port 80 from the internet to the apache-port in your virtualbox. It seems that your virtualbox network is configured to do network address translation. For the router configuration it would be better if you configure the virtualbox network to bridged mode and assign a IP-Address of your local network, i. e. 192.168.123.17 so you can configure port forwarding as follow in ddwrt:

80 TCP 192.168.123.17 80

Bridged mode in virtualbox means that a new virtual network interface is added to your local network and a new IP-Address from that network is assigned, i. e. your local computer has 192.168.123.16 assigned from the routers DHCP-Server so the DHCP-Client in the virtual machine makes a DHCP-Request to the router and the interface gets the IP-Address 192.168.123.17.

But for clarification:

  1. if you don't have any good reason for this I would not recommend publishing a webserver from your local internet access. Maybe you want to try a free Amazon AWS instance for this.

  2. Having your ddwrt webinterface publicly open is also a bad idea because there are several versions of ddwrt with bugs in the software which enable hackers or other bad people to completely take over your network. And I think maybe the above solution wont work so, because port 80, on which the webinterface of ddwrt runs is occupied. You can disable this by changing the ddwrt in the "Administration" tab and then there are multiple "Remote Access" radio button configuration fields (Web GUI Management, SSH, Telnet). I would recommend to disable them all. If you want to configure your ddwrt via remote access I recommend you to configure a VPN.

Maybe this image can give you an overview or you can also google for "nat port forwarding". enter image description here

10
  • Thank you for your answer. However, can you explain further what you meant by 'bridged mode'? What IP address should I use (IP address of local network? You meant the 'inet addr' (refer to my updated post)). How do you make ddwrt interface private? I am trying to experiment on how I can use VirtualBox to host a simple public server.
    – superuser
    Oct 19, 2013 at 12:00
  • 1
    In bridged network mode of your virtual machine your local network interface gets a second IP of your network assigned, i. e. if your host has the IP 192.168.123.15 (assigned from your router) virtualbox adds a virtual interface in the same network and the DHCP-Client in the virtual machine asks for a IP in that network. For ddwrt privat inteface configuration go to the administration tab and there are several "Remote Access" configuration radio buttons. I recommend you to disable all. If you want to remote access to your router it's better to configure a VPN in ddwrt.
    – noggerl
    Oct 19, 2013 at 12:10
  • I've set up DDNS (no-ip.org), which IP address will it update? My Lubuntu IP address or the router's WAN IP address (the public IP?)?
    – superuser
    Oct 19, 2013 at 12:15
  • 1
    The public address
    – noggerl
    Oct 19, 2013 at 12:25
  • Will my Lubuntu IP address change if my broadband plan uses dynamic IP? So I have to keep changing the port forwarding configuration? If my Lubuntu's dynamic IP keeps changing, how can I automatically update it to No-IP.org?
    – superuser
    Oct 19, 2013 at 12:29
0

Your VM is running on the 10.0.2.XX, which is networked with your PC. You need to go into virtual box, and change your NIC adapter settings from NAT to Bridged Adapter. You'll get an IP on the 255.255.255.0 subnet. ( 192.168.X.XXX )

2
  • Okay, done it... Noticed that I can navigate to my Virtualbox's IP and I received 'It works!' page. My broadband plan is 'Dynamic IP', is there any chance my Virtualbox's IP will change and I have to keep changing the port forwarding configuration?
    – superuser
    Oct 19, 2013 at 12:09
  • You can make your VM's IP static, via your routers settings.
    – Tillman32
    Oct 19, 2013 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .