GoForum › 🌐 V2EX
VibeCoding 了个 无需后台服务的 Windows 极简防火墙 netblock
ghking6 ·
2026-05-26 14:38 ·
0 次点赞 · 0 条回复
特性介绍
AI 友好的命令行接口 直接使用 Windows 底层接口,无需后台服务 不依赖 windows 防火墙,即使防火墙是关的也能生效
使用方法
C:\Windows\System32>netblock.exe -h
netblock <command> [options]
Commands:
add Add a blocking/filtering rule
del Delete rule(s)
list List all rules managed by netblock
Options for 'add':
-n <name> Rule name (for later management; default: auto-generated UUID)
-p <path> Program absolute path (include .exe; default: all programs)
-a <ip/cidr> Remote IP address (IPv4/IPv6, e.g. 192.168.1.1 or 2001:db8::/32)
-l <port|range> Local port (e.g. 80; 8000-9000; 81,82,83; 81,82-85; default: all)
-r <port|range> Remote port (same format as -l; default: all)
-e <block|allow> Action (default: block)
-d <in|out|both> Traffic direction (default: both)
-t Set as temporary rule (default: persistent)
Options for 'del':
-n <name> Delete by rule name (recommended)
-p <path> Delete all rules matching this program path (batch)
Note: 'add' requires at least one filter condition (-p, -a, -l, or -r).
0 条回复
添加回复
你还需要 登录
后发表回复