macos环境测试远程端口是否通

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了macos环境测试远程端口是否通相关的知识,希望对你有一定的参考价值。

ping端口:nc -vz -w 2 www.baidu.com 8080

NAME
nc -- arbitrary TCP and UDP connections and listens

DESCRIPTION
The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet(1) does with some.

 -v      details
 -z      Specifies that nc should just scan for listening daemons, without sending any data to them.  It is an error to use this option in conjunction with the -l option.
     -w     timeout

     主机和端口号不能缺失

以上是关于macos环境测试远程端口是否通的主要内容,如果未能解决你的问题,请参考以下文章

公网使用SSH远程登录macOS服务器内网穿透

windows打开telnet,查看断开是否通

MacBook安装telnet工具和使用

本机与远程主机指定端口的网络是否连通

检测服务器端口是否被封(墙)

配置Hybrid端口