I have a PC running a web server on port 8080, and SSHd running on port 22. In my router settings, I have forwarded port 8080 to 80, and set up an ANAME record on my domain pointing to the public IP. I am able to access my site on both my public IP port 80 and on my domain. However, I am not able to access the port using the private IP, or SSH into the PC. The PC has a static IP configured. How can I fix this?
Edit: per use request, the output of
ss -tulpn on the server is:
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=799,fd=5)) tcp LISTEN 0 511 *:8443 *:* users:(("node",pid=1251,fd=21)) tcp LISTEN 0 511 *:8080 *:* users:(("node",pid=1251,fd=20)) tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=799,fd=7))
And the relevent output of
nmap -sV -Pn <server ip> on the client is:
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.3 (protocol 2.0) 8080/tcp open http Node.js (Express middleware) 8443/tcp open ssl/http Node.js (Express middleware)
Edit: network sketch:
Edit: additional issue, probably should have mentioned earlier: For a short time after booting up the server, I am able to interact with it. However, if I wait more than a few hours, or reboot my laptop, then the server appears dead to my computer.
Edit: Something weird: I set up a continuous ping on the server to the client (in fish,
ping <client> & disown), and now I can access the server normally. Don't know what to make of this...