I have a lot of IP ranges of different providers. For example
P1: 192.168.1.10 - 192.168.1.50, 192.168.2.16 - 192.168.2.49, P2: 17.36.15.34 - 17.36.15.255, P3: .
If you're getting this data for a supplier like MaxMind, there may be libraries available already to do this quickly and efficiently. I don't think you'll gain much performance using Redis in this case.