1. Network Security Tools Netsh IPsec

Source: Internet
Author: User
Tags remove filter

1. The basic process of IPSec composition and Operation

IP Security Policy list: composed of multiple IP security policies

IP Security Policy: consists of one or more rules

Rule: Consists of an IP filter list and a corresponding filter action

IP Filter list: consists of one or more IP filters

Filter action: Permit or block


Action Flow: Create an IP Security policy--Create a filter action--Create an IP filter List--Create a policy rule--Activate IP Security Policy


2. Complete example

REM emptying strategy

netsh ipsec static del all


REM Create IP Security Policy

netsh ipsec static add policy name=myipsec


REM Create filter action (block and permit)

netsh ipsec static add filteraction name=permit Action=permit

netsh ipsec static add filteraction name=block Action=block


REM first disables all access (Create IP filter lists, create policy rules)

netsh ipsec static add filterlist name=allaccess

netsh ipsec static add filter filterlist=allaccess Srcaddr=me dstaddr=any mirrored=yes

netsh ipsec static add rule name=blockallaccess policy=myipsec filterlist=allaccess Filteraction=block


REM Open some IP unrestricted access (Create IP filter list, create policy rule)

netsh ipsec static add filterlist Name=unlimitedip

netsh ipsec static add filter Filterlist=unlimitedip srcaddr=192.168.120.83 dstaddr=me mirrored=yes

netsh ipsec static add rule Name=allowunlimitedip policy=myipsec filterlist=unlimitedip Filteraction=permit


REM Open Some ports (Create IP filter list, create policy rule)

netsh ipsec static add filterlist Name=opensomeport

netsh ipsec static add filter filterlist=opensomeport srcaddr=any dstaddr=me dstport=3389 protocol=tcp mirrored=yes

netsh ipsec static add rule name=allowopensomeport policy=myipsec filterlist=opensomeport Filteraction=permit


REM open Some IPs can access certain ports (create IP filter lists, create policy rules)

netsh ipsec static add filterlist Name=someipsomeport

netsh ipsec static add filter filterlist=someipsomeport srcaddr=me dstaddr=any protocol=icmp mirrored=yes

netsh ipsec static add filter filterlist=someipsomeport srcaddr=me dstaddr=any dstport=80 protocol=tcp mirrored=yes

netsh ipsec static add filter filterlist=someipsomeport srcaddr=me dstaddr=any dstport=443 protocol=tcp mirrored=yes

netsh ipsec static add filter filterlist=someipsomeport srcaddr=me dstaddr=any dstport=53 protocol=tcp mirrored=yes

netsh ipsec static add filter filterlist=someipsomeport srcaddr=me dstaddr=any dstport=53 protocol=udp mirrored=yes

netsh ipsec static add rule name=allowsomeipsomeport policy=myipsec filterlist=someipsomeport Filteraction=permit


REM Activation IP Security Policy

netsh ipsec static set policy Name=myipsec assign=y


REM ================= End ================



3. Operation Supplement


Delete Rule

netsh ipsec static del rule name=blockallaccess policy=myipsec

Remove filter List

netsh ipsec static add filterlist name=allaccess

Export policy

netsh ipsec static exportpolicy file=d:\myipsec.ipsec

Import Policy

netsh ipsec static importpolicy file=d:\myipsec.ipsc


1. Network Security Tools Netsh IPsec

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.