Smarter Router Setup Starts Here: Automating MikroTik Configuration with XenFi
Still configuring MikroTik routers manually? Discover how XenFi automates hotspot setup and why your router must be receiving internet before running any scripts.
Preparing Your MikroTik Router for Automated Setup
Before running any XenFi scripts, the router must be in a clean and ready state.
Automation which means:
The router is properly reset
The physical connections are correct
The router is already receiving internet
In most MikroTik setups, the internet cable from your ISP is connected to ether1, which acts as the WAN port. Your computer should then be connected to either ether2 or ether3 or ether4, or ether5, allowing you to access the router through WinBox.
Skipping these steps can cause scripts to fail or behave unexpectedly.
Let’s go through each step
Step 1: Reset the Router
To avoid conflicts from previous configurations, start by resetting the MikroTik router.
You can reset the router in two ways:
Using the reset button: Disconnect all cables (WAN, PC, and power), press and hold the reset button using a pin, then plug the power cable back in while still holding the button, and release it after the LED blinks three times.
Using WinBox: Go to System → Reset Configuration, select No Default Configuration, then click OK.
After the reset:
The router returns to its default state
You get a clean environment for setup
Step 2: Set Up the Physical Connections
Now connect your devices correctly:
ISP cable → ether1 (WAN port)
PC/Laptop → ether2 (LAN port)
This setup ensures:
The router can receive internet
You can access the router locally via WinBox
Step 3: Enable DHCP Client, Open WinBox and go to:
IP → DHCP Client
Add a new DHCP Client:
Interface: ether1
Click Apply and OK
Step 4: Enable Remote Access
Before proceeding to automated setup, your router must first be connected to XenFi through remote access.
This allows XenFi to securely communicate with your router and apply configurations automatically.
Since your router is already connected to the internet, you can now run the XenFi remote access script.
Once the script is successfully installed:
Your router becomes accessible from the XenFi dashboard
You can begin automated configuration or manual setup
To do this, you will go to the XenFi dashboard and look for Settings > Router setup
Hover over the script (move the cursor around it so that you are able to copy it to your clip board)
After this, paste this script in the Winbox terminal
Updated Setup Process
XenFi's router deployment workflow has been updated to provide a more streamlined setup experience. The steps below reflect the latest setup process and may differ from earlier versions of this guide.
Step 1: Add Your Router
Log in to your XenFi dashboard and navigate to Settings → Routers.
If you have already added a router, its details will be displayed on this page. If no router has been added yet, click Create Router and provide the required information.
Step 2: Install Remote Access
After creating the router, you will be redirected to the Remote Access installation page. Copy the provided script by hovering over the script (move the cursor around it so that you are able to copy it to your clip board).
Paste it into the MikroTik Winbox terminal.
Once the script is successfully installed:
Your router becomes accessible from the XenFi dashboard
You can begin automated configuration or manual setup
Step 3: Open Router Configuration
Once remote access has been successfully configured, press continue setup to take take you to the configuration method.
Step 4: Select a Deployment Method
You will be presented with two configuration options:
Automatic Configuration – Recommended for most users. XenFi generates and deploys the required configuration automatically.
Manual Configuration – Suitable for advanced users who prefer to apply the configuration themselves.
Let's go through each method step by step
Manual Configuration
Once you select manual configuration, it'll take you to
Manual Setup Instructions
Configure your topology through Winbox/WebFig
Now that the management services are installed, follow these steps to deploy your network:
Create a Bridge: Setup a bridge interface and attach your LAN/WLAN ports to it.
Assign IP Address: Assign your chosen Gateway IP address to the bridge interface.
Setup DHCP Server: Create a DHCP Pool and bind a DHCP Server to your bridge.
Setup Hotspot Server: Under IP > Hotspot, run the generic Setup wizard on your bridge, or manually attach a Hotspot Server utilizing the DHCP Pool you created. Use the XenFi profile if it was created, or configure it to point to the XenFi RADIUS address.
Finally, install the XenFi services script
Moving to Automated Setup with XenFi
Select Automatic Deployment and click Continue to Configuration
The system will automatically detect your router’s topology and display key details such as uptime and RouterOS version
Click Add New Bridge, then open the bridge to configure its settings
Add the required interfaces (e.g., ether2, ether3) to the bridge by dragging and connecting them. Repeat this for all ports you want included
Configure the bridge by setting:
Bridge name
Gateway IP
Subnet size
Service type (Hotspot Server or PPPoE Server)
Then click Save Changes
After saving, a configuration script will be generated for your router setup
Copy the script and paste it into the WinBox terminal to apply the configuration
The script will execute and confirm completion with a Deployment Successfulmessage.
Grow your business
Find out how XenFi helps ISPs grow
Smart billing, automation and management for hotspot providers and ISPs.