How to restrict a specific user to an IP range he can login from? I want to create a subscription service where the user can only login with the IP address the user registered with and all Class C &amp; D's of that IP range. How can this be done?

Would also be great if I can restrict the user to logging in from withing that state if possible.
Have a look at IP Ranges module.


  IP Ranges is a module that let's you completely ban both single IP-addresses as well as
  full ranges from your site. The ban is triggered already at the early bootstrap phase, so you
  can get rid of unwanted visitors as early as possible without wasting server resources.
  
  You can also define whitelists that override blacklists, both single and ranged.
  The UI is similar to core ip-ban, so you will feel like home immediately.