简体   繁体   中英

Detect devices from the same local WiFi network

Im using $_SERVER['REMOTE_ADDR'] to detect the client's IP address in PHP.

If two clients share the same IP, is it safe to assume that they are either the same PC or from the same local WiFi network?

Are there any scenarios where the remote IP will be same even if the client's are from different networks/locations. (Ex. when using 3G or GPRS?)

Thanks :)

You cannot assume anything. Two supposedly separate visitors sharing the same IP just means that they're traversing the same proxy/NAT device at some point. This may be because they're sharing a router in their home, because they're going through the same proxy at their company network (but may be miles and miles apart in different internal networks) or because their ISP is applying carrier grade NAT routing. This is not to mention VPNs, tunnels and things like TOR.

You cannot infer anything, really.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM