Iptables SNAT-DNAT

Status
Not open for further replies.

MattG

Posts: 106   +0
Hey guys.

I having a serious issue with my network.
I will map it out first for you, so you can get a view of what is going on.

Ok, we have a cable connection coming into a linksys router acting ONLY as a switch, not a router =] from there we go into a Slackware linux Box with 2 NIC's. Connecting 2 unlike networks. a 192.168.1.0 network and a 192.168.10.0 network. The 10.0 network is subnetted into 2 networks.

Now, my problem is this:

I have the slackbox acting as a router right, but I dont want my webserver open to the public..sort of...So I put the webserver on the 10.0 network. I set the linksys router to forward all HTTP requests on port 80, to the slack box, and from there (the slack box) I have it going to the web server. Sounds right, right? wrong.

using this

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.10.x (x being webserver IP)

This works so that the outside can view the page, and here I thought it worked great! So, we tested www.google.com and up came our website...da hell? Tried another site, and another and another ..all our website.

Great...lol.

Any idea what command can fix this..the network is pretty solid as far as everything else goes though.
 
Last edited by a moderator:
Status
Not open for further replies.
Back