Web Hosting Talk







View Full Version : forwarding


clocker1996
02-15-2002, 06:06 PM
Hi

Let's say i have 5 ips
216.18.0.174
216.18.0.175
216.18.0.176
216.18.0.177
216.18.0.178

i have all 5 ips binded on port :80

How can i make it, so when someone tries to connect to http://216.18.0.174 on port 80, it'll throw them onto / redirect their connection to 216.18.0.174 on port 81
Does anyone know how?

Yes, i am completely aware that you can use things like small .html files to redirect, etc

I am talking about is there any software to redirect someone onto another port on the local system? basically throw them onto it.

jahsh
02-15-2002, 07:58 PM
what web server are you running?

bitserve
02-15-2002, 09:16 PM
There's two things you can do. You can redirect their web browser to another address and port (URL), or you can forward the traffic to another service on port 81.

Do you really know which one of these you are trying for?

I guess you could do both.

To redirect the browser, you're probably going to want to use some type of HTTP header to redirect the browser.

For port forwarding you have your choice of software. I use ipvs on Linux.

freakysid
02-15-2002, 10:42 PM
Yes of course you need to tell us which web server you are running. But assuming it is apache, look into the documentation for mod_alias and mod_rewrite:

http://httpd.apache.org/docs/mod/mod_alias.html
http://httpd.apache.org/docs/mod/mod_rewrite.html

priyadi
02-16-2002, 07:39 AM
Then why can't you just use small html files to redirect them?

Ahmad
02-16-2002, 09:37 AM
Do you mean that you need any data sent to the first IP at port 80 to be internally and transparently forwarded to second IP port 81?

This is TCP level redirection, I don't know how it is done ..

But I can't think of why you want to do it this way!

davidb
02-16-2002, 09:40 AM
You can use ipchains

ToastyX
02-16-2002, 10:03 AM
ipchains and iptables can do what you want, or you can use a proxy server.

clocker1996
02-16-2002, 05:55 PM
Wow
so the last two people who posted are saying that if I typed...

# /usr/sbin/in.telnetd -debug 658 & <-- TYPING this will bind a telnet connection on port 658

I can setup ipchains so when someone connects to 216.18.0.178:658 it will redirect them to say --> 216.18.0.178:23 ?

Does anyone know how to do this off by hand?

hypernatic.net
02-16-2002, 06:16 PM
Homer from the other forum wrote a little something about port forwarding

http://www.hostingdiscussions.com/showthread.php?threadid=132

Although this is regarding port 25 - i am sure it will work for port 80 as well...
As for the IP to IP forwarding (so to have it listen on a specific IP) - Ask Homer... For I don't know..

Ahmad
02-17-2002, 12:37 PM
Originally posted by clocker1996
Wow
so the last two people who posted are saying that if I typed...

# /usr/sbin/in.telnetd -debug 658 & <-- TYPING this will bind a telnet connection on port 658

I can setup ipchains so when someone connects to 216.18.0.178:658 it will redirect them to say --> 216.18.0.178:23 ?

Does anyone know how to do this off by hand?

Yes, given that the two IP addresses are on the same machine.

Ahmad
02-17-2002, 12:41 PM
Originally posted by hypernatic.net
Homer from the other forum wrote a little something about port forwarding

http://www.hostingdiscussions.com/showthread.php?threadid=132

Although this is regarding port 25 - i am sure it will work for port 80 as well...
As for the IP to IP forwarding (so to have it listen on a specific IP) - Ask Homer... For I don't know..

This can be done using iptables, no need for any extra packages. I've read that before in Linux Network Administration, but never used it. That is why I don't remember it :)