Is it possible to get client ip in setting.php
In settings.php the drupal kernel is not loaded yet, so the service container is not initialized. Use the php superglobal $_SERVERinstead:

$client_ip = $_SERVER['REMOTE_ADDR'];