7

Since I've change my ISP, the current router (ADB P-RG A4202N) won't let me access my web server from within my local network using my remote IP or no-ip host - it redirects me to the router config page. Not just my server PC, but also all other devices that are connected to the same LAN can't access my website using remote IP (internal IP works fine).

However if I visit my webpage from a remote host - everything works fine.

How do I fix this? I want to use my remote IP/host when visiting my website even from within my LAN. For the time being I added a 127.0.0.1 myremoteip rule to the hosts file on my main PC, but it's a workaround I don't want to keep.

My web server is running on Win7, firewall disabled entirely for testing purposes. Port forwarding is working.

3 Answers 3

6

I'm assuming this is behind a NATed connection. In that case, you need to enable NAT reflection to allow internal traffic to the external IP address your site resolves to. Most routers don't have this enabled by default and many consumer firewalls don't even support it in their out-of-box firmware. Without this feature, packets from the LAN to your WAN address will not be subject to the NAT rules but filtered by the device.

I had a brief look at the manual for your router, but could not see any mention of this feature. That might mean it isn't supported and an alternative device is required.


It is quite common in these scenarios to instead configure split DNS on your internal network to resolve a different IP address for the site, causing you to communicate directly with the machine without the traffic having to pass through the firewall. This also eliminates any dependence on the connection being up for access to the site to function internally, which is not provided by the NAT reflection approach if a public nameserver must be used to resolve the name in the DNS. The split DNS approach is useful if you have a local resolving nameserver you can configure, but the HOSTS file approach works just as well for a single machine.

2
  • Thank you so much for the explanation. Is there a way to create this split DNS or something similar on the router itself? Configuring every device may not be even possible in my situation.
    – Matt
    Apr 8, 2014 at 10:21
  • 1
    If you use the gateway as the DNS for the machines on the LAN, then yes, it looks like you can add a custom entry. See pages 106 - 107 of the linked manual, section "DNS server". You'll need to add a rule for externalhostname.tld and configure the internal IP of the box hosting the site. This won't affect external resolution or access, as that won't use your gateway DNS facility. Apr 8, 2014 at 10:25
1

It seems like that:

Router's autoconfiguration created redirection rule only for external interfaces. You try to connect to the ext ip of the router. Packet appears on its local interface destinated to ext ip. Router sees, that destination ip is belonging to it, it sees, that it have 80 port opened (with router config site), so it passes packet to it's own web server.

Split dns could be a better way, but if it is impossible try this.

There is a very small chance, that disabling router web interface or putting it to other port will solve this problem.

Or configure your router to dnat connections (from local interface to ext ip) to your local web server. Then, for your web server not to answer direct to local client, snat outgoing connections (from local net to local net port 80) to any fake address(lets say 1.2.3.4). So web server will recieve connections from 1.2.3.4 and will answer via router, and router will revert ip back to original. Do not know, if your router supports all the necessary features.

2
  • I'm having trouble understanding your comment :(
    – oldboy
    Aug 19, 2017 at 8:08
  • you make no sense Feb 1, 2020 at 9:36
0

i had the same problem, i fixed my issue with editing hosts file with the follwoing

192.168.1.100 www.yourdomain.com yourdomain.alias1 your domain.alias2

change the IP with your local server LAN IP note: this will let you access your website from the same server machine and you might not able to access it from other machine in the same network if you have more than one website add the same line with your domain name

Not the answer you're looking for? Browse other questions tagged .