I set up ssh to my laptop at home by allowing the firewall to do ssh to it and it worked fine for a couple of days. A few days later, I couldn’t ping or ssh anymore.
After trying different things, I found out that this modem Motorola NVG510 has a defect. While it was initially doing DNS well, i.e. associating the laptop’s hostname with it’s NAT IP, sometimes it goes crazy. Now it calls my laptop something else with a hostname that I have idea where it came from. The dynamic IP is the same.
Because the firewall was set up to allow ssh to port 22 to a specific hostname, when the modem lost the laptop’s hostname, it wouldn’t relay the ssh connection correctly anymore.
What seems to be working now is to set up Default server (Firewall -> IP passthrough). I set it up to the dynamic IP of my laptop, hoping the NAT IP won’t change. I guess I could try to set up a static IP.
I may buy a decent router and set up the modem to bridge mode.