Linux之——udp端口测试连接

转载请注明出处:https://blog.csdn.net/l1028386804/article/details/80677289

一、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代表只监测端口不发送数据。


猜你喜欢

转载自blog.csdn.net/l1028386804/article/details/80677289
今日推荐