π Complete Guide: MikroTik in Practice β VLANs, PPPoE, Failover, NAT, Mangle, QoS & Firewall
This guide is the result of in-depth, real-world study in networking using MikroTik and Cisco managed switches.
It covers everything from the OSI model to real configurations β including VLANs, PPPoE, routing marks, NAT, firewalling, automatic failover, and Queue Tree QoS.
If you're aiming to level up your networking skills for professional environments, this is a hands-on starting point.
π§ This article is part of my upcoming eBook:
π οΈ The Practical Network Blueprint: Real Infrastructure with MikroTik, Cisco & Cloud Edge
A complete and evolving resource that compiles content from all my technical posts into one cohesive reference.
π Module 1 β Networking Fundamentals: Layers, Switches & Routers
π§ OSI Model Explained with Real-Life Analogy
The OSI model breaks network communication into 7 logical layers.
Think of it like sending a letter:
- Layer 1: Physical β The envelope being passed hand-to-hand β Cables, signals
- Layer 2: Data Link β Sender/receiver address β MAC address, Switches
- Layer 3: Network β ZIP/Postal code β IP, Routing
- Layer 4: Transport β Type of delivery (express, registered) β TCP, UDP
- Layers 5β7: SessionβApplication β The letter content β Browser, Email, WinBox
π In daily usage:
- Layer 2 β Plugging a cable into a switch
- Layer 3 β MikroTik routing packets by IP
- Layer 4 β Browser initiating a TCP connection
πΉ How This Applies to MikroTik
When configuring VLANs, PPPoE, NAT, or mangle rules, you're working across:
- Layer 2 β VLANs, MAC addresses
- Layer 3 β IP addresses and routing
- Layer 4+ β Ports like 80, 443, etc.
π§ Switches and VLANs (Layer 2)
π― What is a VLAN?
A VLAN (Virtual LAN) is a logically isolated network on the same physical switch.
Example β A 24-port switch:
- Ports 1β8 β VLAN 10 (Admin)
- Ports 9β16 β VLAN 20 (Finance)
- Ports 17β24 β VLAN 30 (Guests)
π‘ Devices in different VLANs cannot communicate unless routed.
π Tagged vs Untagged Traffic
Type | Where | Meaning |
---|---|---|
Tagged | Trunk port | Packet includes VLAN ID |
Untagged | Access port | Packet already assigned VLAN |
π Access vs Trunk Ports
- Access port β Connects to end devices (PCs, printers). One VLAN.
- Trunk port β Connects to MikroTik or other switches. Multiple VLANs (tagged).
π§ͺ Topology Example (Cisco Switch + MikroTik)
\[Fiber ISP]
|
Cisco Switch (Gi1/1/2 β trunk)
|
MikroTik (ether13)
|
VLAN 13 β Link C
VLAN 10 β Link A
VLAN 20 β Internal LAN
π§ Cisco Switch Configuration
vlan 10
name LINK_A
vlan 13
name LINK_C
vlan 20
name LAN_LOCAL
interface Gi1/1/2
description Trunk to MikroTik
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 10,13,20
π How MikroTik Sees This
MikroTik uses virtual VLAN interfaces over physical ports.
/interface vlan
add name=vlan13 vlan-id=13 interface=ether13 comment="LINK C"
/ip address
add address=192.0.2.2/30 interface=vlan13
π Use Case β Isolating Departments
- VLAN 100 β Management
- VLAN 200 β Finance
- VLAN 300 β Guest Wi-Fi
- VLAN 400 β IP Cameras
Use MikroTik firewall rules to allow or deny communication between them.
π§ Module Summary
- VLAN β Logical network segmentation
- Trunk β Port carrying multiple VLANs
- Access β Port for end-user device (1 VLAN)
- Tagged β Packet includes VLAN ID
- Untagged β Already assigned to VLAN
π Module 2 β Creating VLANs on Cisco Switch + MikroTik
π§ Real Scenario
Youβve added a new internet link (Link C) via Ethernet to your Cisco switch.
You must deliver this link to MikroTik using VLAN 13.
Youβll need to:
- Create VLAN 13 on Cisco
- Allow it on the trunk port to MikroTik
- Create VLAN interface in MikroTik
- Assign public IP and routing
π― Setup Summary
Device | Task |
---|---|
Cisco Switch | Create VLAN, allow on trunk |
MikroTik | Create /interface vlan , IP |
π§ͺ Example Setup
- VLAN ID: 13
- Switch Port: Gi1/1/2
- MikroTik Port: ether13
- Public IP: 192.0.2.2/30
- Gateway: 192.0.2.1
π§ Cisco Configuration
conf t
vlan 13
name LINK_C
exit
interface Gi1/1/2
description Trunk to MikroTik
switchport trunk encapsulation dot1q
switchport trunk allowed vlan add 13
switchport mode trunk
exit
β οΈ Make sure the port is set to trunk mode.
π MikroTik VLAN Configuration
/interface vlan
add name=vlan13 vlan-id=13 interface=ether13 comment="LINK C - VLAN 13"
/ip address
add address=192.0.2.2/30 interface=vlan13 comment="Public IP - LINK C"
β MikroTik now sees VLAN 13 as a normal interface.
π Connectivity Test (in MikroTik)
ping 192.0.2.1
β If it replies, the VLAN and trunk are working correctly.
π‘ Use Clear Naming
Interface | Description |
---|---|
vlan10 | Link A (VLAN 10) |
vlan13 | Link C (VLAN 13) |
vlan20 | Internal LAN |
β οΈ Common Problems & Fixes
Symptom | Likely Cause | Solution |
---|---|---|
No ping to gateway | VLAN not in trunk | Check switchport trunk allowed
|
No MikroTik traffic | Wrong VLAN ID/port | Confirm VLAN + physical port |
No public IP | PPPoE required | See Module 3 for config |
π§ Module Summary
- Create VLANs on the switch
- Allow them on trunk ports
- Use
/interface vlan
on MikroTik - Assign IPs as if physical interface
- Use
ping
to test connectivity - Use clear naming conventions
π Whatβs Next?
This is just the beginning. Modules 3β7 cover:
- PPPoE
- Routing marks
- NAT & Mangle
- QoS
- Firewall security
- Real-world failover diagnostics
Top comments (0)