Thanks again for the comments, and sorry for my late reply. This solution works!
After changing rc.local, I initially could only connect via the local IP but had trouble when using the External IP. But it was because I did not configure port forwarding properly on my Linksys WiFi router. I followed the instructions here:
https://www.linksys.com/us/support-article?articleNum=138535
(This is likely a very amateurish mistake, but I’m writing it just in case it is useful to anyone.)
Still one caveat is that
sudo /etc/NX/nxserver –upnpstatus
still gives nothing. Namely, the output is
Local IP
Gateway IP
External IP
But connecting with NoMachine works regardless.
Thanks again for the help!