April 19, 2024, 05:53:25 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: NAT + WINDOWS  (Read 3869 times)

Offline sathish

  • Linux Learner
  • ***
  • Posts: 73
NAT + WINDOWS
« on: December 25, 2004, 04:41:14 AM »
Hello Linux team!!!

I am using REDHAT9.0 distro using for routing + firewall. ISP provided me static IP's, now 1 static i used for Linux server, and we are planning to launch a website from WINDOWS 2000 Server. Now my question is

If i hit my official website page. it should come from linux firewall then next to windows 2000 server where i assigned one more static ip.

this is how my plan is
http://www.xyz.com

www.xyz.com  ---->   linux firewall - [eth0=static-ip+eth1=internal-ip] ------------> windows 2000 webserver [static ip]

If I  hit the page I don't want hit direct from windows 2000 server. Is it possible to do mapping the ip address. ??
 
Is it possible to like this type of routing.

Plz let me know...

Thanks

Sathish.[/url]

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
NAT + WINDOWS
« Reply #1 on: December 25, 2004, 07:48:42 AM »
From my point of view you can host site at your windows 2000 but you can' t assign it public ip .
In your case the thing which can be done is that you host your site at your windows server but it will be using the IP that is assigned to linux machine,
Now whenever anybody do request for your site then it will be directed to your internal windoz 2000 machine.
The logic behind is that you have to forward all incoming request on port 80 to your windows 2000 server using your firewall script.

to do so do following...
Code: [Select]
iptables -t nat -A PREROUTING -i eth0 -p tcp  --dport 80 -j DNAT --to 192.168.0.2:80Now in above we are redirecting all traffic coming on port 80 from internet (eth0 here) to 192.168.0.1 on port 80 machine which is our actual machine ie windows 2000 in our local network.

btw i am not too good in iptables ie there could be some syntax error so check above line and do changes accordingly.
btw I hope you get the whole idea.

Offline sathish

  • Linux Learner
  • ***
  • Posts: 73
nat+windows
« Reply #2 on: December 25, 2004, 09:27:40 AM »
Hi Ricky,

Yep i got it.. I'll try to work it out now.

Thanks for the reply,

Sathish.