Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2003 : Monitoring Network Protocol Security (part 6) - Use Netsh to Manage IPSec

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/24/2011 6:32:36 PM
Exercise 3: Use Netsh to Manage IPSec

Any task you can perform with the IP Security Policy snap-in and the IP Security Monitor snap-in, you can do with the Netsh command. You can also perform tasks with Netsh that you cannot do from a console, such as the following: instituting computer startup security, performing computer startup traffic exemptions, running diagnostics, performing default traffic exemptions, performing strong CRL checking, performing IKE (Oakley) logging, modifying logging intervals, and creating a persistent policy.

You create policies by configuring IKE parameters and adding rules that are composed of filter lists, filter actions, and other configuration parameters. In the following exercise, the commands create an IPSec policy to negotiate telnet security between Computer1 and Computer2 and to block telnet from any computer other than Computer2. You must create a policy at both Computer1 and Computer2. You can do so, as the exercise suggests, one command at a time. Alternatively, you could build a batch file and run it to implement the policy.

When using the Netsh command, this method, of course, would be the preferred way to do so in the real world. Each command in the step-by-step exercise is followed by pressing the Enter key. Figure 11-35 shows the commands to create the policy on Computer2 (steps 2 through 5), as entered at the Netsh IPSec Static command line. If you receive an error message, correct your syntax. If you need to start all over again, you can delete the policy with the command Delete Policy Name=Telnet.

Figure 26. Creating a policy with Netsh


1.
Enter the Netsh IPSec Static context by entering the following commands:

Netsh
Netsh>ipsec static

2.
Create a policy on Computer1 by entering the following command:

Add policy name="telnet"
description="only allow negotiated telnet from computer2 to computer1"
activatedefaultrule=no mmsecmethods="3DES-MD5-3"

This policy needs two rules. One blocks all telnet communications and the other negotiates telnet from Computer2 to Computer1. To add the rules, you must first add the filter list, its filters, and a filter action. If you create a filter for a filter list that doesn’t exist, the filter list is created.

3.
To create a filter list with one filter that triggers on telnet and a source IP address of 192.168.0.2 (Computer2), type the following command:

Add filter filterlist="telnet computer2"
srcaddr=192.168.0.2 dstaddr=Me description="computer2 telnet to computer1"
protocol=TCP mirrored=yes srcmask=32 dstmask=32 srcport=0 dstport=23

4.
Type the following command to add a filter action to negotiate telnet from Computer2 to Computer1:

Add filteraction name="negotiate computer2 telnet"
qmpfs=no inpass=no soft=no action=negotiate qmsecmethods="ESP[3DES,MD5]"

5.
Add the rule that will manage telnet negotiation by typing this command:

Add rule name="telnetN" policy="telnet" filterlist="telnet computer2"
filteraction="negotiate computer2 telnet"
Kerberos=yes description="this rule negotiates telnet if the source computer is
computer2"



Note that the rule ties the filter list and the filter action and selects the authentication method. If no authentication method is specified, Kerberos is used by default.

6.
Prepare the filter list and filter action for the second rule. Create a filter list with one filter that triggers on telnet and blocks telnet from all computers:

Add filter filterlist="blocktelnet"
srcaddr=Any dstaddr=Me description="all telnet to computer1"
protocol=TCP mirrored=yes srcmask=24 dstmask=24 srcport=0 dstport=23

7.
Add a filter action to block all telnet communications:

Add filteraction name="block all telnet" inpass=yes action=block

8.
Add a rule that will manage this telnet negotiation:

Add rule name="telnetN" policy="telnet" filterlist="blocktelnet"
filteraction="block all telnet"
Kerberos=yes description="this rule negotiates telnet if the source computer is
computer2"



9.
Assign the policy:

set policy name=telnet assign=yes

10.
On Computer 2, log on as Administrator and open a command prompt.

11.
Open Netsh.

On Computer2, a single filter list, filter, and filter action are necessary. You are providing it the means to negotiate the telnet connection with Computer1. First, create the policy.

12.
Type the following command:

Add policy name="telnet"
description="only allow negotiated telnet to computer1 from computer2"
activatedefaultrule=no mmsecmethods="3DES-MD5-3"

13.
Next, create the filter list:

Add filter filterlist="telnet computer1"
srcaddr=Me dstaddr=192.168.0.2 description="computer2 telnet to computer1"
protocol=TCP mirrored=yes srcmask=32 dstmask=32 srcport=0 dstport=23

14.
Next, create the filter action:

Add filteraction name="negotiate computer2 telnet"
qmpfs=no inpass=no soft=no action=negotiate

15.
Then add the rule that will manage telnet negotiation:

Add rule name="telnetN" policy="telnet" filterlist = "telnet computer1"
filteraction="negotiate computer2 telnet"
Kerberos=yes description="this rule negotiates telnet to computer1"

16.
Finally, assign the policy. Remember, only one policy can be active at a time. You must run this command at both computers.

set policy name=telnet assign=yes

17.
Close Netsh.
Other -----------------
- Windows Server 2003 : Monitoring Network Protocol Security (part 1) - Understanding IPSec & Negotiation Configuration
- SharePoint 2010 : Getting to Know the Excel Services Service Application
- Using Windows PowerShell in an Exchange Server 2010 Environment : Managing Cmdlets
- Using Windows PowerShell in an Exchange Server 2010 Environment : Creating Your Own Scripts
- Windows Server 2008 R2 : Installing Windows Deployment Services (part 3)
- Windows Server 2008 R2 : Installing Windows Deployment Services (part 2)
- Windows Server 2008 R2 : Installing Windows Deployment Services (part 1) - Configuring the WDS Server
- Windows Server 2008 R2 Windows Deployment Services
- Windows Server 2008 R2 Administration Tools for Desktops : Operating System Deployment Options
- Windows Server 2008 R2 Administration Tools for Desktops : Managing Desktops and Servers
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server