Access internal server using external ip
Solution 1:
This is called hairpinning, and while some domestic routers can do this, they are rare - that is a matter for research.
Using split DNS is often a better way to approach this type of issue. Usually when accessing the public IP address from inside the network is needed, it is because there is a device that needs to access an internal resource from both outside and inside the network. It is configured to use the public address when outside, but then needs to be reconfigured to use the private address when internal.
Using split DNS can solve this problem by using a public DNS service for the the external address, but then running an internal DNS server that serves the internal IP address for the same DNS entry.
Lets say for example that your 1.2.3.4 IP address has the dns name myserver.domain.com
, which works when external to your network. You would then install a forwarding DNS server on your internal network, perhaps on the 10.4.3.100
server. It would have a zone file for myserver.domain.com
, resolving the myserver.domain.com
address to 10.4.3.100
. Set this to have a low TTL so that it doesn't get cached for long.
You would use your internal DNS server for any name resolution while within your network, forwarding any requests it cannot resolve itself on to your ISP.
You would then configure any applications to not use 1.2.3.4
but to use myserver.domain.com
, and they will work both inside and outside the network.
Solution 2:
This feature is goes by several names, including "NAT hairpinning" and "NAT reflection", among others.
Unfortunately, there are far too many consumer-grade home gateways that don't support it in their factory firmware image.
Make sure you have the latest firmware from the manufacturer, look to see if there's an option with a similar name that you can turn on, and if not, look at installing aftermarket third-party/open-source firmware on your router, or purchasing a higher quality router that supports it.