In Magento, you can put the website in maintenance mode to perform maintenance tasks without affecting the users of your website. You can also configure the maintenance mode to allow access to specific IP addresses. Here are the steps to put the website in maintenance mode and allow access to specific IP addresses in Magento:
Log into the Magento admin panel.
Go to System > Configuration > General > Web.
In the “Maintenance Mode” section, set “Enable” to “Yes”
In the “IP Address Whitelist” section, enter the IP addresses that you want to allow access to the website while in maintenance mode, separating them with a comma.
Click on the “Save Config” button.
Clear your Magento cache by going to System > Cache Management and refreshing the cache.
Test your website to ensure that it is in maintenance mode and that the specified IP addresses have access to the website.
Note: If you’re using Magento 2, you should check the documentation for more details on how to put the website in maintenance mode and allow access to specific IP addresses.
Also, you can create maintenance. flag file in your root magento directory, this will also put your website in maintenance mode.