1. 程式人生 > >測試遠端埠是否開啟

測試遠端埠是否開啟

文章概述:怎樣測試遠端UDP埠,我們一般情況下,應用服務都使用的TCP埠,但是某些情況下,我們需要開啟UDP埠。本文簡要描述怎樣測試UDP埠是否正常?

 

1、用telnet 測試TCP埠是否開啟

[[email protected] ~]# telnet 192.168.0.1 80
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.

這個是通的,表示該埠為開啟狀態。

2.我們使用nc來進行UDP埠測試,如下

[[email protected] ~]# nc -vuz 192.168.0.1 139
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.0.1:139.
Ncat: Connection refused.


[
[email protected]
~]# nc -vuz 192.168.0.1 69 Ncat: Version 7.50 ( https://nmap.org/ncat ) Ncat: Connected to 192.168.0.1:69. Ncat: UDP packet sent successfully Ncat: 1 bytes sent, 0 bytes received in 2.03 seconds.

很明顯,139埠是沒有開放的,但是69埠是開放的。