安全工具netsh IPSec使用方法[ip安全策略]

2019-09-19 06:51:25王旭

Netsh IPsec static add policy name = APU安全策略
echo 创建筛选器是阻止的操作
Netsh IPsec static add filteraction name = 阻止 action = block
echo 创建筛选器是允许的操作
Netsh IPsec static add filteraction name = 允许 action = permit
echo 建立一个筛选器可以访问的终端列表
Netsh IPsec static add filterlist name = 可访问的终端列表
Netsh IPsec static add filter filterlist = 可访问的终端列表 srcaddr = 203.86.32.248 dstaddr = me dstport = 3389 description = 部门1访问 protocol = TCP mirrored = yes
echo 建立一个筛选器可以访问的终端列表
Netsh ipsec static add filter filterlist = 可访问的终端列表 Srcaddr = 203.86.31.0 srcmask=255.255.255.0 dstaddr = 60.190.145.9 dstport = 0 description = 部门2访问 protocol =any mirrored = yes
echo 建立策略规则
Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = APU安全策略 filterlist = 可访问的终端列表 filteraction = 阻止
echo 激活策略
netsh ipsec static set policy name = APU安全策略 assign = y
pause

或者

Netsh ipsec static add policy name = 默认策略名称
pause
Netsh ipsec static add filteraction name = 阻止操作 action = block
pause
Netsh ipsec static add filteraction name = 允许操作 action = permit
pause
Netsh ipsec static add filterlist name = 访问列表
pause
Netsh ipsec static add filterlist name = 阻止列表
pause
Netsh ipsec static add filter filterlist = 访问列表1 srcaddr = 203.86.32.248 dstaddr = me dstport = 3389 description = 部门1访问 protocol = TCP mirrored = yes
pause
Netsh ipsec static add filter filterlist = 访问列表2 srcaddr = 203.86.31.0 srcmask = 255.255.255.0 dstaddr = 60.190.145.9 dstport = 0 description = 部门2访问 protocol = any mirrored = yes
pause
Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = 默认策略名称 filterlist = 访问列表1 filteraction = 阻止操作
pause
Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = 默认策略名称 filterlist = 访问列表2 filteraction = 阻止操作
pause
netsh ipsec static set policy name = 默认策略名称 assign = y
pause

[以下是转载未经过测试,百度上都可以找的到。]

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 ^
相关文章 大家在看