HomeLab #1: MikroTik as a Home Router

✨ Explore this insightful post from Hacker News 📖

📂 **Category**:

✅ **What You’ll Learn**:

How it all begin…

Know your ISP

IPoE or PPPoE

Protocol What your ISP gives you Typical setup on MikroTik
IPoE IP address, gateway, DNS via DHCP on the WAN Add DHCP client on the WAN port
PPPoE Username and password, sometimes over a VLAN Create VLAN if needed, then add PPPoE client

Public or private WAN IPv4

WAN IPv4 What it means Impact
Public A routable address dedicated to your line Port forwarding, UPnP, and inbound connections work normally
Private (CGNAT) A shared address behind the ISP’s NAT Inbound connections generally don’t work unless the ISP sells a public IPv4 add-on

Setting up MikroTik router

MikroTikRouter12345678

MikroTikRouter12345678

MikroTik router alone

Getting Internet

MikroTikRouter12345678ONT / ISP

MikroTikRouter12345678ONT / ISP

MikroTik router connected to ONT
# Check the current MAC before changing it
/interface ethernet print where name=ether1
# Flags: X - disabled, R - running, S - slave
#  #    NAME    MTU  MAC-ADDRESS        ARP     SWITCH
#  0  R ether1  1500 48:A9:8A:11:22:33  enabled switch1
# Clone the ISP router's MAC (replace with the address from its label)
/interface ethernet set ether1 mac-address=AA:BB:CC:DD:EE:FF
# Confirm the WAN port now advertises the cloned MAC
/interface ethernet print where name=ether1
# Flags: X - disabled, R - running, S - slave
#  #    NAME    MTU  MAC-ADDRESS        ARP     SWITCH
#  0  R ether1  1500 AA:BB:CC:DD:EE:FF  enabled switch1

/interface vlan add name=internet-vlan-35 vlan-id=35 interface=ether1
/interface vlan print
# Flags: X - disabled, I - invalid, D - dynamic
#  NAME               MTU  ARP  VLAN-ID  INTERFACE
# 0 internet-vlan-35  1500  enabled  35       ether1

MikroTikRouter12345678ONT / ISPVLAN 35

MikroTikRouter12345678ONT / ISPVLAN 35

MikroTik router with ONT and VLAN 35
/interface pppoe-client add name=pppoe-out1 interface=internet-vlan-35 \
    add-default-route=yes use-peer-dns=yes disabled=no
/interface pppoe-client print
# Flags: X - disabled, I - invalid, R - running, D - dynamic
#  NAME        MTU   INTERFACE          USER  SERVICE  CALLER-ID  ENCODING  STATUS
# 0 pppoe-out1  auto  internet-vlan-35         internet                    linking
/interface pppoe-client set pppoe-out1 user=YOUR_ISP_USERNAME password=YOUR_ISP_PASSWORD
/interface pppoe-client print
# Flags: X - disabled, I - invalid, R - running, D - dynamic
#  NAME        MTU   INTERFACE          USER              SERVICE  CALLER-ID  ENCODING  STATUS
# 0 R pppoe-out1  auto  internet-vlan-35   YOUR_ISP_USERNAME  internet              connected
/ip route print where dst-address=0.0.0.0/0
# Flags: D - dynamic; X - disabled, R - running, S - static; + - active
#  DST-ADDRESS     PREF-SRC  GATEWAY           DISTANCE
# D 0.0.0.0/0               pppoe-out1        1

MikroTikRouter12345678ONT / ISPVLAN 35PPPoE

MikroTikRouter12345678ONT / ISPVLAN 35PPPoE

MikroTik router with ONT, VLAN 35 and PPPoE client

Let’s get clean WiFi setup

# Physical step: run an Ethernet cable from router port 8 (ether8) to the wAP AP.
# Then enable PoE output on port 8 so the wAP powers up:
/interface ethernet poe set ether8 poe-out=auto-on
/interface ethernet poe print
# NAME   POE-OUT   VOLTAGE  CURRENT
# ether8 auto-on   24.0V    210mA
# --- On the router (CAPsMAN controller) ---
/interface wifi security add name=home-sec \
    authentication-types=wpa2-psk,wpa3-psk \
    wps=disable passphrase=YOUR_WIFI_PASSWORD
/interface wifi channel add name=ch-2ghz band=2ghz-n width=20mhz
/interface wifi channel add name=ch-5ghz band=5ghz-ac width=20/40mhz
/interface wifi datapath add name=home-dp bridge=bridge disabled=no
/interface wifi configuration add name=home-2g ssid=HomeNetwork \
    country=YOUR_COUNTRY security=home-sec channel=ch-2ghz datapath=home-dp mode=ap
/interface wifi configuration add name=home-5g ssid=HomeNetwork \
    country=YOUR_COUNTRY security=home-sec channel=ch-5ghz datapath=home-dp mode=ap
/interface wifi capsman set enabled=yes interfaces=bridge
/interface wifi provisioning add action=create-dynamic-enabled \
    master-configuration=home-2g supported-bands=2ghz-n
/interface wifi provisioning add action=create-dynamic-enabled \
    master-configuration=home-5g supported-bands=5ghz-ac
# Verify the controller is listening
/interface wifi capsman print
#            enabled: yes
#           package: wifi-qcom
#        interfaces: bridge
# require-peer-certificate: no
#     upgrade-policy: none
# --- On the wAP (CAP / managed AP) ---
/interface wifi cap set enabled=yes discovery-interfaces=bridge
/interface wifi set wifi1 configuration.manager=capsman disabled=no
/interface wifi set wifi2 configuration.manager=capsman disabled=no
# Verify the wAP has joined the controller
/interface wifi cap print
#        enabled: yes
# discovery-interfaces: bridge
#   caps-man-addresses:
#   caps-man-names:
# Back on the controller, check that managed radios appeared
/interface wifi print
# Flags: D - dynamic
#    #    NAME                                              TYPE       ACTUAL-CONFIGURATION
#    0  D  cap1@2.4GHz                                       wifi       home-2g
#    1  D  cap1@5GHz                                         wifi       home-5g

MikroTikRouter12345678ONT / ISPVLAN 35PPPoEWiFi APPoE

MikroTikRouter12345678ONT / ISPVLAN 35PPPoEWiFi APPoE

MikroTik router with ONT, VLAN 35, PPPoE client and WiFi AP over PoE

Fighting Bufferbloat

InternetRouterCounter-StrikeiOSupdatePhotosbackup

InternetRouterCounter-StrikeiOSupdatePhotosbackup

Step 1: only Counter-Strike traffic, latency stays low

InternetRouterCounter-StrikeiOSupdatePhotosbackup

InternetRouterCounter-StrikeiOSupdatePhotosbackup

Step 2: iOS update begins, queue fills and latency rises

InternetRouterCounter-StrikeiOSupdatePhotosbackup

InternetRouterCounter-StrikeiOSupdatePhotosbackup

Step 3: photo backup joins in, queue keeps growing

InternetRouterCounter-StrikeiOSupdatePhotosbackup

InternetRouterCounter-StrikeiOSupdatePhotosbackup

Step 4: queue full, game packets stuck behind bulk traffic

FQ-CoDel to the rescue

Queue discipline How it handles congestion Best for
FIFO (default-small) One shared queue; first in, first out Low congestion, uniform traffic
FQ-CoDel Per-flow fairness with active delay control Gaming and VoIP on shared links
/queue type add name=fq-codel kind=fq-codel
/queue type print where name=fq-codel
# Flags: * - default, X - disabled, I - invalid, D - dynamic
#  0   name="fq-codel" kind=fq-codel fq-codel-target=5ms fq-codel-interval=100ms \
#      fq-codel-ecn=yes fq-codel-flows=1024 fq-codel-quantum=1514 \
#      fq-codel-limit=10240 fq-codel-memlimit=32.0MiB
/queue simple add name=shaping target=pppoe-out1 max-limit=<0.9xUPLOAD>M/<0.9xDOWNLOAD>M \
    queue=fq-codel/fq-codel total-queue=fq-codel
/queue simple print where name=shaping
# Flags: X - disabled, I - invalid; D - dynamic
#  0   name="shaping" target=pppoe-out1 dst-address=0.0.0.0/0 \
#      interface=all parent=none priority=8/8 queue=fq-codel/fq-codel \
#      limit-at=0/0 max-limit=<0.9xUPLOAD>M/<0.9xDOWNLOAD>M burst-limit=0/0 burst-threshold=0/0 \
#      burst-time=0s/0s bucket-size=0.1/0.1 total-queue=fq-codel
# Find the fasttrack rule
/ip firewall filter print where action=fasttrack-connection
# Option A: disable the rule
/ip firewall filter disable [find action=fasttrack-connection]

# Option B: remove it entirely
/ip firewall filter remove [find action=fasttrack-connection]

⚡ **What’s your take?**
Share your thoughts in the comments below!

#️⃣ **#HomeLab #MikroTik #Home #Router**

🕒 **Posted on**: 1784493358

🌟 **Want more?** Click here for more info! 🌟

By

Leave a Reply

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