ipsec屏蔽土豆广告 2011.7
@echo off
netsh ipsec static delete all
set ipsec_policy=tudou
set ipsec_filterlistname=tudou ads
set ipsec_actionname=deny
set ip_block_list=119.167.203.
@echo 1 netsh ipsec static add policy name="%ipsec_policy%"
netsh ipsec static add policy name="%ipsec_policy%"
@echo 2 netsh ipsec static add filterlist name="%ipsec_filterlistname%"
netsh ipsec static add filterlist name="%ipsec_filterlistname%"
@echo 3 netsh ipsec static add filteraction name="%ipsec_actionname%" action=block
netsh ipsec static add filteraction name="%ipsec_actionname%" action=block
for /l %%p in (70 1 80 ) do (
@echo add %ip_block_list%%%p to filter list
netsh ipsec static add filter filterlist="%ipsec_filterlistname%" srcaddr=me dstaddr=%ip_block_list%%%p protocol=any mirrored=yes)
@echo 4 netsh ipsec static add rule name="rule1" policy="%ipsec_policy%" filterlist="%ipsec_filterlistname%" filteraction="%ipsec_actionname%"
netsh ipsec static add rule name="rule1" policy="%ipsec_policy%" filterlist="%ipsec_filterlistname%" filteraction="%ipsec_actionname%"
@echo 5 netsh ipsec static set policy name="%ipsec_policy%" assign=y
netsh ipsec static set policy name="%ipsec_policy%" assign=y
pause
:netsh ipsec static delete all
:eof