Friday 12 October 2018

networking - how can i forward requests to my own IP address to a local IP address in my network (possibly using named)?

My setup


I have a linux server running in my basement. I currently have my router looking to that server for DNS lookup, so I can use named to spoof a bunch of domain names to point to my local server's local address, 192.168.0.111. This works great.


I also am running Apache and PHP on this server, and have forwarded port 80 on my router to this machine, so my public IP xx.xxx.x.xx is sent to the basement server.


This is a great development set up for me, because I can develop websites in my local network and pull them up on numerous devices with a *.mylocal.net address. I can also quickly share a website on my public IP with others that are outside of my network.


I have a static IP, so that makes this even easier.


The problem


Some applications need to have an absolute URL. My spoofed DNS doesn't work outside my network, and neither does my internal IP address.


I need to be able to access the sites at the same IP that they are accessed publicly, which is my public IP: xx.xxx.x.xx




For some reason, I can't access my own public IP address from within my own network.


My router's public IP is xx.xxx.x.xx, and when I hit xx.xxx.x.xx from outside my network I see exactly what I want -- my development website. But, when I hit xx.xxx.x.xx from inside my network, the connection times out.




I assume my ISP has a firewall that blocks requests from xx.xxx.x.xx to xx.xxx.x.xx where the origin and the destination are the same IP (or maybe this is impossible on any network?)


So how can I set up my network to forward the internal request to my public IP to the local IP of my basement server?


I would like to do this within the local DNS server I set up, or in my router, so the change can be applied to all devices in my network, and not just the basement server or the windows tablet/laptop, etc individually.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...