telnet to azure vm port from outside

4.9k Views Asked by At

I want to telnet virtual machine on port 1234. I have server.exe running on vm which listens to port 1234.

When I run telnet within virtual machine cmd "telnet 127.0.0.1 1234" response is

"ok"

However when I run telnet from outside using "telnet publicIP 1234" response is

Connecting To publicIP...Could not open connection to the host, on port 1234: Connect failed

I have added endpoints in azure portal and tried switching off the firewall from both virtual machine and my local machine.

Can anyone please suggest?

1

There are 1 best solutions below

0
On

Two things to consider:

  1. Make sure that your server.exe listens also the VM network adapter, but not only on 127.0.0.1
  2. Make sure that your ISP( Internet Provider) does not block outgoing ports - very common issue.

To avoid (2) change the public port for the VM Endpoint to 80 and try with telnet publicIP 80

To make sure you comply with (1), while on the VM try telnet **localIP** 1234