Create a .htaccess file in the wp-admin dir or Administrator dir and past the correct lines below and change the ip address that is write for you.
For Wordpress
in the public_html/wp-admin create a .htaccess file and past tekst below and edit the IP address to that you need
# BEGIN Restrict WP-Admin Access To Specific IPsorder deny,allow
# whitelisted IP addresses
allow from xx.xxx.xx.xxx
deny from all
# END Restrict WP-Admin Access To Specific IPs
For Joomla
in the public_html/administrator create a .htaccess file and past tekst below and edit the IP address to that you need
# BEGIN Restrict Administrator Access To Specific IPs
order deny,allow
# whitelisted IP addresses
allow from xx.xxx.xx.xxx
deny from all
# END Restrict Administrator Access To Specific IPs