Is it possible to set up preferrential IPs when in maintainance mode?
Actually on Drupal you can create a new role and assign permission to this role to login in maintenance mode (Add permission "System > Use the site in maintenance mode").

If this is not what you want, then you can filter IP addresses on firewall /linux level. Please ask on https://serverfault.com/ if you need this kind of solution.