Setting up the gateway on a MikroTik device is an essential step to ensure that your network can communicate correctly with other networks, including the Internet.
Here we walk you through the steps to configure the gateway using both the command line interface (CLI) and the graphical user interface (GUI) using WinBox.
Gateway configuration using WinBox
- Access your MikroTik device using WinBox: Enter the IP address, username and password to log in.
- Go to the IP section: Click the “IP” menu in the list of options on the left.
- Select 'Routes': In the submenu that appears under “IP,” select “Routes.”
- Add a new route: Click the “Add” button (plus sign) to open the new route window.
- Set the Default Route:
- In the “Dst. Address”, enter
0.0.0.0/0
. This indicates that this route will apply to all traffic destined for addresses outside your local network. - In the “Gateway” field, enter the IP address of your gateway. This is usually the IP address of your edge router or the device that connects you to the Internet.
- In the “Dst. Address”, enter
- Apply and OK: Click “Apply” and then “OK” to save the settings.
Configuring the Gateway using the CLI
If you prefer to use the CLI, here are the steps:
Access the Terminal: You can do this directly if you have physical access to the device, or via SSH, or via the Terminal in WinBox.
Enter the Default Route Command:
/ip route add dst-address=0.0.0.0/0 gateway=<dirección_IP_gateway>
Replaces <dirección_IP_gateway>
with the IP address of your gateway.
For example, if your gateway is 192.168.88.1
, the command would be:
/ip route add dst-address=0.0.0.0/0 gateway=192.168.88.1
This command configures a default route, which is used by MikroTik to send traffic destined for networks outside the directly connected networks, that is, to the Internet or to another external network.
Remember that the configured gateway must be accessible from the MikroTik network and must belong to a directly connected network. If you change the network settings of your MikroTik or gateway, you will need to update these settings to reflect the changes.
There are no tags for this post.