2008-11-10, 10:36 PM | #1 |
注册日期: 2003-10-22
帖子: 11,053
积分:6
精华:24
现金:14348金币
资产:29325305金币
|
Windows server 2003设置IP安全策略批处理脚本
REM =================开始================ netsh ipsec static ^ add policy name=bim REM 添加2个动作,block和permit netsh ipsec static ^ add filteraction name=Permit action=permit netsh ipsec static ^ add filteraction name=Block action=block REM 首先禁止所有访问 netsh ipsec static ^ add filterlist name=AllAccess netsh ipsec static ^ add filter filterlist=AllAccess srcaddr=Me dstaddr=Any netsh ipsec static ^ add rule name=BlockAllAccess policy=bim filterlist=AllAccess filteraction=Block REM 开放某些IP无限制访问 netsh ipsec static ^ add filterlist name=UnLimitedIP netsh ipsec static ^ add filter filterlist=UnLimitedIP srcaddr=61.128.128.67 dstaddr=Me netsh ipsec static ^ add rule name=AllowUnLimitedIP policy=bim filterlist=UnLimitedIP filteraction=Permit REM 开放某些端口 netsh ipsec static ^ add filterlist name=OpenSomePort netsh ipsec static ^ add filter filterlist=OpenSomePort srcaddr=Any dstaddr=Me dstport=20 protocol=TCP netsh ipsec static ^ add filter filterlist=OpenSomePort srcaddr=Any dstaddr=Me dstport=21 protocol=TCP netsh ipsec static ^ add filter filterlist=OpenSomePort srcaddr=Any dstaddr=Me dstport=80 protocol=TCP netsh ipsec static ^ add filter filterlist=OpenSomePort srcaddr=Any dstaddr=Me dstport=3389 protocol=TCP netsh ipsec static ^ add rule name=AllowOpenSomePort policy=bim filterlist=OpenSomePort filteraction=Permit REM 开放某些ip可以访问某些端口 netsh ipsec static ^ add filterlist name=SomeIPSomePort netsh ipsec static ^ add filter filterlist=SomeIPSomePort srcaddr=Me dstaddr=Any dstport=80 protocol=TCP netsh ipsec static ^ add filter filterlist=SomeIPSomePort srcaddr=61.128.128.68 dstaddr=Me dstport=1433 protocol=TCP netsh ipsec static ^ add rule name=AllowSomeIPSomePort policy=bim filterlist=SomeIPSomePort filteraction=Permit |
|