Support for router mode which uses configuration from config file

This commit enables router mode through json config file which is necessary for OpenWRT.