Block certain IP addresses
Drupal 7 has IP address blocking feature by default. 


Login to admin 
Navigate to configuration page
Click on "IP address blocking" which available in under People panel
Add IP address which you wanted to block. 


OR

Navigate to below page 
http://[yourwebsitename.com]/admin/config/people/ip-blocking