<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: J M C Dias</title>
    <description>The latest articles on Forem by J M C Dias (@jmcdias).</description>
    <link>https://forem.com/jmcdias</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3333311%2F13e808e4-038d-40ea-b7ed-2a114d03b6fc.png</url>
      <title>Forem: J M C Dias</title>
      <link>https://forem.com/jmcdias</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jmcdias"/>
    <language>en</language>
    <item>
      <title>Mastering MikroTik &amp; Managed Switches: Routing, VLANs, PPPoE, Failover, QoS &amp; Security</title>
      <dc:creator>J M C Dias</dc:creator>
      <pubDate>Tue, 08 Jul 2025 23:22:26 +0000</pubDate>
      <link>https://forem.com/jmcdias/mastering-mikrotik-managed-switches-routing-vlans-pppoe-failover-qos-security-25cm</link>
      <guid>https://forem.com/jmcdias/mastering-mikrotik-managed-switches-routing-vlans-pppoe-failover-qos-security-25cm</guid>
      <description>&lt;h2&gt;
  
  
  📘 Complete Guide: MikroTik in Practice — VLANs, PPPoE, Failover, NAT, Mangle, QoS &amp;amp; Firewall
&lt;/h2&gt;

&lt;p&gt;This guide is the result of &lt;strong&gt;in-depth, real-world study in networking&lt;/strong&gt; using MikroTik and Cisco managed switches.&lt;/p&gt;

&lt;p&gt;It covers everything from the &lt;strong&gt;OSI model&lt;/strong&gt; to real configurations — including &lt;strong&gt;VLANs&lt;/strong&gt;, &lt;strong&gt;PPPoE&lt;/strong&gt;, &lt;strong&gt;routing marks&lt;/strong&gt;, &lt;strong&gt;NAT&lt;/strong&gt;, &lt;strong&gt;firewalling&lt;/strong&gt;, &lt;strong&gt;automatic failover&lt;/strong&gt;, and &lt;strong&gt;Queue Tree QoS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you're aiming to &lt;strong&gt;level up your networking skills&lt;/strong&gt; for professional environments, this is a hands-on starting point.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧠 &lt;strong&gt;This article is part of my upcoming eBook:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🛠️ &lt;em&gt;&lt;strong&gt;The Practical Network Blueprint: Real Infrastructure with MikroTik, Cisco &amp;amp; Cloud Edge&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;&lt;br&gt;
A complete and evolving resource that compiles content from all my technical posts into one cohesive reference.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📘 Module 1 — Networking Fundamentals: Layers, Switches &amp;amp; Routers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧠 OSI Model Explained with Real-Life Analogy
&lt;/h3&gt;

&lt;p&gt;The OSI model breaks network communication into 7 logical layers.&lt;br&gt;&lt;br&gt;
Think of it like sending a letter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 1: Physical&lt;/strong&gt; → The envelope being passed hand-to-hand → &lt;em&gt;Cables, signals&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2: Data Link&lt;/strong&gt; → Sender/receiver address → &lt;em&gt;MAC address, Switches&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3: Network&lt;/strong&gt; → ZIP/Postal code → &lt;em&gt;IP, Routing&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 4: Transport&lt;/strong&gt; → Type of delivery (express, registered) → &lt;em&gt;TCP, UDP&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layers 5–7: Session–Application&lt;/strong&gt; → The letter content → &lt;em&gt;Browser, Email, WinBox&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  🔎 In daily usage:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2&lt;/strong&gt; → Plugging a cable into a switch
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3&lt;/strong&gt; → MikroTik routing packets by IP
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 4&lt;/strong&gt; → Browser initiating a TCP connection&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  🔹 How This Applies to MikroTik
&lt;/h3&gt;

&lt;p&gt;When configuring VLANs, PPPoE, NAT, or mangle rules, you're working across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2&lt;/strong&gt; → VLANs, MAC addresses
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3&lt;/strong&gt; → IP addresses and routing
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 4+&lt;/strong&gt; → Ports like 80, 443, etc.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🖧 Switches and VLANs (Layer 2)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  🎯 What is a VLAN?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;VLAN (Virtual LAN)&lt;/strong&gt; is a logically isolated network on the same physical switch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example – A 24-port switch:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ports 1–8 → VLAN 10 (Admin)
&lt;/li&gt;
&lt;li&gt;Ports 9–16 → VLAN 20 (Finance)
&lt;/li&gt;
&lt;li&gt;Ports 17–24 → VLAN 30 (Guests)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Devices in different VLANs cannot communicate unless routed.&lt;/p&gt;


&lt;h3&gt;
  
  
  🔀 Tagged vs Untagged Traffic
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tagged&lt;/td&gt;
&lt;td&gt;Trunk port&lt;/td&gt;
&lt;td&gt;Packet includes VLAN ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Untagged&lt;/td&gt;
&lt;td&gt;Access port&lt;/td&gt;
&lt;td&gt;Packet already assigned VLAN&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  🔄 Access vs Trunk Ports
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access port&lt;/strong&gt; → Connects to end devices (PCs, printers). One VLAN.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trunk port&lt;/strong&gt; → Connects to MikroTik or other switches. Multiple VLANs (tagged).&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧪 Topology Example (Cisco Switch + MikroTik)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
\[Fiber ISP]
|
Cisco Switch (Gi1/1/2 — trunk)
|
MikroTik (ether13)
|
VLAN 13 → Link C
VLAN 10 → Link A
VLAN 20 → Internal LAN

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔧 Cisco Switch Configuration
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  📘 How MikroTik Sees This
&lt;/h2&gt;

&lt;p&gt;MikroTik uses &lt;strong&gt;virtual VLAN interfaces&lt;/strong&gt; over physical ports.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/interface vlan
add &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;vlan13 vlan-id&lt;span class="o"&gt;=&lt;/span&gt;13 &lt;span class="nv"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ether13 &lt;span class="nv"&gt;comment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"LINK C"&lt;/span&gt;

/ip address
add &lt;span class="nv"&gt;address&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;192.0.2.2/30 &lt;span class="nv"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;vlan13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📌 Use Case — Isolating Departments
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;VLAN 100 → Management&lt;/li&gt;
&lt;li&gt;VLAN 200 → Finance&lt;/li&gt;
&lt;li&gt;VLAN 300 → Guest Wi-Fi&lt;/li&gt;
&lt;li&gt;VLAN 400 → IP Cameras&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use MikroTik firewall rules to allow or deny communication between them.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Module Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VLAN&lt;/strong&gt; → Logical network segmentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trunk&lt;/strong&gt; → Port carrying multiple VLANs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access&lt;/strong&gt; → Port for end-user device (1 VLAN)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tagged&lt;/strong&gt; → Packet includes VLAN ID&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Untagged&lt;/strong&gt; → Already assigned to VLAN&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📘 Module 2 — Creating VLANs on Cisco Switch + MikroTik
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧠 Real Scenario
&lt;/h3&gt;

&lt;p&gt;You’ve added a new internet link (Link C) via Ethernet to your Cisco switch.&lt;br&gt;
You must deliver this link to MikroTik using &lt;strong&gt;VLAN 13&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You’ll need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create VLAN 13 on Cisco&lt;/li&gt;
&lt;li&gt;Allow it on the trunk port to MikroTik&lt;/li&gt;
&lt;li&gt;Create VLAN interface in MikroTik&lt;/li&gt;
&lt;li&gt;Assign public IP and routing&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎯 Setup Summary
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Device&lt;/th&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cisco Switch&lt;/td&gt;
&lt;td&gt;Create VLAN, allow on trunk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MikroTik&lt;/td&gt;
&lt;td&gt;Create &lt;code&gt;/interface vlan&lt;/code&gt;, IP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🧪 Example Setup
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VLAN ID:&lt;/strong&gt; 13&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch Port:&lt;/strong&gt; Gi1/1/2&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MikroTik Port:&lt;/strong&gt; ether13&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public IP:&lt;/strong&gt; 192.0.2.2/30&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway:&lt;/strong&gt; 192.0.2.1&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔧 Cisco Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conf t
vlan 13
 name LINK_C
&lt;span class="nb"&gt;exit

&lt;/span&gt;interface Gi1/1/2
 description Trunk to MikroTik
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan add 13
 switchport mode trunk
&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Make sure the port is set to &lt;strong&gt;trunk&lt;/strong&gt; mode.&lt;/p&gt;




&lt;h3&gt;
  
  
  🌐 MikroTik VLAN Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/interface vlan
add &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;vlan13 vlan-id&lt;span class="o"&gt;=&lt;/span&gt;13 &lt;span class="nv"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ether13 &lt;span class="nv"&gt;comment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"LINK C - VLAN 13"&lt;/span&gt;

/ip address
add &lt;span class="nv"&gt;address&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;192.0.2.2/30 &lt;span class="nv"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;vlan13 &lt;span class="nv"&gt;comment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Public IP - LINK C"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ MikroTik now sees VLAN 13 as a &lt;strong&gt;normal interface&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  📈 Connectivity Test (in MikroTik)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping 192.0.2.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ If it replies, the VLAN and trunk are working correctly.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Use Clear Naming
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Interface&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;vlan10&lt;/td&gt;
&lt;td&gt;Link A (VLAN 10)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vlan13&lt;/td&gt;
&lt;td&gt;Link C (VLAN 13)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vlan20&lt;/td&gt;
&lt;td&gt;Internal LAN&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  ⚠️ Common Problems &amp;amp; Fixes
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely Cause&lt;/th&gt;
&lt;th&gt;Solution&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No ping to gateway&lt;/td&gt;
&lt;td&gt;VLAN not in trunk&lt;/td&gt;
&lt;td&gt;Check &lt;code&gt;switchport trunk allowed&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No MikroTik traffic&lt;/td&gt;
&lt;td&gt;Wrong VLAN ID/port&lt;/td&gt;
&lt;td&gt;Confirm VLAN + physical port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No public IP&lt;/td&gt;
&lt;td&gt;PPPoE required&lt;/td&gt;
&lt;td&gt;See &lt;strong&gt;Module 3&lt;/strong&gt; for config&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧠 Module Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create VLANs on the switch&lt;/li&gt;
&lt;li&gt;Allow them on trunk ports&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/interface vlan&lt;/code&gt; on MikroTik&lt;/li&gt;
&lt;li&gt;Assign IPs as if physical interface&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;ping&lt;/code&gt; to test connectivity&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;clear naming&lt;/strong&gt; conventions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 What’s Next?
&lt;/h2&gt;

&lt;p&gt;This is just the beginning. Modules 3–7 cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PPPoE&lt;/li&gt;
&lt;li&gt;Routing marks&lt;/li&gt;
&lt;li&gt;NAT &amp;amp; Mangle&lt;/li&gt;
&lt;li&gt;QoS&lt;/li&gt;
&lt;li&gt;Firewall security&lt;/li&gt;
&lt;li&gt;Real-world failover diagnostics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://medium.com/@joaodiasworking/mastering-mikrotik-managed-switches-routing-vlans-pppoe-failover-qos-security-1b19e471106e" rel="noopener noreferrer"&gt;Continue the full 7-module series on Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>network</category>
    </item>
  </channel>
</rss>
