|
| 1 | +# maxslug's Mikrotik Networking Configuration Files |
| 2 | + |
| 3 | +[!WARNING] |
| 4 | +This is old, for RouterOS version 6 (circa 2020). Please see https://github.com/maxslug/mikrotik_maxslug for the latest and greatest. |
| 5 | + |
| 6 | +<!-- Someday github will catch up to gitlab and support Mermaid --> |
| 7 | + |
| 8 | + |
| 9 | +This repo is to hold my configuration files for a complex home network based on |
| 10 | +Mikrotik networking gear. Thank you to all the mikrotik forum posters for all |
| 11 | +this knowledge and hard work, especially `pcunite`! |
| 12 | + |
| 13 | +To discuss this please join us here : https://forum.mikrotik.com/viewtopic.php?f=13&t=166330 |
| 14 | + |
| 15 | +## Design Goals |
| 16 | + |
| 17 | +### WAN |
| 18 | + |
| 19 | +- Dual ISPs with auto-failover |
| 20 | +- Complete removal of AT&T router ("residential gateway") from the picture |
| 21 | + |
| 22 | +### L1 |
| 23 | + |
| 24 | +- Disaggregation of routing and wifi into separate solutions |
| 25 | +- Switched managed Ethernet |
| 26 | +- Redundancy |
| 27 | +- Power over Ethernet to allow centralized UPS |
| 28 | + |
| 29 | +### L2 / L3 |
| 30 | + |
| 31 | +- VLAN separation of Guest, Primary, IOT, Neighbor, and VOIP networks |
| 32 | + |
| 33 | +### Wireless |
| 34 | + |
| 35 | +- Centrally managed access points |
| 36 | +- Roaming / Hand-off imrovements |
| 37 | +- Higher overlapping coverage at lower radio power rates |
| 38 | + |
| 39 | +### L4+ |
| 40 | + |
| 41 | +- Port Forwarding over VLAN |
| 42 | +- Secure DNS |
| 43 | + |
| 44 | +## Nework Design |
| 45 | + |
| 46 | +These are notes to go along with the config files |
| 47 | + |
| 48 | +### Inventory |
| 49 | + |
| 50 | +- 1 x Mikrotik RB4011iGS+ Router using RouterOS 6.47.3 |
| 51 | +- 2 x Mikrotik CRS109-8G-1S-2HnD Router/Switch/APs running RouterOS 6.47.3 |
| 52 | +- 3 x Mikrotik cAP AC (RBcAPGi-5acD2nD) using RouterOS 6.47.3 |
| 53 | + |
| 54 | +### VLANs |
| 55 | + |
| 56 | +VLAN |IP |Usage |
| 57 | +------|------------------|----------------- |
| 58 | + 100 |192.168.100.0/24 |Base / Management |
| 59 | + 200 |192.168.120.0/24 |Normal LAN |
| 60 | + 300 |192.168.130.0/24 |Guest / IOT |
| 61 | + 400 |192.168.140.0/24 |VOIP |
| 62 | + 500 |192.168.150.0/24 |Neighbor |
| 63 | + |
| 64 | +- For each subnet addresses `.1` through `.39` are reserved for static IP assignment. `.1` is the router. |
| 65 | +- The WAN ports are not on VLANs |
| 66 | +- Once configured, you will need to make a port be on `VLAN 100` to use WinBox. |
| 67 | + |
| 68 | +### Printing |
| 69 | + |
| 70 | +- ZeroConf / mDNS / Apple Bonjour (AirPrint) cannot be forwarded across subnets / VLANs. |
| 71 | + - You will only get to auto-discover the printer from one VLAN, I chose guest where the school tablets will be |
| 72 | +- The printer ports for a Lexmark Laser printer are forwarded from the main VLAN to the guest VLAN where the printer is |
| 73 | + |
| 74 | +### Router |
| 75 | + |
| 76 | +- `192.168.100.1` |
| 77 | + |
| 78 | + |
| 79 | +- The EAP Authentication protocol requires a set system clock. DHCP requires EAP. NTP requies DHCP. This means you can't set the clock over the internet |
| 80 | +because of a chicken-n-egg problem. Make sure `mikro1.rsc` is modified with the current time before programming it. Or, if you have a local NTP server, use that. |
| 81 | +- You will need to coax your authentication keys out of your AT&T gateway so you can run in `supplicant mode`. |
| 82 | +- DNS is setup to use DNS over HTTP (DOH) which requires some certificates and hurdles. |
| 83 | + |
| 84 | +### Switches |
| 85 | + |
| 86 | +I was really only interested in an 8-port managed GigE switch, but for the same price these units include a 2G WiFi radio. |
| 87 | + |
| 88 | +- `192.168.100.2` |
| 89 | +- `192.168.100.3` (config not included) |
| 90 | + |
| 91 | + |
| 92 | +- The radio in the switches are not part of CapsMAN |
| 93 | +- I create a "backup" SSID out of these that should work if I need to hookup the old router, or if for some other reason CapsMAN fails. |
| 94 | +- One of the APs is chained off of `sw1` due to physical topology |
| 95 | + |
| 96 | +### Access Points |
| 97 | + |
| 98 | +- `192.168.100.11` |
| 99 | +- `192.168.100.12` (config not included) |
| 100 | +- `192.168.100.13` (config not included) |
| 101 | + |
| 102 | +Despite what the Mikrotik documentation says, you cannot fully remotely provision these. You will need to create a config file and add it to the AP. |
| 103 | +After that, the wireless definitions will be automatic, but not the base config and security! |
| 104 | + |
| 105 | +- `/system reset-configuration run-after-reset=wap.rsc` does not seem to work. I still had to manually load the file after reset |
| 106 | +- Resetting into CAP mode (hold reset button till it gets to it's second mode after blinking) is a better starting point |
| 107 | +- Certificates will be auto-provisioned by CapsMAN |
| 108 | +- Whenever you do a `/system reset-configuration` on the router, it doesn't have the ability of saving the certificate keys, |
| 109 | +so unless you are managing your certificates outside of RouterOS, you'll need to clear the certs on EACH access point |
| 110 | + - `/interface wireless cap set enabled=no` |
| 111 | + - `/certificate print` |
| 112 | + - `/certificate remove numbers=1,0` |
| 113 | + - `/interface wireless cap set enabled=yes` |
| 114 | +- Spectral Scan and other cool tools are not supported by the cAP AC (or other 802.11ac products) |
| 115 | +- You need to assign all channels manually, up to and including inputting all the frequencies. It's really strange that this isn't done |
| 116 | + for you based on your country setting. See below. |
| 117 | +- I scripted the mode button so that it will toggle the LEDs between "always on" and "turn off after 1h" |
| 118 | + |
| 119 | +#### 802.11ac Band Planning |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +Here is a diagram I put together to understand the 802.11ac channel assignment |
| 124 | + |
| 125 | +- DFS is the middle part of the spectral sandwich which requires fancy driver support and regulatory signoff |
| 126 | +- DFS is not supported w/ the cAP AC, at least not for the ones locked to `united states3` region. As far as I can tell. |
| 127 | +- 802.11ac requires 80MHz channels, made up of 4 x 20MHz channels |
| 128 | +- For any given 80 MHz chunk, there are 4 possible assignments, depending on which one you make the control channel |
| 129 | + - This is what gives you the `Ceee` `eCee` `eeCe` `eeeC` "walking ones" pattern. I tried to depict this above |
| 130 | + - I only defined the channels that worked for my region |
| 131 | +- I use WiFi analyzer (Windows, Android) to do a survey of least-busy bands at each AP physical location |
| 132 | + |
| 133 | + |
| 134 | +#### cAP AP Wireless Features |
| 135 | + |
| 136 | +They are lacking on the software-based features like MIMO, DFS, Beam Forming, |
| 137 | +Handoff Protocols, Spectral Scan etc. |
| 138 | + |
| 139 | +Mikrotik runs their own driver, and it seems to be developed in the 802.11n |
| 140 | +era. The chipsets in these devices support these features, but they are not |
| 141 | +enabled. If I had to guess, I would say it's probably a mixture of licensing |
| 142 | +from the chipset vendor, mountains of software development, and regulatory |
| 143 | +issues that make it difficult for Mirkotik. |
| 144 | + |
| 145 | +It's not a deal breaker, I'm still getting great performance. |
| 146 | + |
| 147 | +One promising recent development is the porting of OpenWRT to these devices. |
| 148 | +I'll probably do this once the dust settles, even though it will mean losing |
| 149 | +CAPSMan, which I happen to enjoy. |
| 150 | + |
| 151 | +## References |
| 152 | + |
| 153 | +These are not in any particular order, but all my knowledge came from these, so |
| 154 | +Thank You!! |
| 155 | + |
| 156 | +### config |
| 157 | + |
| 158 | +- https://wiki.mikrotik.com/wiki/Manual:Configuration_Management |
| 159 | +- https://help.mikrotik.com/docs/display/ROS/First+Time+Configuration |
| 160 | + |
| 161 | +### Security |
| 162 | + |
| 163 | +- https://mum.mikrotik.com/presentations/UK18/presentation_6165_1539151116.pdf |
| 164 | + |
| 165 | +### CAPSman |
| 166 | + |
| 167 | +- https://wiki.mikrotik.com/wiki/Manual:CAPsMAN_with_VLANs |
| 168 | +- https://wiki.mikrotik.com/wiki/Manual:Simple_CAPsMAN_setup |
| 169 | +- https://forum.mikrotik.com/viewtopic.php?t=152188 |
| 170 | +- https://wiki.mikrotik.com/wiki/Manual:CAPsMAN_tips |
| 171 | +- https://mum.mikrotik.com/presentations/BR14/Uldis.pdf |
| 172 | +- https://forum.mikrotik.com/viewtopic.php?t=158379 |
| 173 | +- https://www.reddit.com/r/mikrotik/comments/cltszm/trouble_getting_vlan_working_on_cap_man/ |
| 174 | +- https://forum.mikrotik.com/viewtopic.php?t=155429 |
| 175 | +- https://www.gonscak.sk/?p=575 |
| 176 | + |
| 177 | +### Wifi Channel Planning / 802.11ac / CapsMAN |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | +- https://forum.mikrotik.com/viewtopic.php?t=136476 |
| 190 | +- https://forum.mikrotik.com/viewtopic.php?t=125026 |
| 191 | +- https://wiki.mikrotik.com/wiki/Manual:Spectral_scan |
| 192 | +- https://forum.mikrotik.com/viewtopic.php?t=150463 |
| 193 | +- https://forum.mikrotik.com/viewtopic.php?f=7&t=149815&p=737784#p737784 |
| 194 | +- http://www.revolutionwifi.net/revolutionwifi/2013/03/80211ac-channel-planning.html |
| 195 | +- https://netbeez.net/blog/dfs-channels-wifi/ |
| 196 | +- https://en.wikipedia.org/wiki/IEEE_802.11ac |
| 197 | +- https://en.wikipedia.org/wiki/List_of_WLAN_channels#5_GHz_or_5.9_GHz_(802.11a/h/j/n/ac/ax) |
| 198 | +- http://www.revolutionwifi.net/revolutionwifi/2013/03/safely-using-80-mhz-channels-with.html |
| 199 | +- https://systemzone.net/mikrotik-wifi-frequency-band-and-channel-width-explanation/ |
| 200 | + |
| 201 | +### band steering |
| 202 | + |
| 203 | +- https://forum.mikrotik.com/viewtopic.php?t=127742 |
| 204 | +- https://forum.mikrotik.com/viewtopic.php?t=132817 |
| 205 | +- https://forum.openwrt.org/t/mikrotik-cap-ac-support/57828/28 |
| 206 | +- https://github.com/openwrt/openwrt/pull/3037 |
| 207 | + |
| 208 | +### vlans |
| 209 | + |
| 210 | +- https://forum.mikrotik.com/viewtopic.php?t=143620 |
| 211 | +- https://forum.mikrotik.com/viewtopic.php?t=155266 |
| 212 | +- https://forum.mikrotik.com/viewtopic.php?t=163650 |
| 213 | +- https://forum.mikrotik.com/viewtopic.php?t=160224 |
| 214 | + |
| 215 | +### The Dude |
| 216 | + |
| 217 | +- https://mikrotik.com/thedude |
| 218 | +- https://wiki.mikrotik.com/wiki/Manual:The_Dude |
| 219 | + |
| 220 | +### EAP auth |
| 221 | + |
| 222 | +- https://forum.mikrotik.com/viewtopic.php?t=154954 |
| 223 | + |
| 224 | +### Bridging |
| 225 | + |
| 226 | +- https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge |
| 227 | + |
| 228 | +### failover / balancing |
| 229 | + |
| 230 | +- https://wiki.mikrotik.com/wiki/Load_Balancing |
| 231 | +- https://forum.mikrotik.com/viewtopic.php?t=93222 |
| 232 | +- https://forum.mikrotik.com/viewtopic.php?f=23&t=157048 |
| 233 | + |
| 234 | +### secure DNS |
| 235 | + |
| 236 | +- https://forum.mikrotik.com/viewtopic.php?t=164078 |
| 237 | +- https://wiki.mikrotik.com/wiki/Manual:IP/DNS#DNS_over_HTTPS |
| 238 | + |
| 239 | +### Printer sharing |
| 240 | + |
| 241 | +- https://forum.mikrotik.com/viewtopic.php?t=110540 |
| 242 | +- https://forum.mikrotik.com/viewtopic.php?t=145765 |
| 243 | + |
| 244 | +### port forwarding |
| 245 | + |
| 246 | +- https://forum.mikrotik.com/viewtopic.php?f=2&t=112861&p=817432#p817432 |
| 247 | +- https://forum.mikrotik.com/viewtopic.php?t=130022 |
0 commit comments