Closed (works as designed)
Project:
Restrict IP
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2010 at 19:15 UTC
Updated:
18 Dec 2010 at 02:41 UTC
Hi there,
I've found that the module settings interface is showing a local IP (192.168.1.1), and I think that this behaviour is incorrect as if I include this IP the content will be visible to everyone, wouldn't it?
If I use my external IP and delete the local IP from the settings page, all the content on the website becomes unavailable.
Am I doing something wrong?
Comments
Comment #1
leenyx commentedJust to make it clear,
the IP I got from the module's admin interface is:
Your current IP address is: 192.168.1.1
But, that's everyones IP address anyway, isn't?
it should be something like:
Your current IP address is: 81.37.242.52
Comment #2
jaypanYou are mixing up internal and external ip addresses. It works like this:
external IP <--- gateway ---> Internal IP
The gateway is your router/modem. All routers (gateways) have an external and internal IP address. The external address is the one they show to the world, the internal one is used internally, and only internally. Now to be clear, all computers on the same network will have the same external ip address. No two networks have the same external IP - this would make it impossible to receive data from the internet, as there would be no way of knowing where the data needed to go. It's like having two houses with the exact same address (an no names) - how would you know where the data goes. So while computers on the same network will have the same external IP, no two computers on different networks will have the same external IP.
On the other hand, many people have the same internal IP address. However, this ip address is only part of the internal network. So it's like if you numbered bedrooms in houses. Each house would have bedroom one, and you and I both may live in bedroom one, but they are different bedroom ones and have no meaning outside of our respective houses.
I'm guessing you are either developing locally, either using localhost, or another computer/server on the same network. My module takes advantage of Drupal's ip_address() function, which looks at the IP address of the request being made. Since Drupal is on your local network, the request is made from the local network, and as such you are seeing a local IP. If this is the case, then you have three options:
1) If Drupal will always be on your local network, use the IP address shown. Only your computer will have this IP address on the local network, any other computer on your local network will have a different IP address (in the range of 192.168.1.2 - 192.168.1.254).
2) If you will be moving Drupal to a remote server at some point, don't set the IP now - you will be locked out when you move Drupal to the external server as your external IP address will change.
3) If you need to set the ip restriction in your local network, and will be moving Drupal to an external network in the future, then set the IP restriction, but either turn it off before migration, or use one of the tips I gave on the top page to temporarily disable the module after you have moved it to the remote server, at which point you can set your new external ip address - if necessary.
Comment #3
jaypan