Use DNS to solve the problem. The name-solving service in addition to providing a friendly name for the application (Ex.: http://meuapp.empresa.com.br) will solve the routing problem by providing clients with the appropriate IP according to the network the machine is on.
A common scenario currently, is the case where you have an external DNS server for your public domain and an internal one for the corporate network (sometimes it is the same domain server - AD).
Then, just add an entry on the external server with the address for the application (Ex.: http://meuapp.empresa.com.br) pointing to the external IP.
With this, all external machines to your network can already access the application by the new address, assuming that your site is published at port 80.
And then, you will need to perform an external DNS Zone transfer with your domain to Internal, so on your internal server, the DNS entry must return the internal network IP to the application in question.
This will cause that for that particular zone, when the machine is on the internal network, the priority over the DNS address is the internal server, so the address returned by the DNS will be the internal address of the server.
When the computer is on the external network, the DNS priority will be the WEB returning the external address.
With this, the machines start to access the application by the friendly name and the DNS takes care of providing the appropriate IP through the priority in the DNS Zone according to the network in which the machine is.
Heed:
You should check if your vendor for the Domain allows
zone transfers.
If you use other applications with external addresses in this domain, make sure redundancy services do not provide different Ips to the site, as your internal DNS will take over the zone and provide the wrong IP.
A Load Load sometimes makes load distribution based on multiple instances of applications with different ips, check properly.
If you can, test zone transfers at non-commercial times and check all relevant domains and sub-domains.
Zone Transfer:
https://technet.microsoft.com/pt-BR/library/cc781340(v=Ws.10). aspx
Alternatively check your settings against Loopback (see: http://help.screenconnect.com/Cannot_access_external_IP_address_from_LAN). But, there are other implications, such as modifying your firewall settings and sometimes, for security, these settings are disabled. This can also require configurations in different locations (multiple firewalls) and with the increase of applications, using a friendly name is better in terms of maintenance and control of the rules.
Users are also usually happier.
I couldn’t understand her question. She can improve her explanation with an example of the problem?
– Jhonatan Simões
I tried to explain my situation better
– ChrisAdler
What’s the problem? It’s because users have to know the 2 ips to access and you want to end this?
– Intruso
Exactly. This @Intruder
– ChrisAdler
@Chrisadler you’re gonna have to make rules
loopback
in yourFirewall
http://serverfault.com/questions/55611/loopback-to-forwarded-public-ip-address-from-local-network-hairpin-nat tries to see if this link does not help you.– Pablo Tondolo de Vargas
Do you have fixed IP, check? Do you have an external DNS service? (with some life domain .com.br) and an internal DNS server?
– Intruso
I have a domain that is managed by the operator. internal DNS yes I have. And of course fixed IP :)
– ChrisAdler
So what’s the problem with my answer? : ) See what’s missing, so I can improve.
– Intruso