Page 1 of 1

port forwarding not working

Posted: 19. May 2009, 18:11
by howlerbr
Hi All,

This is my first post. I have the setup below:

Host: Ubuntu 8.04 32 bit (client)
Guest: Slackware 12.1 (server with apache, mysql, ...)

The host has 192.168.1.100 fixed and the Guest has 192.168.1.200

I'm trying to redirect all incoming tcp/ip requests to 192.168.1.100 to be redirect to my 192.168.1.200 that is my Guest operation system installed in virtualbox. I used the following commands:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.200
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.200 --dport 80 -j MASQUERADE

In VirtualBox the network is configured to host interface (eth0)

I'm able to ping 192.168.1.200 from 192.168.1.100 and I'm also able to open a browser and type http://192.168.1.200 so that apache welcome page is displayed.

But whenever I try to use http://192.168.1.100 it keeps trying to search and then gives timeout saying the page could not be displayed.

What I'm doing wrong?

Thanks howler

Re: port forwarding not working

Posted: 20. May 2009, 16:50
by howlerbr
nobody :(?

Re: port forwarding not working

Posted: 20. May 2009, 16:59
by dmcgraw
This sounds more like an Ubuntu/iptables problem than a VBox problem.

Re: port forwarding not working

Posted: 20. May 2009, 22:06
by Sasquatch
Correct. Working with IPtables is NOT in the scope of this forum. Please go to Ubuntu Forums for more specialized help.
Why you want to route all traffic to port 80 from one machine on your network to another is beyond me. What's the difference in pointing to .200 directly?