magento2 add maintenance mode code example
Example 1: magento 2 enable maintenance mode
bin/magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
Example 2: maintenance mode magento 2
php bin/magento maintenance:enable