Skip to content

Instantly share code, notes, and snippets.

@roman01la
Created February 6, 2026 11:41
Show Gist options
  • Select an option

  • Save roman01la/31313eace3b1192198a223d6c60de700 to your computer and use it in GitHub Desktop.

Select an option

Save roman01la/31313eace3b1192198a223d6c60de700 to your computer and use it in GitHub Desktop.
MikroTik Metal 52 ac: Stable 2.4 GHz Link
/system script add name=auto-channel-after-client policy=read,write,test source={
:local iface "wlan1";
:local chans {2412;2437;2462};
:local bestFreq 2437;
:local bestScore 999999;
:global autoChanDone;
:if ([:len $autoChanDone] > 0 && $autoChanDone = true) do={
:log info "[auto-chan] already done, skipping";
:return;
}
:log info "[auto-chan] waiting for a client to connect...";
:for i from=1 to=120 do={
:local mon [/interface wireless monitor $iface once as-value];
:local rc ($mon->"registered-clients");
:if ([:len $rc] = 0) do={ :set rc 0; }
:if ($rc > 0) do={
:log warning ("[auto-chan] client detected (registered=" . $rc . "), scanning...");
:set i 121;
} else={
:delay 1;
}
}
:local res [/interface wireless scan $iface duration=5];
:foreach f in=$chans do={
:local score 0;
:foreach r in=$res do={
:local rf ($r->"frequency");
:if ($rf = $f) do={
:local s ($r->"signal-strength");
:if ([:len $s] = 0) do={ :set s -100; }
:set score ($score + 10);
:if ($s > -80) do={ :set score ($score + (80 + $s)); }
}
}
:log info ("[auto-chan] freq " . $f . " score " . $score);
:if ($score < $bestScore) do={ :set bestScore $score; :set bestFreq $f; }
}
:log warning ("[auto-chan] choosing " . $bestFreq . " score=" . $bestScore);
/interface wireless set $iface frequency=$bestFreq;
:set autoChanDone true;
}

MikroTik Metal 52 ac: Stable 2.4 GHz Link (ROS7 + wireless) — Step-by-step

Goal: a stable, long-range-friendly 2.4 GHz link (less speed, more reliability), avoiding the “TX drops to 1–2 Mbps” problem.


0) Connect safely

Recommended for changes: WinBox over Ethernet / MAC so you don’t lock yourself out.

  • WinBox → Neighbors → select device → connect (IP or MAC).

1) Set Wi-Fi mode, band, and channel width

WinBox:

  1. Wireless → Interfaces
  2. Double-click wlan1
  3. Wireless tab:
    • Mode: ap bridge
    • Band: 2GHz-onlyg
    • Channel Width: 20MHz
    • SSID: set a name (e.g. TR-Metal)
  4. Apply / OK

Why:

  • 2GHz-onlyg disables legacy 802.11b and prevents falling back to CCK rates.
  • 20 MHz is more robust on 2.4 GHz.

2) Configure WPA2 password (Security Profile)

WinBox:

  1. Wireless → Security Profiles
  2. Add (+) a new profile (recommended)
    • Name: WPA2_HOME (any name)
    • Authentication Types: check WPA2 PSK
    • Uncheck WPA (optional but recommended if all clients support WPA2)
    • Encryption: AES CCM
    • WPA2 Pre-Shared Key: set your password
  3. Apply / OK

Assign it:

  1. Wireless → Interfaces → wlan1
  2. Wireless tab → Security Profile: WPA2_HOME
  3. Apply / OK

3) Remove 802.11b/CCK rates (critical fix)

This is the change that stops “TX=1–2 Mbps”.

CLI (Terminal in WinBox)

Paste:

/interface wireless rates set wlan1 rate-set=configured \
  basic-rates-b="" supported-rates-b="" \
  basic-rates-a/g=6 supported-rates-a/g=6,9,12,18,24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment