Most companies disable telnet due to security policy. This article provides alternate methods to perform and capture network communications tests.
Any
There are a number of ways that one can test network communications to validate port connectivity.
[root@machine tmp]# nc -zv machine.example.com 7523
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connected to <IP_MASKED>:7523.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
[root@machine 12.3]# nc -zv machine.example.com 7523
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connection refused.
* Rebuilt URL to: telnet://machine.example.com:7523/
* Trying <IP_MASKED>...
* TCP_NODELAY set
* Connected to machine.mycompany.net (IP_MASKED) port 7523 (#0)
[root@machine 12.3]# curl -v telnet://machine.example.com:7523
* Rebuilt URL to: telnet://machine.example.com:7523/
* Trying <IP_MASKED>..
* TCP_NODELAY set
* connect to <IP_MASKED> port 7523 failed: Connection refused
* Failed to connect to machine.example.com port 7523: Connection refused
* Closing connection 0
curl: (7) Failed to connect to machine.example.com port 7523: Connection refused
[root@machine tmp]# cat </dev/null >/dev/tcp/machine.example.com/7523; echo $?
0
[root@machine tmp]# cat </dev/null >/dev/tcp/machine.example.com/7523; echo $?
1
PS C:\Users\Administrator> Test-NetConnection -ComputerName machine.example.com -port 7523
ComputerName : machine.example.com
RemoteAddress : <IP_MASKED>
RemotePort : 7523
InterfaceAlias : xxxxxxxxxxxxx
SourceAddress : <IP_MASKED>
TcpTestSucceeded : True
PS C:\Users\Administrator> Test-NetConnection -ComputerName machine.example.com -port 7523
WARNING: TCP connect to (<IP_MASKED> : 7523) failed
ComputerName : machine.example.com
RemoteAddress : <IP_MASKED>
RemotePort : 7523
InterfaceAlias : xxxxxxxxxxxxx
SourceAddress : <IP_MASKED>
PingSucceeded : True
PingReplyDetails (RTT) : 1 ms
TcpTestSucceeded : False