Connecting to the server
For local server
If you are using a local server, you do not need to connect the router to the server. The only thing you need is to change the IP addresses of the controllers from dynamic to static, so that when they reconnect to the WiFi network, they always have the same addresses. After that, proceed to the next step - adding the controller to the project.
For cloud server
If you use a cloud server, all smart home controllers will work with the cloud server via an Internet gateway. In the case of a smart home from SmartESP, the gateway will be a Mikrotik router. How to choose and configure it can be read in the documentation: Selecting a router and Setting up a router .
After installing and configuring the router, it must be connected to the server. To do this, on your server, go to the Router section and add a new one.
After adding the router, be sure to click the Enable button so that it becomes green. Then we click on the plus symbol and see the personal settings of the VPN connection.
Open the home router settings page. Go to Interfaces, click Add and select L2TP Client .
Give a clear name to the VPN connection, for example: l2tp-smart . Then copy the server address, login and password. In addition, if you want increased security, select the IPsec option and copy this key too.
Click Ok . The connection appears in the list and if you open it, you can see the status: connected .
Removing filter restrictions
The next step is to allow data movement through the created interface. To do this, go to IP section and select Firewall .
Here on Filter Rules tab we find the rule Drop all not coming from LAN and open it for editing. Next, we find the rule Input Interface and select here our VPN interface for connecting to the server that you created earlier: l2tp-smart . Be sure to put the negation symbol - an exclamation mark - in front of it.
Click Ok . Done.