LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Reverse IP forwarding Help!! :) (https://www.linuxquestions.org/questions/linux-networking-3/reverse-ip-forwarding-help-155556/)

carrellc 03-09-2004 05:21 PM

Reverse IP forwarding Help!! :)
 
Help:) !! - Reverse IP forwarding ( post #1)

Hi!
I've been searching everywhere for my answer and am needing help!

I'll give a quick overview of how our RH9 Linux server is setup and what i need help with:

We have a Mail/DNS/Internet server with 2 Nics in it eth0 and eth1. I've aliased eth1 with another address 199.x.x.26 and have made made the change in rc.firewall to forward all port 80 stuff from 199.x.x.26 to a computer on our lan 10.6.0.130

My problem is what do i do to make another local computer[say computer 10.6.0.99] that hits the address 199.x.x.26 redirect to 10.6.0.130, they can hit it by typing 10.6.0.130 as the url address but i want it to hit 199.x.x.26 for everyone nomatter where they are at home or at work.

I am guessing i have to modify DNS or use the route or NAT commands but i really need help on this one, first time i've ever had to do this and i've looked at tons of online docs/howtos but cannot find the same problem on the net, probly cause i am using the wrong keywords in refining my search

Appreciate all help i can get!!
Clint

maxut 03-10-2004 03:28 AM

i think u can do that with iptables.. redirect to 10.6.0.136 if the sorce ip is from your local network (10.6.0.0/24), and destination ip is 199.0.0.26 and protocol is tcp and destination port is 80

all of them in a one line:
iptables -t nat -A PREROUTING -s 10.6.0.0/24 -p tcp --dport 80 -d 199.0.0.26 -j REDIRECT --to 10.6.0.136

i hope it works.. if it works let me know please

maxut 03-11-2004 02:16 AM

im so sorry .. REDIRECT wont work.. u should use DNAT not REDIRECT..

maxut 03-11-2004 02:26 AM

actually u must create another network segment for your server or servers (DMZ)..
and your clients must not be in same network with servers.. linux must be placed between local network, DMZ and internet.. if u do that u can configure everything easyly with iptables.


All times are GMT -5. The time now is 08:58 AM.