Routing to website inside my network

Please note. all addresses and domains are false.

On my network I have a server hosting a intranet extranet website which is accessable from the outside using a domain. www.sub.domain.com which is pointed via a cname record to my Mikro Tik cloud DDNS host which points to my public IP.

Traffic is directed to the website on a non-standard port www.sub.domain.com:99999 and the router forwards the traffic to the server inside my network which has a local address 192.168.114.114 .

The problem comes when trying to connect to www.sub.domain.com from inside the network which causes the browser to display an “unable to connect” message. Also some devices like tablets and mobiles are sometimes inside the network and sometimes outside.

How could I create a rule so that the traffic know where to go.

Or could I create a java script that catches the local lan ip and then decides dependant on the address what to do with it. And then have that script run when the user initially connects to the domain - like an intelligent redirect.

Hello, you have to create a Hairpin NAT rule, take a look at this : http://wiki.mikrotik.com/wiki/Hairpin_NAT

Regards,

Could I use the ddns host name instead of the public ip

Yes of course, no problem :slight_smile: