GeoIP(PHP) is recognizing the intranet ip's as US and unknown

Hi ,

My piwik version is 1.10.1, i am using the option GeoIP(PHP) as geolocation to recoginze the country,city.

This is working fine for internet , if i access the website in intranet , it is recognizing the country as “US” and “unknow”, please advice how to fix this ?

Thank You

Are you asking why does it not show your location using a intranet IP?

Yes, how to make to show either unknow or country name ( Here Malaysia) instead of US …?
Thank You

Hi not to insult but it may be more an issue of NAT and firewall here is the issue.

Often intranet ip address are not assigned properly geoip locations as they are often NATed internally(behind the firewall) and can have any sort of IP number range.

The only typical IPs that are correct are gateway, or main lins(sdl, sdsl, asllinks into your company) ips.(external facing IPs or in DMZ zones.)

Since the internal IPs are NATed and are possibly matching US ip addresses then it could be that which is the problem. Find an IP range that matches your countries, and have you intranet NAT network changed to that range to see if that helps(this could be alot of work depending on your network and IT team).

Hope I made sense.

@lesjokat, sorry what?

@anjan777, you are seeing US since most GeoIP providers assign, and to a location in the US. It doesn’t have anything to do with NAT/Firewall as lesjokat suggested. Since you are accessing your Piwik installation via intranet Piwik will see your local address and not the external address assigned to you by your ISP.

Yes sorry i explained myself badly. My idea was he is using IP addresses internally on his lan that are typically assigned to american ones as you mentioned. What would happen if he were to change the internal addresses to match a IP range similar to an external one where he lives?(This may not be feasible as it depends on how large the internal network is, as well as routers, switches etc or (how much a headache for his IT it would be.) but a possibility. Am i wrong here? Im thinking since the traffic is internal, piwik is fed the ips from the internal ones. Be neat to try…

Not sure it matters him all that much, sounded like he is just trying to access the GeoIP testing page in Piwik. If of course he wants to track intranet visits I don’t really see the point of GeoIP (since all are from the same place). In theory you are of course right - just get a big enough subnet and route it to everyone in your network.

Hi Fabian Becker , I agree with you most of the ip addresses in the intranet are, and , that is the reason we are seeing the country name as US.The piwik in this enviroment is tracking both intranet and internet. if some one really accessing from US then we can’t recognize as we are in a feel that it is our intranet.

where as we are having another piwik server and it’s version is 1.9 in that we used the depreceiated GeoIP plugin, this plugin detects my intranet ip adresses as UNKNOW, just i am looking for any way we can make the UNKNOWN instead of US.
If i enable the depreceiated GeoIP plugin in 1.10 vistors location and providers are hitting the error.

Thank You

Were using Piwik for intranet tracking also and we have a range of IPs that should reflect an actual city here in the US. Need help on how to implement this…

Should I build a table like so…

IP Range | City | New York, NY | Atlanta, GA
What table in the database should I import this into??


can PIWIK have a setting to specify that a website is intranet based so as to stop reflecting intranet ip as external ips

Are you aware that there’s a FAQ just for Intranet ?

Don’t know if it will help you.


can PIWIK have a setting to specify that a website is intranet based so as to stop reflecting intranet ip as external ips

see feature request: Build a generic Analytics platform: allow to measure 'Mobile App', 'Intranet Website', 'Wearable', 'Sensor' and more · Issue #4734 · matomo-org/matomo · GitHub

Thanks matt and dali. This is a feature piwik team needs to consider