Linux nc 測試 UDP 有沒有通

本篇 ShengYu 將介紹如何使用 Linux 下的 nc 指令網路診斷工具來檢查UDP有沒有通。

範例. 測試檢查 UDP 有沒有通

測試 UDP 封包到有沒有通

1
nc -z -v -u <ip> <port>

參數說明
-z zero io mode
-v verbose
-u UDP mode

範例. 檢查 1-65535 port 有開哪些 UDP port

檢查伺服器 1-65535 port 有開哪些 UDP port

1
nc -vnzu 192.168.1.8 1-65535

其他參考
How to Test Port [TCP/UDP] Connectivity from a Linux Server – The Geek Diary
https://www.thegeekdiary.com/how-to-test-porttcp-udp-connectivity-from-a-linux-server/
centos - Testing UDP port connectivity - Server Fault
https://serverfault.com/questions/416205/testing-udp-port-connectivity
Netcat(Linux nc 指令)網路管理者工具實用範例 - G. T. Wang
https://blog.gtwang.org/linux/linux-utility-netcat-examples/

其它相關文章推薦
Linux 常用指令教學懶人包
Linux sed 字串取代用法與範例
Linux find 尋找檔案/尋找資料夾用法與範例
Linux cut 字串處理用法與範例
Linux tail 持續監看檔案輸出用法與範例
Linux grep/ack/ag 搜尋字串用法與範例
Linux tee 同時螢幕標準輸出和輸出到檔案用法與範例
Linux xargs 參數列表轉換用法與範例
Linux du 查詢硬碟剩餘空間/資料夾容量用法與範例
Linux wget 下載檔案用法與範例