Nat and web servers

Dark

Senior member
Oct 24, 1999
639
0
0
Hi, I wonder what to do when u have 2 web servers on ur network. How can the NAT knows to which one send the infos. Like web1.com and web2.com both on port 80, NAT will forward all the request made to the port 80 to one of them? Is there a way to do this without using a proxy?
Thx
 

Vegito

Diamond Member
Oct 16, 1999
8,329
0
0
DNS
ie. web2.com is DNS x.x.x.1
and web1.com is DNS x.x.x.2

everytime someones goes www.web2.com it reverses and find x.x.x.1 and goto that

 

Dark

Senior member
Oct 24, 1999
639
0
0
I'm not sure i understand u. U mean if the gateway runs a DNS server, the NAT can make a difference between web1.com and web2.com (ie 192.168.1.1 and 192.168.1.2)? The extern request is gonna have ,in the tcp packet destination field the address of the gateway right? with a request to the http port, it's not gonna have any infos that describe which web server it's trying to reach...plz can u clarify?
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
There is no way for the NAT proxy to tell which web server to forward the request to, unless the URL contains some extra information.

E.g. you could configure your NAT so that incoming requests to www.yourcompany.com on port 80 will be forwarded to 192.168.0.1, and incoming requests to port 81 will be forwarded to 192.168.0.2

An alternative, if both web servers are the same would be to have the NAT forward to one or other, depending on load on the servers.

 

Dark

Senior member
Oct 24, 1999
639
0
0
That was my understanding Mark...:( I guess there is no other alternative than using the proxy...Thx fornur input. Much appreciated.