Skip to content

Lab 01-01 · Getting in: MAC WinBox, WebFig and skins

MTCNA

Module 1 · Introduction. Official course slides 18–34: first access, management tools, WinBox, MAC WinBox (LAB, slides 22–24), WebFig, designing skins (LAB, slide 26) and CLI tips.

Imagine you change the router's IP address by mistake and press Enter. The web page freezes. Your SSH window freezes. The router is still on, its lights are still blinking... but you have locked yourself out. Do you have to reset it and lose everything?

No. MikroTik routers have a back door for exactly this moment: you can talk to them using only their MAC address, with no IP at all. Network technicians use it every week. Today you will lock yourself out on purpose and get back in through that back door.

What you will learn

  • Name the ways to manage a RouterOS device: WinBox, WebFig, SSH, Telnet, serial console
  • Explain the difference between reaching a router by IP and by MAC address
  • Find neighbouring MikroTik devices with neighbour discovery
  • Disable the router's IP address and still log in with MAC-Telnet (the same idea as MAC WinBox)
  • Use safe mode so a mistake undoes itself
  • Give a group of users a simplified WebFig/WinBox with a skin

The pieces: RouterOS and its management tools

RouterOS is the operating system of every MikroTik router. It is based on the Linux kernel. The same system runs on MikroTik hardware (RouterBOARD) and as a virtual machine called CHR (Cloud Hosted Router).

In this lab every router is a CHR running RouterOS 7.23.8 (a long-term version). It behaves exactly like the hAP router you have on your desk in class, minus the WiFi and the blinking lights.

To configure a router you need a way "in". RouterOS gives you several management tools:

Tool What it is How it reaches the router
WinBox MikroTik's graphical app (Windows, macOS, Linux) by IP or by MAC address
WebFig the same menus inside a web browser (http://192.168.88.1) by IP only
SSH a secure text terminal (the CLI, command-line interface) by IP only
Telnet an old, unencrypted text terminal by IP (or by MAC with MAC-Telnet)
Serial console a cable plugged into a console port no network at all

On a brand-new MikroTik home router the LAN address is 192.168.88.1 and the user is admin. Older models had an empty password; many recent models ship with a unique password printed on the sticker instead.

IP address vs MAC address

Here is the analogy we will use for the whole lab: your class.

  • An IP address is like your postal address. A letter can reach you from anywhere in the world, as long as the address is right. Change it, and letters sent to the old one never arrive.
  • A MAC address is like the name tag on your jacket. It is printed on the network card at the factory (6 bytes, written like AA:C1:AB:D5:F1:16). It only works inside the same room: someone standing next to you can read it and call you, but nobody in another city can.

So: a router with a broken IP can still be called by name tag, as long as you are in the same room (the same cable, switch or WiFi, called the same layer 2 network). That is what MAC WinBox and MAC-Telnet do.

flowchart LR
    A["<b>Your laptop</b><br>WinBox"] -- "by IP: 192.168.88.1<br>(postal address)" --> R["<b>Router</b>"]
    A -- "by MAC: AA:C1:AB:...<br>(name tag, same room only)" --> R

How does WinBox find routers it has never seen?

MikroTik routers shout "here I am!" on every port every 30 seconds, using the MikroTik Neighbor Discovery Protocol (MNDP) (plus the standard LLDP and Cisco's CDP). WinBox's Neighbors tab, and the router's own IP → Neighbors list, simply listen to those shouts. This is called neighbour discovery.

The scenario

In the classroom you would use WinBox on your laptop. In this virtual lab we have no graphical WinBox, so a second MikroTik, r2, plays the part of "WinBox on your laptop": it sits on the same cable as your router and has no IP address at all. Anything r2 does to r1, it does by MAC address only.

flowchart LR
    PC1["<b>pc1</b><br>your laptop (browser)<br>192.168.88.10"] -- "eth1 — ether3" --- R1
    subgraph R1["<b>r1</b> · your router"]
        BR["bridge1<br>192.168.88.1/24"]
    end
    R1 -- "ether4 — ether3" --- R2["<b>r2</b><br>'WinBox by MAC'<br>no IP address"]
Node Role Address
r1 your router (RouterOS 7.23.8) bridge1 = 192.168.88.1/24 (ports ether3, ether4)
r2 second MikroTik, stands in for MAC WinBox no IP on ether3, only its MAC address
pc1 your laptop with a web browser (curl) 192.168.88.10/24

Port names in the virtual lab

On a real hAP the Internet port is ether1; in the virtual lab ether1 is reserved for the lab itself (containerlab uses it to manage the router), so the Internet port is ether2 and the LAN ports start at ether3. Never touch ether1.

Start the lab

Download the lab files and unzip them: 01-01-mac-winbox-and-skins.zip. Open a terminal inside the 01-01-mac-winbox-and-skins folder.

sudo containerlab deploy -t topology.clab.yml

Wait about one minute: each router has to boot. Then open three terminals:

ssh admin@clab-mtcna-01-01-r1          # your router   (password: admin)
ssh admin@clab-mtcna-01-01-r2          # the "MAC WinBox" router (password: admin)
docker exec -it clab-mtcna-01-01-pc1 bash   # your laptop

Wait, I am using SSH... by IP?

Yes: the ssh admin@clab-... command goes in through ether1, the lab's own management port. That is the lab's "power cable", not part of the exercise. In this lab, "the router's IP" means its LAN address 192.168.88.1, the one pc1 uses.

Three CLI tricks before you start

Key What it does
Tab completes a command; press it twice to list the options
? shows help for the current menu or command
Up / Down brings back previous commands
Ctrl+X turns safe mode on/off (more on this in step 4)

The CLI is hierarchical, like folders: /ip address print means "go into the ip folder, then address, then run print". WinBox menus have the same tree: IP → Addresses is /ip address.

Step 1 · Open WebFig from the laptop

Why: before breaking anything, prove that the normal path (by IP) works.

In a browser this is just http://192.168.88.1. On pc1 we have no screen, so we ask for the page with curl:

curl -s http://192.168.88.1/ | grep -i title

Expected output: <title>RouterOS</title>. That HTML page is WebFig.

ping -c 3 192.168.88.1

Expected: 3 received, 0% packet loss.

Check yourself

Which IP address and which TCP port did curl use to reach WebFig? (Hint: http:// means port 80.)

Done when: pc1 gets the WebFig page and pings 192.168.88.1.

Step 2 · Find your router by neighbour discovery

Why: before you can call a router by its name tag, you need to read the name tag. WinBox does this in its Neighbors tab; on RouterOS it is IP → Neighbors.

On r2:

/ip neighbor print

Expected output (your MAC address will be different):

Columns: INTERFACE, ADDRESS, MAC-ADDRESS, IDENTITY
#  INTERFACE  ADDRESS       MAC-ADDRESS        IDENTITY
0  ether3     192.168.88.1  AA:C1:AB:D5:F1:16  r1

r2 has no IP address, yet it knows r1's name (identity), its IP and its MAC. Write down the MAC: you need it in the next steps.

Check yourself

r2 has no IP address. How could it learn r1's IP address? (Think about what the neighbour "shout" contains.)

Done when: you have r1's MAC address written down.

Step 3 · Log in by MAC address (MAC-Telnet)

Why: this is the back door. MAC-Telnet is a terminal session that travels in plain Ethernet frames addressed to a MAC, with no IP inside. MAC WinBox is the same trick with the graphical app.

In WinBox you would click the MAC Address in the Neighbors tab instead of the IP and press Connect. Look at the WinBox title bar: it shows admin@AA:C1:AB:... (r1) instead of admin@192.168.88.1 (r1). On r2, type (use your MAC):

/tool mac-telnet AA:C1:AB:D5:F1:16

Log in as admin / admin. The prompt changes from [admin@r2] > to [admin@r1] >: you are now inside r1. The prompt plays the role of WinBox's title bar: it always tells you which router you are talking to. Run:

/system identity print

Expected: name: r1. Leave this session open.

You can also "ping by name tag". In a new r2 window:

/ping AA:C1:AB:D5:F1:16 interface=ether3 count=3

Expected: sent=3 received=3 packet-loss=0%. This is a MAC ping: RouterOS answers it through its MAC server (Tools → MAC Server in WinBox, /tool mac-server), the same service that accepts MAC-Telnet and MAC WinBox.

Check yourself

Why must you add interface=ether3 to a MAC ping, while a normal IP ping does not need it? (Remember: name tags only work inside one room.)

Done when: your r2 window shows the [admin@r1] > prompt.

Step 4 · Lock yourself out (on purpose, with safe mode)

Why: now we cut the IP path and prove the MAC path survives. This is the optional part of the official LAB (slides 23–24).

First, meet safe mode. Press Ctrl+X in the r1 SSH window: the prompt gets a <SAFE> mark. While safe mode is on, if your session dies (for example because you just cut yourself off), RouterOS automatically undoes every change you made since you pressed Ctrl+X. Press Ctrl+X again to keep the changes. Use it whenever you touch addresses, the firewall or bridges on a remote router.

Safe mode would spoil this experiment

Here we want the change to stay, so we do not use safe mode in this step. In real life: use it.

In WinBox: IP → Addresses, select 192.168.88.1/24, click the Disable (red cross) button. In the r1 SSH window:

/ip address disable [find address="192.168.88.1/24"]
/ip address print

Expected: the LAN line now has an X flag (disabled).

Now try the IP path from pc1:

curl -m 4 http://192.168.88.1/
ping -c 2 192.168.88.1

Expected: curl: (28) Connection timed out and 100% packet loss. WebFig is gone, and WinBox by IP would fail too.

And the MAC path from r2:

/ping AA:C1:AB:D5:F1:16 interface=ether3 count=3

Expected: still received=3. The name tag still works because it never needed the postal address.

Check yourself

Write in your report one real situation where a technician would be glad that MAC WinBox exists.

Done when: pc1 cannot reach 192.168.88.1 but r2 still MAC-pings r1.

Step 5 · Get back in through the back door

Why: this is the rescue. Imagine the SSH window to r1 does not exist: the only way in is by MAC.

In the r2 window that is still logged into r1 by MAC-Telnet (prompt [admin@r1] >). If it timed out, open it again with /tool mac-telnet <MAC>:

/ip address enable [find address="192.168.88.1/24"]
/ip address print

In WinBox (connected by MAC): IP → Addresses, select the line, Enable (blue tick). The X disappears. Type /quit to leave the MAC-Telnet session.

Back on pc1:

curl -s http://192.168.88.1/ | grep -i title

Expected: <title>RouterOS</title> again.

Check yourself

In the classroom, MAC WinBox only works if your laptop is on the same switch or cable as the router. Why would it not work from home, over the Internet?

Done when: WebFig answers again on pc1.

Step 6 · Give a group a simpler interface: skins

Why: a router has hundreds of menus. A skin is a "simplified view" of WebFig and WinBox: it can hide menus, rename fields or make them read-only, so that, for example, the shop owner only sees the WiFi password field. Skins are not a security tool (a user can still type commands in a terminal); permissions are what really protect the router. You will meet users and permissions properly in lab 01-05.

A skin is a small JSON text file stored in the router's skins folder. It is normally drawn with the Design Skin button in WebFig (only users with the policy and sensitive permissions see that button). A skin applies to a user group: every user of the group gets it when they log in to WebFig or WinBox.

In class, in WebFig: Design Skin → hide some menus → Save as students. Then System → Users → Groups, add group students.

In the virtual lab, create an empty skin file (an empty skin hides nothing, but it shows the whole mechanism) and the group on r1:

/file add name=skins/students.json contents="{}"

Wait two seconds (RouterOS needs a moment to notice the new skin), then:

/user group add name=students policy=read,winbox,web skin=students
/user group print where name=students

Expected: a group with policy=read,winbox,web,!local,!telnet,... and skin=students. This is the command from the course slide: /user group set <group> skin=<skin>, done at creation time.

Check yourself

If you get input does not match any value of skin, what has happened? What does that tell you about where RouterOS looks for skins?

Done when: /user group print shows the group students with skin=students.

Check your work

From the lab folder on your PC:

CLAB_EXEC="docker exec" ./check.sh

Every line must say PASS and the last line Lab 01-01 SOLVED.

If something goes wrong

Symptom Likely cause Fix
/ip neighbor print on r2 is empty the routers just booted; discovery shouts every 30 s wait 30 seconds and print again
/tool mac-telnet says Login failed wrong password, or you typed before the Login: prompt appeared wait for Login:, type admin, then admin
MAC ping: timeout wrong MAC, or interface= is not the port that faces r1 copy the MAC from /ip neighbor print, use interface=ether3 on r2
curl still works after step 4 you disabled the wrong line (e.g. typed in r2) check the prompt says [admin@r1] and print /ip address
You lost the SSH session to r1 you disabled ether1's address (the lab's management port) destroy and deploy the lab again; never touch ether1
input does not match any value of skin the skin file does not exist yet, or has another name /file print, wait a few seconds, check it is skins/students.json

Clean up

sudo containerlab destroy -t topology.clab.yml --cleanup

Key takeaways

  • RouterOS can be managed with WinBox, WebFig, SSH, Telnet and a serial console; WinBox is the only GUI that also works by MAC.
  • An IP address works across networks (postal address); a MAC address only works inside the same layer 2 network (name tag in the same room).
  • Neighbour discovery (MNDP, LLDP, CDP) lets you see nearby MikroTik devices, their identity, IP and MAC, even without an IP of your own.
  • MAC WinBox and MAC-Telnet rescue a router whose IP configuration is broken, as long as you are on the same cable or switch.
  • Safe mode (Ctrl+X) undoes your changes automatically if you lose the connection.
  • A skin simplifies WebFig/WinBox for a user group; it is about comfort, not security.

Quick check

1. You disabled the router's only LAN IP address. Which tool can still log in to it from your laptop on the same switch?
  • WinBox using the router's MAC address
  • WebFig at http://192.168.88.1
  • SSH to 192.168.88.1
  • WinBox using the router's IP address

MAC WinBox talks to the router in Ethernet frames addressed to its MAC address, so it does not need any IP. WebFig, SSH and WinBox-by-IP all need the IP address you just disabled.

2. Why can't you use MAC WinBox to reach your classroom router from home?
  • MAC addresses only work inside the same layer 2 network
  • MAC WinBox is disabled by default on every router
  • Home Internet connections block port 8291
  • MAC addresses change every time the router reboots

A MAC address is like a name tag: it only works for someone in the same room (the same cable, switch or WiFi). Routers do not forward frames by MAC address between networks, so from home you need an IP path.

3. Which RouterOS menu lists the MikroTik devices that announce themselves on your ports?
  • IP → Neighbors
  • IP → Addresses
  • Tools → MAC Server
  • System → Identity

IP → Neighbors (/ip neighbor print) shows what neighbour discovery (MNDP, LLDP, CDP) has heard: interface, IP, MAC and identity of each neighbour.

4. What does safe mode do if your session drops while it is on?
  • It automatically undoes the changes made since safe mode was turned on
  • It reboots the router into its factory configuration
  • It saves a backup file before every command
  • It blocks every command that changes an IP address

Safe mode (Ctrl+X) keeps a list of your changes. If the session is lost, RouterOS rolls them back, so a mistake that locks you out repairs itself.

5. What is a WebFig skin?
  • A file that hides or simplifies menus for the users of a group
  • A firewall rule that blocks WebFig for some users
  • A colour theme that only changes how WebFig looks
  • A password policy applied to a group of users

A skin is a JSON file in the skins folder, assigned to a user group (/user group set <group> skin=<skin>). It hides or simplifies menus in WebFig and WinBox. It is not a security tool: permissions are.

6. Which tool does NOT need the router to have an IP address?
  • A serial console cable
  • WebFig
  • SSH
  • Telnet to the router's IP

The serial console is a direct cable to the router's console port: no network, no IP. WebFig, SSH and Telnet all travel inside IP packets.

7. A new hAP arrives with its WiFi broken and you cannot get an IP from it. Your laptop is cabled to ether2. Which two actions help?
  • Open WinBox's Neighbors tab and look for the router
  • Connect with WinBox by clicking the router's MAC address
  • Type http://192.168.88.255 in the browser
  • Ping the router's MAC address from Windows' ping command

WinBox's Neighbors tab shows routers found by neighbour discovery, and connecting by MAC address needs no IP. A browser and Windows ping only work with IP addresses.

You can now always get into a router, even a broken one. Next lab: connect that router to the Internet through the class AP.