Feature Requests
Share ideas, discuss and vote on requests from other users in community
 

Allow IPv6 and IPv4 in Licensing Module

Stream101 shared this idea 3 years ago
Investigating

Lets get WHMCS to add a feature to allow both IPv6 and IPv4 addresses. Make it an option within the module if you want to allow that or not. When an IPv4 first connects back, it registers it, same thing happens with the v6 address. Depending on my cell phone service, I sometimes connect to WHMCS in ipv6 which says I'm unlicensed. I have to reissue it and then can login. I did find out if you ask, you can get it manually put in, but that could save me a headache and them time!

Thanks!

Best Answer
photo

For clarification, the licensing addon already supports IPv6 today.

What we believe is being requested here is to automatically store both the IPv4 and IPv6 address at the time of the initial check-in for a license. The way it works today is the IP the user connects from is stored. How are you proposing that the other IP be automatically detected?

Comments (11)

photo
1

This is the exact problem I have just experienced. To fix this the only way is to contact licensing to manually add both addresses to your license. As IPv6 becomes more widespread this issue will become a major problem down the road so the best thing to do is to add this feature before that happens.

photo
1

I need to do the same also

photo
1

This is a real problem. WHMCS should support IPv6 in this module as soon as possible since IPv6 is the new standard.

photo
1

For clarification, the licensing addon already supports IPv6 today.

What we believe is being requested here is to automatically store both the IPv4 and IPv6 address at the time of the initial check-in for a license. The way it works today is the IP the user connects from is stored. How are you proposing that the other IP be automatically detected?

photo
1

The module stores the first IP which is connected. This can be IPv4 or IPv6. When one of those is stored, the other one will not be stored.

My suggestion is to only store the first IPv4 and the first IPv6 addresses which connect. So If the initial connection is IPv4, store the IPv4 address. When a second connection is IPv4, don't store the IPv4. When a second/fourth/fifth/etc... connection is IPv6, store the IPv6 too, but when the next connection is IPv4 or IPv6, don't store that new address.

Only store the first IPv4 and IPv6 addresses.

photo
1

Yeah, this is becoming increasingly a problem, not only for me but also for WHMCS, who had to manually add IPv6 for my licenses.

I think Peter Bin's suggestion would be just fine, please implement! :)

photo
1

How would we handle this with a single license status? So like right now when a license is reissued we replace the allowed location when it is next accessed. When we store that the license status then changes to Active. How would we determine when to store another? How would we know when not to allow access from another?

photo
1

I think on the license module side, if you duplicate the code path existing for the IP address tracking and put conditional wrappers on them to only work for IPv4 or IPv6.

E.g. If the code path checks the inbound connection's source IP address against the stored information in the database. If it matches respond with a positive, OR if not, reply negative. If it's a new license, accept source IP with positive response then store source IP in database.

Would become, check inbound source IP to see if IPv4 or IPv6. (The rest of the steps is the same, replace IP address with appropriate IPv4 or IPv6. Each IP type would be stored in it's on record/field). Check to see if source IP address is valid, if so respond positive, if not respond negative, if no existing IP address to match then respond positive and store it.

photo
photo
1

You would allow 1 ipv4 and 1 ipv6 address... So if the license is provisioned to an ipv4 address and a request comes from an ipv6 address, you could add that automatically if there is no ipv6 yet. And the other way around as well.

And just to make sure there is no abuse, make sure that both ipv4 and ipv6 addresses resolve to the same hostname (reverse lookup) before adding.

photo
1

I agree with @Seb, that sounds sensible. It certainly is not a future-viable solution to have to do it manually. And re how to detect an IPv6 address - Plesk sure can, just check how they do it - something like this should do:

netstat -tulpn 2>/dev/null | grep :80 | awk '{print $4}' | sed s/:80//g

If the server is not listening on Port 80, but only on 443, then do both and take the superset as answer.

photo
1

Or, you could send both addresses in the initial registration request and compare the one from the request with the payload. For example:

Do a lookup to https://ipv6.wtfismyip.com/text and https://ipv4.wtfismyip.com/text, and send those in the registration request body. Then, save both.