I have a home lan network which is connected to internet using Dlink DIR-825 router. ISP:s dhcp has given one external ip (eg. 184.108.40.206 which is for security reasons not my true ip) and it can be accessed using external hostname (eg. mydns101.dlinkddns.com which is for security reasons not my true hostname).
I have a port forwarding rule (Dlink router use term Virtual Server), which forwards traffic to port 80 to a local centos6 server which has a local ip 220.127.116.11 (see image below).
How can I restrict access to this server so that it can be accessed only from my home lan (18.104.22.168), but using external address https://mydns101.dlinkddns.com?
I can of course access it by using local ip 22.214.171.124 and not to use any port forwardings, which means that it cannot be accessed from elsewhere, but this way I cannot use external address https://mydns101.dlinkddns.com.
And I can of course restrict access using local server's httpd.conf, but that is not the way I want to use, because the purpose for this home server is to be a 1-1 development server for a live server and I want to use identical httpd.conf:s in both of them. I want to use Dlink Router for restricting access.
Because 126.96.36.199 is my ip, I think allowing access from it and denying access from other ip:s is the way to go. So, I have tested all combinations using Inbound Filters (see http://support.dlink.com/emulators/dir825/Advanced.html#Inbound_Filter):
Name Action Remote IP Range ALLOW Allow 0.0.0.0-188.8.131.52, 184.108.40.206-255.255.255.255 DENY Deny 0.0.0.0-220.127.116.11, 18.104.22.168-255.255.255.255 ALLOW2 Allow 22.214.171.124-126.96.36.199 DENY2 Deny 188.8.131.52-184.108.40.206
and attach those filters into "Virtual Server" forwarding rules this way:
but none of those rules work as desired. They either restrict access from everywhere or allow access from everywhere, which is not the desired behavior.