samedi 27 décembre 2014

Cannot connect to server through public ip [duplicate]



This question already has an answer here:




Whenever I try to connect to my computer through ssh I get a message:



connection refused


I'm using a Belkin router. Port 22 is forwarded to my private ip address. If I ssh to my private ip address, everything works fine. As soon as I ssh my public ip, it says connection refused.


I thought maybe it wouldn't work publicly if I'm on the local network. So I tried ssh from my phone, and it said connection refused (your device is not listening or connection was explicitly refused)


I thought it was a firewall problem. So I shut down my router firewall, shut down my computer firewall, and put the computer in the DMZ zone in the router. No changes.


I noticed that when I go to whatismyip.com on my Mac mini and macbook, they have the same public ip. After some research, I found that this is normal and that the router NAT is in charge of distributing private ips. I also found that this is the purpose of port forwarding. All queries to port 22 should go to my mac mini's private ip.



Aucun commentaire:

Enregistrer un commentaire