Port blocked “refused to connect” or is not listening
Port is open (but is rejected for various reasons because it is not a web browser port)
Port blocked or not listening
Port open but rejected
Port blocked or not listening
Port Open
Output a new blank command line or message “connection reset by peer” if the port is open; Output “Connection refused” if the port is closed.
Port is open
[root@foglight /]# nc 192.168.1.48 8080 < /dev/null
[root@foglight /]#
[root@foglight /]# nc 192.168.1.48 135 < /dev/null
[root@foglight /]#
[root@foglight /]# nc 192.168.1.41 1521 < /dev/null
[root@foglight /]#
“Connection refused” if the port is closed.
[root@foglight /]# nc 192.168.1.48 8081 < /dev/null
Ncat: Connection refused.
Port is open
[root@Foglight2 orauser]# nc -vz 192.168.1.215 135 < /dev/null
Connection to 192.168.1.215 135 port [tcp/epmap] succeeded!
[root@Foglight2 orauser]# nc -vz 192.168.1.216 1521 < /dev/null
Connection to 192.168.1.216 1521 port [tcp/ncube-lm] succeeded!
Construct an HTTP URI from the hostname and port as the first argument to curl. If curl can connect, it will report a protocol mismatch and exit (if the listener isn't a web service). If curlcannot connect, it will time out.
This is a blocked port either closed or blocked by a firewall
[root@foglight /]# curl 192.168.1.48:8081
curl: (7) Failed connect to 192.168.1.48:8081; Connection refused
For example a PI repository is running on this remote server
[root@foglight /]# curl 192.168.1.48:5029
curl: (56) Recv failure: Connection reset by peer
This is an open FMS webpage, there is no error and a new command line entry is displayed
[root@foglight /]# curl 192.168.1.48:8080
[root@foglight /]#
This is open Windows RPC port, this will establish a connection. Use Ctrl-C to end the connection
[root@foglight /]# curl 192.168.1.48:135
^C
[root@foglight /]#
This is an open SQL Server port
[root@foglight /]# curl 192.168.1.50:1433
curl: (52) Empty reply from server
This is an open Oracle port
[root@foglight /]# curl 192.168.1.41:1521
curl: (52) Empty reply from server
This is an open local port
[root@foglight /]# echo > /dev/tcp/localhost/80 && echo Port Open || echo Port closed
-bash: connect: Connection refused
-bash: /dev/tcp/localhost/80: Connection refused
Port closed
This is a closed local port
[root@foglight /]# echo > /dev/tcp/localhost/22 && echo Port Open || echo Port closed
Port Open
PS C:\Users\foglight> Get-Host
Name : ConsoleHost
Version : 5.1.16299.98
InstanceId : 011f9552-8ce6-46a6-a7a6-8e61c7e37b46
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
This is an open port
TcpTestSucceeded : True
This is a closed port
PS C:\WINDOWS\system32> test-netconnection -computername 192.168.1.48 -port 8081
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center