Site on IPv4 only logs IPv6 visitors

I’m running a Piwik server version 2.16.1 This server is accessible via IPv4 and IPv6.
One of the servers that I monitor runs with an ISP that only has IPv4. That server logs IPv6 visitors which is impossible.
When I inspect the logs I see entries coming from a dual stack client connect via IPv4 to the IPv4 only website and connects at the same time to the piwik server using IPv6. Here are parts of the logfiles:

195.241.xx.xx - - [18/Apr/2016:13:10:21 +0200] “GET / HTTP/1.1” 200 8325 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0”

2001:xxxx:xxxx:7e97::5 - - [18/Apr/2016:13:10:21 +0200] “GET /piwik/piwik.php?action_name=Voices&idsite=14&rec=1&r=576524&h=13&m=10&s=21&url=http%3A%2F%2Fwww.zanggroepvoices.nl%2F&_id=1045303909a7763c&_idts=1438343396&_idvc=44&_idn=0&_refts=0&_viewts=1460977822&cs=windows-1252&send_image=0&pdf=0&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=0&cookie=1&res=1920x1080&gt_ms=37 HTTP/1.1” 204 0 “http://www.zanggroepvoices.nl/” “Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0” “-” “-” “0.119”

I think that in the message to the piwik server a parameters should be sent that tells the real origin of the site visit. Now it uses the origin address used on the piwik server.

If you need more information, let me know.

If the visitor to the site runs IPV6 and the Piwik installation runs IPV6, then it would be irrelevant if the monitored sites is IPV4 only since the communication is from javascript running on the visitors browser.

Or am I missing something in your description?

As an additional note, if you really need IPV4 address in both access logs and Piwik on that particular site, I think you should be able to create a new subdomain for you piwik such as ipv4only.mypiwik.net with just an A record and no AAAA record for IPV6 forcing all communication to be IPV4. You´d need to update the tracking code as well :slight_smile:

The visitor and piwik installation run dual stack. It’s the logs and reports of the IPv4 website that shows that there is IPv6 traffic to the IPv4 site while that is not possible.

Workarounds are possible, but I see this as an inaccuracy of the generated reports, i.o.w. there is room for improvement.

The problem will go away here, because we will be moving the site to another ISP who has both IPv6 and IPv4. So it’s not an urgent problem.

Hello,

please create a bug report @ Issues · matomo-org/piwik · GitHub with steps how to reproduce. As far as we know, Piwik should be compatible with Ipv6 and properly measure the Ipv6 addresses and tracking requests. Does Piwik support IPv6 protocol? - Analytics Platform - Matomo