How to enable/disable maintenance mode on Magento 2
You can enable the maintenance mode by going to your Magento’s directory and run this command:
php bin/magento maintenance:enable
If you want to set the maintenance flag for everyone, except one ip/ips, you need to run the command:
magento maintenance:enable --ip=192.1.1.11 --ip=192.1.1.12
So everyone, except those 2 ips, will see the maintenance mode enabled.
If you want to disable the maintenance mode you can run this command:
php bin/magento maintenance:disable
You can check the status of the maintenance mode you can run the command:
php bin/magento maintenance:status