端口上打开防火墙,Test-NetConnection 失败

ram*_*sof 5 windows powershell networking windows-firewall

奇怪的行为,我正在我的家庭服务器 PC 上配置 Kafka 代理,并尝试通过 wifi 从另一台计算机进行连接。使用以下命令在 9092 上打开防火墙端口

netsh advfirewall 防火墙添加规则名称 =“TCP 端口 9092”dir = 操作 = 允许协议 = TCP 本地端口 = 9092

但是,当我尝试使用 Test-NetConnection 测试端口连接时,它失败了。我无法连接到 Windows 防火墙设置中配置为打开的任何端口,不知道为什么。我在客户端和服务器上禁用了 ipv6

PS C:\Users\ram> Test-NetConnection 10.58.35.113 -Port 9092 -Verbose
WARNING: TCP connect to (10.58.35.113 : 9092) failed
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = QueryIsolationType,'className'
 = MSFT_NetAddressFilter,'namespaceName' = root\standardcimv2'.
VERBOSE: Operation 'Invoke CimMethod' complete.


ComputerName           : 10.58.35.113
RemoteAddress          : 10.58.35.113
RemotePort             : 9092
InterfaceAlias         : Wi-Fi
SourceAddress          : 10.58.35.134
PingSucceeded          : True
PingReplyDetails (RTT) : 1 ms
TcpTestSucceeded       : False
Run Code Online (Sandbox Code Playgroud)

更新

Kafka 代理在 Windows Linux 子系统中运行,因此出现这种奇怪的行为。当我在窗口测试网络连接成功安装kafka代理时