端口 1194 — OpenVPN (UDP)
什么是端口 1194?
OpenVPN 安全隧道的默认端口。
这是注册端口(1024–49151),常分配给 OpenVPN 等服务。 · IANA registered (no formal RFC); uses TLS (RFC 8446)
什么情况下需要开放端口 1194?
Open if you are hosting an OpenVPN server for remote access or site-to-site VPN tunnels. Not required if your VPN uses WireGuard (port 51820) or IKEv2/IPsec instead.
常见用途与软件
- OpenVPN Community Edition
- OpenVPN Access Server
- pfSense
- OPNsense
- DD-WRT
- Tunnelblick (macOS client)
安全
Use certificate-based authentication rather than username/passwords alone. Keep OpenVPN server and clients updated — check changelogs for CVEs. Use AES-256-GCM cipher and TLS 1.2+ for the control channel. Restrict access to port 1194 to known client IPs where possible. Consider enabling TLS auth HMAC on tls-auth to reject unauthorised handshakes.
端口 1194 安全吗?
开放端口会增加攻击面。安全性取决于 OpenVPN 的配置。
风险低,但在将其保持开放之前,请确认 OpenVPN 是否有意在此端口运行,以及您的应用程序是否确实需要它。
测试任意主机的端口 1194 连通性。
开放端口 1194
要允许到端口 1194 (OpenVPN) 的入站连接,请配置防火墙并在路由器上添加端口转发规则,指向设备的本地 IP 地址。
打开 Windows Defender 防火墙 → 高级设置 → 入站规则 → 新建规则 → 端口 → UDP → 特定本地端口: 1194 → 允许连接 → 命名并保存规则。
netsh advfirewall firewall add rule name="Open Port 1194" dir=in action=allow protocol=udp localport=1194sudo ufw allow 1194/udpsudo iptables -A INPUT -p udp --dport 1194 -j ACCEPT登录路由器(192.168.1.1 或 192.168.0.1)→ 端口转发 → 添加新规则: 协议 UDP, 外部端口 1194, 内部 IP: 设备的本地 IP, 内部端口 1194 → 保存。
如何关闭端口 1194
若不需要 OpenVPN,请在防火墙或路由器中阻止该端口。
要在 Windows 上屏蔽端口 1194,请以管理员身份在 PowerShell 或命令提示符中运行以下命令:
netsh advfirewall firewall add rule name="Block Port 1194" dir=in action=block protocol=udp localport=1194执行:sudo ufw deny 1194/udpsudo iptables -A INPUT -p udp --dport 1194 -j DROP删除或禁用端口 1194 的端口转发规则。
常见问题
端口 1194 用于什么?▾
1194 端口是 OpenVPN 的标准 UDP 端口。它被需要接受该服务入站连接的服务器和应用程序所使用。是否需要开放取决于您是否在运行 OpenVPN 服务器——如果没有,应保持关闭。
保持端口 1194 打开安全吗?▾
开放的 1194 端口会扩大攻击面。如果您没有主动运行 OpenVPN,请在防火墙中关闭此端口并删除端口转发规则。如果 OpenVPN 需要可访问,请将访问限制为已知 IP 地址并保持软件更新。