惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - Caraxes

共享打印机的另一种方式 手动部署MySQL Exporter实战 Windows屏幕字体锯齿化的调整 Windows轻量级WebDAV服务器搭建 解决一个mysql数据库连接打开慢的问题记录 Mysql 赋予用户访问单表SELECT权限 UNIX换行和DOS换行的批量转换 Centos Mysql 8.0.43安装 关闭windows 更新驱动程序的方法 CentOS7下OpenSSH10.0p2升级实践 特殊符号的输入 tomcat启动一次问题的处理。 如何禁用键盘左侧Win键 Windows设置分页文件到D盘无效的解决方法 npm中文站的映射 使用ffmpeg批量生成视频的缩略图 解决内网HTTP由NG转发HTTPS后,部分跳转还是HTTP的问题 Linux LVM方式管理磁盘 Vscode Debug乱码的问题修复 一个切换不同JAVA版本的方法 ffmpeg提取音频 GO应用WINDOWS下添加程序图标 Linux 证书文件查看参考 批量查看HTTPS的SSL证书的有效期脚本 Linux系统下安装Java环境 修改Jar包里面的配置文件
简易防火墙映射测试
哥伦布 · 2026-06-25 · via 博客园 - Caraxes

概述

在 Linux / Windows / macOS 上都常用的、用来验证端口映射(NAT/防火墙端口转发)是否成功的 TCP 和 UDP 测试工具如下:
Windows环境:netcat
Linux环境:nc

安装环境

Windows

Windows下,下载安装:Nmap 下载地址:https://nmap.org/download.html
安装后 ncat.exe一般在:C:\Program Files (x86)\Nmap\ncat.exe
建议把 Nmap 目录加入 PATH,下面示例直接用 ncat

Linux

sudo yum install -y nc
或者
sudo apt install -y netcat-openbsd

对应的命令

Windows环境ncat命令

服务端

TCP服务端,示例端口6000
ncat -l 6000
UDP服务端,示例端口6000
ncat -u -l 6000

客户端

TCP客户端,示例访问IP:110.27.5.231:6000
ncat 110.27.5.231 6000
UDP客户端,示例访问IP:110.27.5.231:6000
ncat -u 110.27.5.231 6000

Linux环境nc命令

服务端

TCP服务端,示例端口6000
nc -l 6000
UDP服务端,示例端口6000
nc-u -l 6000

客户端

TCP客户端,示例访问IP:110.27.5.231:6000
nc 110.27.5.231 6000
UDP客户端,示例访问IP:110.27.5.231:6000
nc-u 110.27.5.231 6000

测试过程

  1. 连接如果不成功,会提示 Connection refused
  2. 连接成功后,不会有任何显示。在客户端、服务端任意输入内容,按下回车后,会发送到对端并显示。
  3. 按Ctrl+C退出测试。