AREDN hAP MikroTik – Enabling DtD ports

Updated – 9/19/2023 – N7UF – Modified step 11.

How to enable Device-to-Device on more ports then just port 5 of the hAP Mikrotik device flashed with AREDN firmware.

Why? I have multiple external antennas that are both connected to my hAP device. This device connects to my home LAN via wifi client and also provides a localized wifi network so I may connect to the mesh system with a laptop, tablet, or other device wirelessly.

This assumes you have already flashed the proper firmware and have configured your nodes – but the second antenna didn’t just work when you plugged it in to your hAP device on ports 1-4.

This device is specifically called out on the AREDN github page –
“The Mikrotik hAP AC Lite, Ubiquiti AirRouter, and AirRouter HP are pre-configured with the following VLANs:

  • Port 1: WAN Port – Packets in/out of this port are expected to be untagged. The node is (by default) configured to receive a DHCP assigned address from a home network, internet, or other foreign network.
  • Port 5: DtDLink Port Mesh Routing — Connect to another mesh node or 8021.q switch. Packets in/out of this port must be vlan 2 tagged, other packets are ignored.
  • Ports 2-4: LAN devices — Packets in/out of this port are expected to be untagged. The mesh node will (default) DHCP assign an IP address to your computer, ipCam, voip phone, etc. connected to these ports.”

This explains that only the port labeled 5 will work automatically with a DtD connection. At the time of this writing, no GUI configuration is available to adjust the configuration to allow other ports on the device to act the same as port 5.

How to enable DtD ports

  1. Get a SSH application, I used PuTTY
  2. Connect your computer to your devices LAN port not intended to be used as a DtD port – or wifi.
  3. Open a new SSH session to your node on port 2222
  4. Accept the security keys
  5. Login with your root username and password
  6. Edit the file, I used vi: /etc/aredn_include/swconfig
  7. The port numbers in the configuration are reverse for this device specifically
  8. My intention was to enable DtD on LAN port 4 of my device
  9. REMOVE – 2 from the vlan 0 option ports
  10. ADD – 2t to the vlan 2 option ports
  11. Reboot device In the GUI click Save and Reboot. (Without this step the swconfig doesn’t seem to be applied)
  12. Plug in second node to port 4 on your hAP device
  13. Validate through your mesh node that the DtD devices are now connected

A screenshot of the original file and modification are below:

Original Configuration

Depending on your need, additional ports can be enabled by following the same procedure with different port identifiers. Remember, on this device port 1 in the configuration is labeled as port 5 on the device. The numbering is reversed!

Nick N7UF