LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Forward incoming requests to another server (https://www.linuxquestions.org/questions/linux-networking-3/forward-incoming-requests-to-another-server-555869/)

ajaimes 05-22-2007 03:06 PM

Forward incoming requests to another server
 
Hello!,

I have a linux server with a static IP address on eth2 connected to the internet. There's another connection, eth1, which is connected to a local network and among those computers there's a windows server. I need to forward all requests I get on eth2 to the windows server, for example, http, ftp, remote desktoping, etc...

Internet -----> Linux Server ------> Win Server B


I think I can do this using NAT and ip forwarding, but I might be wrong.

Do you have any suggestion on how I can accomplish this?

thank you

jiml8 05-22-2007 04:44 PM

You don't really need NAT though you might want to implement it for security reasons.

Iptables is what you want to study. It'll do what you want when you have it configured correctly.

ajaimes 05-22-2007 06:44 PM

Thank you!, I'll start reading on that... :-)

ajaimes 05-23-2007 12:47 PM

Hello again!

I've been reading on iptables and I got this:

sudo iptables -A FORWARD -i eth2 -o eth1 -d 200.76.191.28

what do you think?

do you think if my windows server has an IP address of 10.0.0.100 I should replace the eth1 to point directly to its address? for example:

sudo iptables -A FORWARD -i eth2 -o 10.0.0.100 -d 200.76.191.28


Also I found another example

$ sudo iptables -A FORWARD -i eth1 -o eth3 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT

$sudo iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

$sudo iptables -A POSTROUTING -t nat -j MASQUERADE


this example uses NEW, ESTABLISHED and RELATED, and my guess is that because of the way I'm proposing they're not necessary... is it true?

thank you

ajaimes 06-04-2007 01:43 PM

Hello,

What do you think about my last post?

I'm a newbie on this and I'm afraid I screw it up!

do you think it might work?


All times are GMT -5. The time now is 09:43 AM.