Set Static IP On MikroTik Router OS

Set up a Static IP on MikroTik Router OS

In this tutorial, we will be with you to check how to set a static IP On Mikrotik Router OS. In order to be able to connect to Mikrotik VPN Server through Winbox, first, you need to set a static IP address through the terminal of the Router OS. In this tutorial, we will use the setup command to set the IP address.

Steps To Set A Static IP On Mikrotik Router OS Through Setup Command

  1. Set A Static IP On Mikrotik Router OS With Setup Command.
  2. Reset Mac Address.
  3. Disable IP Neighbor Discovery.

Set Static IP On Mikrotik Router OS

Step 1: Set A Static IP On Mikrotik VPN Server

To set a static IP address on Mikrotik VPN Server, type the setup command and press enter. Then type (a) which is to configure the IP address and gateway and press enter. Then type (a) again which will be to add the IP address and press enter. Then you will be asked to enable the interface which you should enable by pressing the enter button. In this section, you should enter your static IP address, and the netmask and press enter. Consider that you should separate the IP address from netmask with / mark.

setup 
a 
a

Enable interface Ether1 by pressing enter Set IP address/netmask and press enter.
It will be something like 192.168.10.20/26

Set A Static IP On Mikrotik VPN Server

Now you have Set A Static IP On Mikrotik Router OS and just the gateway is left. Type (g) to choose the gateway and press the enter button after entering the gateway. Then press (x) two times to exit the setup environment.

g 
x 
x

Note: Try to ping 8.8.8.8 to be sure that you are connected to the internet.

ping 8.8.8.8 after you Set A Static IP On MikroTik Router OS

Step 2: Reset Mac Address

Then, try to reset the mac address of your Mikrotik VPN Server to avoid any disruption with other machines on your network. To do this, use the below command.

interface ethernet reset-mac-address

reset mac address after you Set Static IP On MikroTik Router OS

In this section, you will be asked to choose the number of the flag which should be 0. Also, you can use the below command to see the list of your IP addresses to find the correct flag number.

ip address print

Step 3: Disable IP Neighbor Discovery

Now it’s better to disable the IP neighbor discovery tool to disallow the machine to find other devices on the network to prevent any interruptions with other machines. You can use the below command.

ip neighbor discovery set ether1 discover=no

disable ip neighbor discovry after you set ip on Mikrotik VPN server

Note: You can use the below educational link in order to connect to Mikrotik Router OS through Winbox.

https://operavps.com/how-to-connect-mikrotik-vps/

Steps To Set A Static IP On Mikrotik VPN Server Without Setup Command

On some versions of Mikrotik Router OS, the Setup command doesn’t work. In this situation, we have to set the static IP through another command. We assume that here are our static IP details and we will use the below command.

IP Address: 192.168.10.5
Subnet Mask: 255.255.255.192
Gateway: 192.168.10.4

Command to set the above IP address details.

IP address add address=192.168.10.5/26 interface=ether1 <br />IP route add gateway=192.168.10.4 <br />interface ethernet reset-mac-address <br />ip neighbor discovery set ether1 discover=no

Summary

You can set a static IP on Mikrotik VRouter OS easily through the setup command. And also we should be sure to do all of these 3 steps to avoid disruptions in the network. 

Leave a Reply

Your email address will not be published. Required fields are marked.