新建 一个bat文件,复制如下内容到bat文件中,将文件名命名为drop-udp.bat

复制代码 代码如下:
netsh ipsec static add policy name=dropudp
netsh ipsec static add filterlist name=allow-udp
netsh ipsec static add filterlist name=drop-udp

REM 添加筛选器到IP筛选器列表(允许上网)
netsh ipsec static add filter filterlist=allow-udp srcaddr=me dstaddr=any description=dns访问 protocol=udp mirrored=yesdstport=53
netsh ipsec static add filter filterlist=allow-udp srcaddr=me dstaddr=any description=dns访问 protocol=udp mirrored=yesdstport=123
netsh ipsec static add filter filterlist=allow-udp srcaddr=me dstaddr=any description=dns访问 protocol=udp mirrored=yesdstport=161

REM 添加筛选器到IP筛选器列表(不让别人访问)
netsh ipsec static add filter filterlist=drop-udp srcaddr=any dstaddr=me description=别人到我任何访问 protocol=udp mirrored=yes

REM 添加筛选器操作
netsh ipsec static add filteraction name=allow-udp-port action=permit
netsh ipsec static add filteraction name=drop-udp-port action=block

REM 创建一个链接指定 IPSec 策略、筛选器列表和筛选器操作的规则(加入规则到我的安全策略)
netsh ipsec static add rule name=允许规则 policy=dropudp filterlist=allow-udp filteraction=allow-udp-port
netsh ipsec static add rule name=拒绝规则 policy=dropudp filterlist=drop-udp filteraction=drop-udp-port

REM 激活我的安全策略
netsh ipsec static setpolicy name=dropudp assign=y
 

保存后,双击运行即可
udp除53 DNS解析,161 snmp监控端口 及时间同步服务123这三个udp的端口外,禁用所有udp出入站连接

标签:
win2003,禁止,UDP

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“windows 2003 禁止UDP的bat”

暂无“windows 2003 禁止UDP的bat”评论...