一、tenlnet测试tcp
[root@test ~]# telnet 192.168.209.121 123 Trying 192.168.209.121… telnet: connect to address 192.168.209.121: Connection refused telnet: Unable to connect to remote host: Connection refused
如上所示,是连接拒绝的情况。证明未监听或被墙 。正常连接的情况类以如下:
#telnet 192.168.209.121 110 +OK Dovecot ready.
上面显示的是一个mail服务器正常连接的情况。
二、nc测试udp端口
安装nc
yum install -y nc
测试
[root@test ~]# nc -vuz 192.168.209.121 123 Connection to 192.168.209.121 123 port [udp/ntp] succeeded!
实际使用时可以只用-u参数,-u代表udp协议 ,-v代表详细模式,-z代表只监测端口不发送数据。
以上就是
为各位朋友分享的 相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多 等着你!