Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Programming in Linux _ Portforwardig

Posted by: epixcore Aug 4 2008, 08:56 PM

Hello Community,

at this moment I have 3 Linux Boxes (Debian Etch 4.0)!
I am trying to use one of these as a "primary" server, who redirects all Requests to one of the two other boxes.

I want to use portforwarding, because the user should not see whats going on in the background.
I already have tried this method:

CODE
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to *.*.*.*:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT


this works fine, but only local, but all the servers have a Static IP Adress (81.169.134.216, 87.98.140.108, 91.121.40.164)



this should work like this:

user requests "www.mydomain.com" (A: 81.169.134.216) the Server (81.169.134.216) Redirects the Request to a extern Server => 91.121.40.164
this should not be visible for the user


does anyone know how i can fix this problem?



greets from Austria
yours Stefan



PS: Sorry for my bad english

Posted by: chrisw Aug 5 2008, 10:41 AM

QUOTE (epixcore @ Aug 4 2008, 07:56 PM) *
Hello Community,

at this moment I have 3 Linux Boxes (Debian Etch 4.0)!
I am trying to use one of these as a "primary" server, who redirects all Requests to one of the two other boxes.

I want to use portforwarding, because the user should not see whats going on in the background.
I already have tried this method:

CODE
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to *.*.*.*:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT


this works fine, but only local, but all the servers have a Static IP Adress (81.169.134.216, 87.98.140.108, 91.121.40.164)
this should work like this:

user requests "www.mydomain.com" (A: 81.169.134.216) the Server (81.169.134.216) Redirects the Request to a extern Server => 91.121.40.164
this should not be visible for the user
does anyone know how i can fix this problem?
greets from Austria
yours Stefan
PS: Sorry for my bad english



I think you need to look at using a http proxy for this situation.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)