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

时间:2021-02-24 07:20:12

标签: windows powershell networking windows-firewall

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

<块引用>

netsh advfirewall firewall add rule name="TCP Port 9092" dir=in 动作=允许协议=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

更新

Kafka 代理在 windows linux 子系统中运行,因此出现这种奇怪的行为。当我在窗口 Test-Netconnection 上安装 kafka 代理时成功

0 个答案:

没有答案