打开Windows防火墙以访问来自特定IP地址的所有连接


Answers:


16

假设您要列入白名单的IP地址为192.0.2.55

netsh advfirewall firewall add rule name="Allow from 192.0.2.55" dir=in action=allow protocol=ANY remoteip=192.0.2.55

同样,不要忘记禁用所有其他允许规则,否则连接仍然可以通过它们实现。
杰伊·R.

2

这是如何从Powershell做到这一点

New-NetFirewallRule -Name Allow192.0.2.55 -DisplayName 'Allow from 192.0.2.55' -Enabled True -Direction Inbound -Protocol ANY -Action Allow -Profile ANY -RemoteAddress 192.0.2.55
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.