I'm using OpenWRT (linux based) on my router. The router has a local IP and a public IP. I have a dyndns name assigned to the public IP. The router is forwarding several ports (e.g. ssh and https) to my local server.
Goal: Use the same URL to access the server, no matter if the client is inside or outside my local network.
From the outside: When I send a request to the public IP. The request gets forwarded to my internal server. Everything is fine
From the inside: When I send a request to the public IP, it ends up on the internal interface of the router. Thus the port forwardin does not work.
When scanning the local IP of the router with nmap from the inside, I get the same results as for the public IP from the inside. So it seems that when I access the public IP from the inside, the traffic still ends up on the local IP.
What can I do to access the server with the same url inside and outside my local network?
- The name resolution is working fine.