melbao
August 5, 2022, 11:18am
#1
Hello,
there is a info and a tutorial to exclude a range of IPv4 or IPv6 adresses.
I don’t understand the mask for a range of IPv6 addresses. By IPv4 i can use wildcards. And for IPv6?
34.254.53.*
2a03:2880:11ff:e:*
2a03:2880:11ff:e:*:*:*:*
Can i use wildcards in IPv6 similar to IPv4? And what is the right notation?
With the CIDR notation it is not so simple wich suffix is the right. When i understand the CIDR right, then the suffix makes the range? What is right and what is false?
2a03:2880:11ff:e::/24
2a03:2880:11ff:e::/32
2a03:2880:11ff:e::/56
2a03:2880:11ff:e::/64
Genest
(Genest)
August 19, 2022, 7:56pm
#2
Matomo added the star (*) wildcard notation for IPv6 in 2016.
So 1:2:3:4:*:*:*:*
will match 0 to ffff in each of those fields.
Using the wildcard with CIDR may give unpredictable results; I have not tested that.
The original pull request for adding this feature is here:
opened 12:17PM - 18 Dec 15 UTC
closed 04:34AM - 18 Jul 16 UTC
Bug
Enhancement
When adding IPv6 address ranges to the "Global list of Excluded IPs", I initiall… y assumed that ranges must be represented using `*` in place of variable octets/groups, since this is the only syntax specified in the adjacent helptext. Unfortunately, for IPv6 addresses this results in matching against the first `4 - count('*')` octets, rather than `16 - 2*count('*')` octets, since [`sanitizeIpRange` assumes addresses with '*' are IPv4](https://github.com/piwik/component-network/blob/5ab9e6/src/IPUtils.php#L81). For a /64 this results in excluding all IPv6 addresses.
It would be great if the helptext could be updated to mention the option of using CIDR notation (for IPv4 and IPv6) and/or if `sanitizeIpRange` supported wildcards in IPv6 addresses. Additionally, if an invalid address range (e.g. wildcard in IPv6) is specified, displaying and/or logging an error would be very helpful for troubleshooting.
Thanks for considering,
Kevin
1 Like
melbao
October 22, 2022, 11:18am
#3
Thanks, and yes and no. That don’t work so, rather it works only for simple ranges. The professional IP ranges works like 2a03:2880:1000::/36. My question is, if that works:
2a03:2880:1000::/36
2a03:2880:2000::/36
2600:3c00::/32
2600:3c01::/32
2600:4040:4000::/36
2604:f440::/48
2606:54c0::/32