check the output of "show ubnt offload" ... it should show that "hwnat" is enabled (if it's not --> configure / set system offload hwnat enable / commit / save / exit).
In addition, same device is doing the speedtest "directly through the modem" and "through the ER-X" right?