how to do factory reset?

Sometimes for whatever reasons, you need to reset your devices to factory defaults and do initial bootstraps. Follow below guides for each model to perform factory resets.

For MAP, follow this guide to perform factory reset.

For CMG/HSG, Follow below steps (NOTE: this will erase all local data!!!. Make sure you have backups if you want to restore back your existing data. Follow this guide to backup your existing data.).

The default start-up config allow mbox to connect to Internet via DHCP on the WAN (eth0) side, and permits Internet users for outbound Internet access from eth1 and eth2. After "write erase" is done, use "show startup-config" to find out the default configs. If you want to have a complete empty start-up config so that you can start from fresh, just type "write erase all" and reboot, otherwise by default it will restore a default start-up config.

mbox# write erase Erase current config and revert start-up config to default "y" or "n": yRemove local captive portal contents. Remove all "y" or "n": yRemove mbox portal user files (e.g. Historical Reports). Remove all "y" or "n": yDo you want to reset all batabases "y" or "n": yInfo: mysql is stopped.Info: gracefully deleting all current databases...Info: loading default databases...Info: mysql is running.restoring default radius...restoring default Syslog...restoring default mboxadmin...restoring default zabbix...restoring default macc2...initializing all databases...Current Version: 201608010100Installing Version: 201706031500stop mysql eventsinit DB mboxadmininit DB syslogSyslog data range: -- LOG not running. Drop events sysloginit DB radiusRadius data range: -- RADIUS not running. Drop events radiusstart mysql eventsrestart apache2Do you want to erase MAP statistics "y" or "n": yexception: connect failedINFO: Please restart mbox to apply the default config.mbox#

NOTE, sometimes you may experience problems to load default databases, because the current system maybe busy with SQL proccessing. eg. you get errors below:


info: loading default databases...taking longer. please wait...Info: mysql is stopped.Info: mysql is stopped.Error: MySQL is not running. Can't restore databases.initializing all databases...Current Version: 201608010100Installing Version: 201706031500stop mysql eventsERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2003 (HY000): Can't connect to MySQL server on 'mysqldb' (111)ERROR 2003 (HY000): Can't connect to MySQL server on 'mysqldb' (111)Error: mbox mysql user not permitted to mboxadmin.init DB mboxadminERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)mysqlshow: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)upgrade DB mboxadminERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Don't panic, after the last step is completed, restart your mbox (it should boot up with a basic default config without any SQL running), then do another "write erase". Most of the time, you should be able to reset your mbox completely. However, if it still doesn't work, it might be due to SQL dynamic pass generation issue, do below pass-reset

mbox# mbox# configure mbox(config)# mfusion mysql-server mbox(config-mysql)# pass-reset............[info] mysql DB pass normalized successfully.mbox(config-mysql)# enddev# write erase