Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
redprive
New Contributor

How can I redirect traffic to two differents web servers?

Hello, I have one problem. I have created a virtual IP to redirect traffic web server to a web server this way: Name: Server 1 External Interface: WAN1 Type Static NAT External IP Address/Range: 0.0.0.0 Mapped IP Address/Range: 192.168.0.100 Port Redirect Protocolo TCP UDP External Service Port: 80 Mapped Port: 80 This functions without problems. Now, I want to add other web server, but when I try to create a new Virtual IP of next way: Name: Server 2 External Interface: WAN1 Type Static NAT External IP Address/Range: 0.0.0.0 Mapped IP Address/Range: 192.168.0.101 Port Redirect Protocolo TCP UDP External Service Port: 80 Mapped Port: 80 I get next error: " Exists a duplicated object" . Can' t I use port 80 to Server 2? In this case, how can I configure to use the same port? This two web server have two domain name and I don' t want to use port this way: www.domain1.com:80 and redirect to 192.168.0.100 www.domain2.com:8080 and redirect to 192.168.0.101 I only want www.domain1.com and redirect to 192.168.0.100 www.domain2.com and redirect to 192.168.0.101 How can I configure this? Thank you very much!!!
4 REPLIES 4
emnoc
Esteemed Contributor III

Have you looked at the loadbalancing feature in the GUI? Go to firewall objects and research load-balance. It will require that you tear down the current VIP and recreate it, but it would let you accomplish what you want and in either a load-balance, or weighted or fail load-balancing.

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
rwpatterson
Valued Contributor III

The Fortigates treat the wildcard 0.0.0.0 as an IP address, and as such, it cannot be used as a source with the same port in 2 different definitions. Think about it, how would it know where to direct the incoming port 80 traffic if there were 2 different paths for it to go? If the servers are redundant, then do as Emnoc suggested and look into the load balancing feature. If they are unique, then the only way would be to change either the outside IP address or port.

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
redprive
New Contributor

Before I try with your purpose about load balancing, I' m trying to redirect to 8080 port, but something is wrong because it doesn' t functions... First at all I have created a virtual IP with next information: Name: Server 1 External Interface: WAN1 Type Static NAT External IP Address/Range: 0.0.0.0 Mapped IP Address/Range: 192.168.0.100 Port Redirect Protocolo TCP UDP External Service Port: 8080 Mapped Port: 8080 And after I have configurated a new politic with next information: Name: HTTP8080 Protocol: TCP/UDP TCP - Source Port: 1-65535 Target Port: 8080 8080 UDP - Source Port: 1-65535 Target Port: 8080 8080 This rule functions from WAN1 (my public IP) to internal2 (students network) But, when I enter in the web browser http://mydomain.com:8080 doesn' t functions... Something is wrong? Thank you very much!!
redprive
New Contributor

I update. Now I can access from outside to 8080 port. I will study how to create load balance to two differents web servers and then I will write here to say my experience. Thank you very much!!
Labels
Top Kudoed Authors