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

推荐订阅源

腾讯CDC
Schneier on Security
Schneier on Security
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
A
About on SuperTechFans
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
V2EX - 技术
V2EX - 技术
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
V
Visual Studio Blog
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
Scott Helme
Scott Helme
H
Heimdal Security Blog
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Vulnerabilities – Threatpost
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Troy Hunt's Blog
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
Jina AI
Jina AI
S
Securelist
小众软件
小众软件
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
AWS News Blog
AWS News Blog
N
News and Events Feed by Topic
博客园 - 三生石上(FineUI控件)
量子位

博客园 - 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退出测试。