Skip to main content
Version: 7.26

First Time Configuration

This page sets up a new MikroTik router as the gateway of a home or office network: the internet connection on ether1, the local network on the other ports and Wi-Fi, and the address translation (NAT) that lets local devices reach the internet.

Before You Begin​

Prerequisites​

You need:

  • A MikroTik router.
  • A computer with an Ethernet port (recommended). Configuration over Wi-Fi also works if the router has a wireless access point.
  • An Ethernet cable.
  • An active internet connection from your internet service provider (ISP).
  • 30 to 60 minutes of uninterrupted time.

Key Concepts​

  • Default configuration: the settings the router has when it leaves the factory. You can change them to suit your network.
  • Bridge: a virtual interface that joins several physical ports into one network segment.
  • DHCP: a protocol that gives devices their IP addresses automatically.
  • NAT: Network Address Translation, which lets many devices share one public IP address.
  • Firewall: a set of rules that controls and filters network traffic.

Choose Your Configuration Method​

This guide shows two ways to configure RouterOS:

  • A graphical interface: WinBox or WebFig. Where a task has graphical steps, they are in a WinBox / WebFig tab.
  • The command-line interface (CLI): the commands in the code blocks. You can paste them into New Terminal in WinBox or WebFig, or into an SSH session. Most tasks on this page are shown in the CLI.
tip

Save a backup after each major step, so you can return to a working configuration. In WinBox, open Files, select Backup, and enter a descriptive name, for example after-internet-setup. In the CLI:

[admin@MikroTik] > /system/backup/save name=after-internet-setup
Configuration backup saved

To return to a backup, select the file in the Files window and select Restore. The router loads the backup and reboots. The Backup page has the details.

Accessing the router​

Most MikroTik routers ship with a default configuration that lets you connect right away. Some professional devices (such as the CCR series) ship with a minimal configuration or none. On such a device, set up the local network first, as described in Manual Network Setup.

Step 1: Physical Connection​

  1. Connect the ISP cable to ether1, the port the default configuration uses as the internet (WAN) port.
  2. Connect your computer to any other Ethernet port of the router.
  3. Power on the router and wait about one minute until it has booted.
flowchart LR
  ISP["Internet (ISP)"] --- E1["ether1"]
  subgraph R["MikroTik router"]
    E1
    LAN["ether2 to ether5, Wi-Fi"]
  end
  LAN --- PC["Computer, switch and other devices"]
  LAN -.- WIFI["Wi-Fi clients"]

Step 2: Connect to the router​

Use one of these tools:

  • A web browser: open https://192.168.88.1 to reach WebFig. This works when the router has the default configuration.
  • WinBox, a desktop application for Windows, macOS and Linux. It also finds routers that have no IP address.
  • The MikroTik mobile app for iOS and Android.

To get WinBox, download it for your operating system:

  • Windows: a ZIP archive with WinBox.exe.
  • Linux: a ZIP archive with a binary executable.
  • macOS: a DMG package.

WinBox needs no installation:

  1. Extract or open the downloaded package.
  2. Start WinBox:
    • Windows: run WinBox.exe.
    • Linux: make the binary executable and run it.
    • macOS: open the .dmg and start WinBox.

The WinBox page has more details.

Step 3: Find Your Router Using Neighbor Discovery​

  1. Open WinBox.
  2. In the Select from list, choose Neighbors.
  3. Your router appears in the Neighbors list.
  4. Double-select the router to connect. Use the MAC address if the IP address is not reachable or shows 0.0.0.0.
  5. Log in:
    • Username: admin.
    • Password: the password printed on the label of the device. Older models have no password: leave the field empty. The Default Configuration Passwords page shows where to find the label.

Step 4: Protecting the Router​

As soon as you can reach the router, protect it against unauthorized access:

  1. Set a strong administrator password. An empty password gives anyone on the network full access to the router.
  2. Keep the firewall. Most MikroTik routers ship with a default firewall that blocks the most common attacks from the internet. Do not disable its rules; add new rules only when you need them.
  3. Do not open management access to the internet. This matters most on devices without a default firewall. For remote access, use a VPN such as WireGuard or IPsec instead of opening the management ports.

User Password Management​

Choose a password that:

  • Has at least 12 characters.
  • Mixes uppercase and lowercase letters, numbers and symbols.
  • Is not a dictionary word or a simple pattern.
danger

Remember your password. A lost password cannot be recovered: you have to reset the router or reinstall RouterOS.

Set the password of the admin user in the CLI:

/user/set admin password="Replace-With-Your-Own-Password"

In the CLI, a $ inside quotes starts a variable name, and the command fails with a syntax error. Put a backslash in front of each $ in a password, for example password="Abc-123\$xyz" sets the password Abc-123$xyz.

Or change the password of the user you are logged in as. The /password command asks for the old password and the new one twice:

[admin@MikroTik] > /password
old-password: ***************
new-password: ****************
confirm-new-password: ****************

The /password command needs no backslash in front of a $.

Users are managed in the /user menu. This command adds an administrator with its own name:

/user/add name=myname group=full \
password="Replace-With-Your-Own-Password"
tip

Create your own administrator with a strong password, log in with it to check that it works, and then disable or remove the default admin user:

/user/remove admin

Understanding Default Configuration​

When you first connect to your MikroTik router, it can show a prompt about the default configuration:

  • For beginners: keep the default configuration. It provides basic security and the essential services.
  • What it includes: on a home router, a firewall, a DHCP server for the local network, a DHCP client on the internet port, NAT, and Wi-Fi security settings (on wireless models).
  • You can change it: customize it step by step and keep its structure as a base.

The RouterOS Default Configuration window: the welcome text with five steps to secure the router, the router mode summary, the LAN and Wi-Fi settings, and the Remove Configuration and OK buttons

danger

Removing the default configuration removes all built-in security rules and services. Do this only if you plan to configure the router yourself.

To get the default configuration back, reset the configuration as described in RouterOS configuration reset.

If your device has no default configuration, or you reset it to a clean state, set up the bridge, the LAN IP address and the DHCP server first, as described in Manual Network Setup, and then continue here.

Configuring the Internet Connection (WAN)​

To connect the router to the internet, find out which connection type your ISP uses. Ask your ISP, or compare with these descriptions:

  • DHCP (dynamic IP): most cable modems and many fiber connections. You plug in the cable, and the router gets its address automatically.
  • Static IP: business connections and some residential fiber. Your ISP gave you an IP address, a gateway and DNS servers.
  • PPPoE: DSL connections and some fiber providers. Your ISP gave you a username and a password.
tip

If you are not sure, start with DHCP: it is the most common connection type for home connections.

DHCP / Dynamic IP (most common)​

The router runs a DHCP client on the internet port, which gets an IP address, the DNS servers and the default route from the ISP. The default configuration of a home router already has this client on ether1. To add it yourself:

/ip/dhcp-client/add disabled=no interface=ether1

Check that the client got an address and its status is bound:

[admin@MikroTik] > /ip/dhcp-client/print where interface=ether1
Columns: NAME, INTERFACE, USE-PEER-DNS, ADD-DEFAULT-ROUTE, STATUS, ADDRESS
# NAME INTERFACE USE-PEER-DNS ADD STATUS ADDRESS
0 client2 ether1 yes yes bound 203.0.113.100/24

Static IP​

Use a static address when your ISP gave you fixed network settings, for example:

  • IP address: 203.0.113.100/24
  • Gateway: 203.0.113.1
  • DNS server: 8.8.8.8

With the default configuration, the router runs a DHCP client on ether1. Disable it, so that it does not add an address and a default route of its own:

/ip/dhcp-client/disable [find interface=ether1]

Then add the IP address to the internet port, add a default route through the gateway, and set the DNS server:

/ip/address/add address=203.0.113.100/24 interface=ether1
/ip/route/add gateway=203.0.113.1
/ip/dns/set servers=8.8.8.8

Then check the connection as described in Verify Internet Connectivity.

PPPoE​

Use PPPoE when your ISP gave you a username and a password (common with DSL). The PPPoE client gets a dynamic IP address, and it can add the default route and the DNS servers of the ISP.

Replace the username and password with those from your ISP:

/interface/pppoe-client
add disabled=no interface=ether1 user="ISP-USERNAME" \
password="ISP-PASSWORD" \
add-default-route=yes use-peer-dns=yes

Check that the client is connected and has an address from the ISP:

[admin@MikroTik] > /ip/address/print where interface=pppoe-out1
Flags: D - DYNAMIC
Columns: ADDRESS, NETWORK, INTERFACE, VRF
# ADDRESS NETWORK INTERFACE VRF
1 D 198.51.100.100/32 198.51.100.1 pppoe-out1 main
warning

With PPPoE, the internet interface is pppoe-out1, not ether1. Use pppoe-out1 in every later setting that refers to the internet port, for example in NAT and firewall rules. If you use the WAN interface list (the default configuration does), add pppoe-out1 to it, otherwise local devices cannot reach the internet through the PPPoE connection:

/interface/list/member/add list=WAN interface=pppoe-out1

Verify Internet Connectivity​

Check that the router itself reaches the internet. First ping a public IP address, for example the Google public DNS server 8.8.8.8:

[admin@MikroTik] > /ping 8.8.8.8 count=3
SEQ HOST SIZE TTL TIME STATUS
0 8.8.8.8 56 116 1ms105us
1 8.8.8.8 56 115 1ms885us
2 8.8.8.8 56 115 1ms972us
sent=3 received=3 packet-loss=0% min-rtt=1ms105us avg-rtt=1ms654us
max-rtt=1ms972us

Then ping a domain name, which also tests DNS:

[admin@MikroTik] > /ping google.com count=3
SEQ HOST SIZE TTL TIME STATUS
0 142.251.13.101 56 113 1ms536us
1 142.251.13.101 56 113 1ms615us
2 142.251.13.101 56 113 1ms610us
sent=3 received=3 packet-loss=0% min-rtt=1ms536us avg-rtt=1ms587us
max-rtt=1ms615us

Without count, ping runs until you press Ctrl+C.

If the IP address answers but the domain name does not, the connection works but DNS is not set up correctly. If both answer, the internet connection of the router works. If the IP address does not answer, see the troubleshooting section at the end of this page.

Devices in the local network also need a NAT rule before they can reach the internet, as described in the next section.

NAT Configuration​

note

The default configuration of a home router already has a source NAT (masquerade) rule for the internet port, so local devices reach the internet without more steps, and you can skip this section. The steps here are for a router with no default configuration or a custom setup.

Local devices use private addresses, which are not routed on the internet: a server on the internet could not send its replies back to them. The router therefore replaces the private source address of their outgoing packets with its own public address. A source NAT rule with the masquerade action does this on the internet port:

/ip/firewall/nat
add chain=srcnat out-interface=ether1 action=masquerade
warning

If the internet connection is PPPoE, LTE or another interface type, set out-interface to that interface, for example pppoe-out1.

An interface list makes the rules easier to maintain, because the rules refer to the list and you only change its members. The default configuration uses a list named WAN. Create the list and add the internet port to it:

/interface/list/add name=WAN
/interface/list/member/add list=WAN interface=ether1

Then use the list in the NAT rule. Add this rule instead of the rule with out-interface, not in addition to it:

/ip/firewall/nat
add chain=srcnat out-interface-list=WAN ipsec-policy=out,none \
action=masquerade

ipsec-policy=out,none leaves out the packets that an IPsec policy sends through a tunnel, so they keep their original source address.

To check the rule, ping a public address from a computer in the local network, then look at the counters of the rule on the router. The PACKETS counter grows with each new connection:

[admin@MikroTik] > /ip/firewall/nat/print stats
Columns: CHAIN, ACTION, BYTES, PACKETS
# CHAIN ACTION BYTES PACKETS
0 srcnat masquerade 56 1

Source NAT changes only the outgoing connections and the replies to them. It is not a firewall: on a router with the default configuration, the firewall drops new connections from the internet to local devices, except those that a dst-nat rule translated.

Port Forwarding​

Sometimes a local device must be reachable from the internet on a specific port. Give the device a static DHCP lease, so that its address does not change. For example, a computer with the address 192.168.88.254 should accept Remote Desktop (RDP) connections, which use TCP port 3389. A destination NAT rule sends these connections to the computer:

/ip/firewall/nat/add chain=dstnat action=dst-nat protocol=tcp \
dst-port=3389 in-interface-list=WAN to-addresses=192.168.88.254 \
to-ports=3389

in-interface-list=WAN limits the rule to connections that come in from the internet. Without it, the rule also catches local devices that connect to port 3389 of any server on the internet and sends them to 192.168.88.254 instead. If you did not create the WAN list, use in-interface=ether1.

dst-port is the port on the public address of the router, and to-ports is the port on the device, so they can differ. For example, with dst-port=13389, RDP clients on the internet connect to port 13389 and reach port 3389 on 192.168.88.254.

When a client on the internet connects to port 3389 of the router, the counter of the rule grows:

[admin@MikroTik] > /ip/firewall/nat/print stats
Columns: CHAIN, ACTION, BYTES, PACKETS
# CHAIN ACTION BYTES PACKETS
0 srcnat masquerade 56 1
1 dstnat dst-nat 60 1
tip

If your firewall drops forwarded traffic by default, it must also accept the forwarded connections. The default configuration accepts connections that a dst-nat rule translated.

Setting up Wireless / WiFi​

How you configure wireless depends on the wireless driver of your device:

  • WiFi (/interface/wifi): devices with the newer WiFi driver. The wireless interfaces are named wifi1, wifi2.
  • Legacy wireless (/interface/wireless): devices with the older wireless driver. The wireless interfaces are named wlan1, wlan2.

/interface/print shows which names your device has. Configure Wi-Fi from a computer that is connected with a cable: changes to the radios interrupt wireless connections.

This guide sets up a basic secured access point: an SSID with a WPA2/WPA3 password. For more (Wi-Fi 6 and 7, multi-link operation, several radios, CAPsMAN, repeaters), see the Wireless section.

note

The examples use the country Latvia, the SSID MikroTik-12345, WPA2/WPA3 where the device supports it, and WPS disabled. Set your own country: it decides which channels and transmit power the router may use.

Create a security profile:

/interface/wifi/security
add name=myProfile authentication-types=wpa2-psk,wpa3-psk \
passphrase="YOUR_STRONG_PASSWORD"

Configure the radios. On a device with one radio, use only the first command:

/interface wifi
set [ find default-name=wifi1 ] configuration.country=Latvia \
.mode=ap .ssid="MikroTik-12345" .hide-ssid=no \
channel.width=20mhz disabled=no \
security=myProfile security.wps=disable

set [ find default-name=wifi2 ] configuration.country=Latvia \
.mode=ap .ssid="MikroTik-12345" .hide-ssid=no \
channel.width=20mhz disabled=no \
security=myProfile security.wps=disable

WinBox settings of wifi1 and wifi2 side by side: Enabled, SSID MikroTik-12345, country Latvia, security profile myProfile with WPA2 PSK and WPA3 PSK selected, and the OK button

Add the wireless interface to the bridge​

Every wireless interface that serves the local network must be a port of the LAN bridge. Otherwise wireless clients can connect to the Wi-Fi network, but they get no address from the DHCP server and cannot reach the local network or the internet.

note

With the default configuration, the wireless interfaces are already ports of the LAN bridge (named bridge), and you can skip this step. It is needed after a manual network setup, which names the bridge bridge1.

/interface/bridge/port
add interface=wifi1 bridge=bridge1
add interface=wifi2 bridge=bridge1

For legacy wireless, use the wlan interface names instead (for example wlan1 and wlan2).

Configuration Complete​

The router now:

  • Gives local devices access to the internet.
  • Gives local devices their IP addresses with DHCP.
  • With the default firewall, drops new connections from the internet to local devices.
  • Provides Wi-Fi (on wireless models).

You can continue with VPNs, VLANs, routing, monitoring and network management.

Next: Secure Your Router​

Before you put the router into production, protect it against unauthorized access: use a strong password and your own username, keep the default firewall rules, limit the management services, and disable the features you do not use.

Securing your router has the full checklist: firewall rules for the internet port, MAC access and neighbor discovery limits, management service ports, and SSH strong cryptography.

Troubleshooting​

RouterOS has several troubleshooting tools: ping, traceroute, torch, the packet sniffer, the bandwidth test and others. The ping tool was used earlier on this page to verify the internet connection.

Troubleshoot if ping fails​

Ping only tells you that a destination is unreachable, not why. If a computer behind the router cannot reach www.google.com, check the most common mistakes in this order:

Flowchart for a computer that cannot reach www.google.com: check ping from the router, then from the computer to the router, then from the computer to the internet, the ISP gateway, DNS, source NAT and traceroute

  1. Can the router ping www.google.com? If not, check the IP address of the router, its default route and its DNS settings.
  2. Can the computer ping the IP address of the router? If not, check the IP address and default route of the computer, and the Ethernet cable.
  3. Can the computer ping www.google.com? If yes, the connection works.
  4. If not, check DNS: the computer needs a working DNS server, or the router must answer DNS requests (allow-remote-requests=yes in /ip/dns). Then check that the router has a source NAT (masquerade) rule.
  5. If DNS and NAT are in order, can the computer ping the gateway of the ISP? If not, go back to step 2.
  6. If it can, run /tool/traceroute to the destination. If the trace times out in the network of the ISP, contact your ISP.
tip

If you are not sure how to configure your router, MikroTik consultants can help.