Updated
This is far and away the best version!
{
:global WLANMAC [/interface wireless get wlan1 mac-address];
:global SSID "YOURSSID";
:global SETWIFI do={:global SSID; /interface wireless set $1 ssid=($SSID.$2) comment=3.4 mode=ap-bridge wireless-protocol=802.11 station-roaming=disabled wmm-support=enabled distance=indoors multicast-buffering=disabled multicast-helper=disabled frequency=auto security-profile=ap-security-0 wps-mode=disabled disabled=no arp=enabled hw-retries=$9 disconnect-timeout=$10 keepalive-frames=disabled bridge-mode=disabled country="united states3" frequency-mode=regulatory-domain band=$3 channel-width=$4 scan-list=$5 antenna-gain=$6 tx-power-mode=default amsdu-limit=$7 rx-chains=$8 tx-chains=$8};
:global SETWIFISEC do={/interface wireless security-profiles set group-key-update=1h management-protection=disabled [find name~""]};
:global 2GCHAN do={/interface wireless channels add name=$1 frequency=$2 extension-channel=$3 band=2ghz-b/g/n width=20 list=WiFi24};
:global 5GCHAN do={/interface wireless channels add name=$1 frequency=$2 extension-channel=$3 band=5ghz-a/n/ac width=20 list=WiFi5};
:global CHANCLN do={/interface wireless channels remove [find name~""]};
:global 2GWIFICHAN do={:global 2GCHAN; $2GCHAN chan1 2412 Ce; $2GCHAN chan11 2462 eC};
:global 5GWIFICHAN do={:global 5GCHAN; $5GCHAN chan36 5180 Ceee; $5GCHAN chan44 5220 eeCe; $5GCHAN chan149 5745 Ceee; $5GCHAN chan157 5785 eeCe};
:global WIFION do={:execute {:delay 10; /interface wireless set [find name~""] disabled=no}};
:global CLNUP do={/system script environment remove [find name!=MODE name!=model name!=config]};
$CHANCLN;
$2GWIFICHAN;
$5GWIFICHAN;
$SETWIFI wlan1 2G 2ghz-b/g/n 20/40mhz-XX "WiFi24" 0 256 0,1 15 15;
$SETWIFI wlan2 5G 5ghz-a/n/ac 20/40/80mhz-XXXX "WiFi5" 3 2048 0,1 7 3;
$WIFION;
$CLNUP
}
Hi,
I'm a network engineer at a municipal broadband provider in Western Massachusetts
We have 500 customers and growing by 50 each month
Our network design is fiber to the pole, wireless to the home.
CPE is all mikrotic.
After much struggle I think Ive finally got a good in home wireless configuration!
Here is the script I've been pushing via tr069
Have a group of 25 testers (customers with the worst wifi probs) that are all quite happy now!
I'll gladly explain the tweaks if asked, but generally its: Anything Mikrotik does dynamically it does badly, so find and set a good static value
If you have any suggestions I'd love to hear them before i roll this out widely.
:global model [/system resource get board-name ];
:if (model~"hAP") do={
:local resetwifi do={
:local reset do={
:local wlanMac [/interface wireless get wlan1 mac-address];
:local ssid "REDACTED";
/interface wireless set $1 ssid=($ssid.$2) comment=3.1 mode=ap-bridge wireless-protocol=802.11 station-roaming=disabled wmm-support=enabled distance=indoors multicast-buffering=disabled multicast-helper=disabled frequency=auto security-profile=ap-security-0 wps-mode=disabled disabled=no arp=enabled hw-retries=$9 disconnect-timeout=$10 keepalive-frames=disabled bridge-mode=disabled country="united states3" frequency-mode=regulatory-domain band=$3 channel-width=$4 scan-list=$5 antenna-gain=$6 tx-power-mode=default amsdu-limit=$7 rx-chains=$8 tx-chains=$8;
};
$reset wlan1 2G 2ghz-b/g/n 20/40mhz-Ce 2414,2437,2462 0 256 0,1 15 15;
$reset wlan2 5G 5ghz-a/n/ac 20/40mhz-Ce 5180,5220,5745,5785 0 2048 0,1 7 3;
/interface wireless {set [find name~"wlan"] disabled=yes; :delay 5; set [find name~"wlan"] disabled=no}
};
$resetwifi;
/interface wireless security-profiles set group-key-update=1h management-protection=disabled [find name~""]
}
P.S.
I've seen a lot of folks blaming DHCP for wireless issues. Our hAP's are all in bridge mode, with dhcp upstream.
We faced and (hopefully) solved many of the same issues posted about w/o touching DHCP.....
I should add I also have a tr-069 task to reboot the devices. Apparently downing and upping the interface is not sufficient.
This is primarily tested against 6.42.1, but also confirmed working on 6.40.rc6 and 6.42.rc6