pS0KaA6m1LBYO2tteBUJmaEi00feokozLJRZSC26

How to Configure MikroTik Router

MikroTik Basic Configuration Using Winbox - In this article, I will explain the basic configuration steps on a MikroTik router, so that the router can connect to the internet and function as an internet gateway for clients on the local network.

Before going into its configuration step, here is the topology that I used.
From the topology above, it can be seen that the ether1 interface on the router is connected to the internet using a cable, then the ether2 interface is connected to the local network.

We will configure the router so that the router and clients on the local network can connect to the internet, the configuration that we will do on the router is as follows: setting the IP address on each interface, adding a default gateway, setting DNS server, and NAT masquerade.

Configure MikroTik Router as Internet Gateway

In the first step, please connect the MikroTik router to the modem (internet source) using a cable such as a topology example above, then access the router with winbox.


Configure the IP address on the Mikrotik Router

If you have successfully logged in to the router using Winbox, now we add the IP address on each router interface. Please click IP -> Addresses, then click the Add (+) button to add a new IP address.
  • Address : 192.168.200.15/24
  • Interface : ether1
  • Comment : Internet
Click the OK button if it is finished, for more details, please see the image below.
Now repeat the steps above to add IP addresses for clients on the local network.
  • Address : 192.168.44.1/24
  • Interface : ether2
  • Comment : Local Network
Here is the configuration of the IP address in each of the router interfaces that have been created.

Adding a Default Gateway on the Mikrotik Router

We also have to add a default gateway on the router, so that the router can reach all hosts on the internet, please click on IP -> Routes, then click the Add (+) button to make a default route entry.

In the Gateway field please enter the default gateway IP.
Now the MikroTik router has a default gateway entry, this way it allows the router to be able to reach all hosts on the internet.
To confirm whether the router is connected to the Internet or not? Please open New Terminal, then do test ping to the gateway IP, if the result like this, means the router can already connect to the gateway.

Adding a DNS Server on the Mikrotik Router

By adding a default gateway, the router can already reach all hosts on the internet, but the router cannot recognize domains on the internet, for that the router requires DNS configuration so that the router can recognize domains on the internet.

To add DNS on a Mikrotik router, please click IP -> DNS, then enter the Google DNS on the Servers column.
Now try to do a ping test to the internet site to determine whether the MikroTik router has succeeded in recognizing the existing domain on the internet or not?
From the ping test result above, it turns out that the router has succeeded in recognizing the existing domain on the internet.

Adding NAT Masquerade on the MikroTik Router

The next step we have to add NAT Masquerade on the router, the goal is to allow clients on the local network to connect to the Internet, this is because the private IP that is in the local network can not connect directly with other hosts on the public network (Internet).

Please click IP -> Firewall -> NAT, then create a new NAT rule by clicking the Add (+) button. Then configure the following parameters.
  • Chain: srcnat
  • Out. Interface : ether1 (interface pointing to the Internet)
  • Action : masquerade 
When finished, click the OK button to save the NAT rule.
The end result will look like the image below.

Set the IP address on the client (Linux)

The last step is that we have to set a static IP address on the client computer, in this tutorial, I use the LinuxMint client, the IP address configuration on LinuxMint can be seen in the example image below.
If the IP address on the client computer has been configured, now we do test ping to the Gateway IP address and also to the Internet site via terminal, or CMD window if the client uses Ms. Windows.
From the Ping test results above, we can see that the client is connected to the internet.

Until here the configuration on the router is complete, the router has been successfully configured as an internet gateway for clients on the local network. But to connect the client computer to the MikroTik, we must configure the IP address manually (static), in the next tutorial, I will explain the steps to configure the DHCP Server on the MikroTik, so that we do not need to manually configure the IP address on the client computer.

Hopefully, this tutorial is useful, thank you.

Related Posts