Skip to content

Commit 3bb8575

Browse files
committed
update
1 parent 6d7ed1e commit 3bb8575

File tree

4 files changed

+64
-36
lines changed

4 files changed

+64
-36
lines changed

articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to create a self-signed root certificate, export a public
55
author: cherylmc
66
ms.service: vpn-gateway
77
ms.topic: how-to
8-
ms.date: 07/06/2022
8+
ms.date: 08/04/2023
99
ms.author: cherylmc
1010

1111
---

articles/vpn-gateway/vpn-gateway-howto-point-to-site-rm-ps.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.custom: devx-track-azurepowershell
1212
---
1313
# Configure server settings for P2S VPN certificate authentication - PowerShell
1414

15-
This article helps you configure a point-to-site (P2S) VPN to securely connect individual clients running Windows, Linux, or macOS to an Azure virtual network (VNet). P2S VPN connections are useful when you want to connect to your VNet from a remote location, such when you're telecommuting from home or a conference.
15+
This article helps you configure a point-to-site (P2S) VPN to securely connect individual clients running Windows, Linux, or macOS to an Azure virtual network (VNet). P2S VPN connections are useful when you want to connect to your VNet from a remote location, such when you're telecommuting from home or a conference.
1616

1717
You can also use P2S instead of a Site-to-Site VPN when you have only a few clients that need to connect to a VNet. P2S connections don't require a VPN device or a public-facing IP address. P2S creates the VPN connection over either SSTP (Secure Socket Tunneling Protocol), or IKEv2.
1818

@@ -125,22 +125,22 @@ In this step, you configure and create the virtual network gateway for your VNet
125125

126126
After the VPN gateway finishes creating, you can add the VPN client address pool. The VPN client address pool is the range from which the VPN clients receive an IP address when connecting. Use a private IP address range that doesn't overlap with the on-premises location that you connect from, or with the VNet that you want to connect to.
127127

128-
Declare the following variables:
128+
1. Declare the following variables:
129129

130-
```azurepowershell-interactive
131-
$VNetName = "VNet1"
132-
$VPNClientAddressPool = "172.16.201.0/24"
133-
$RG = "TestRG1"
134-
$Location = "EastUS"
135-
$GWName = "VNet1GW"
136-
```
130+
```azurepowershell-interactive
131+
$VNetName = "VNet1"
132+
$VPNClientAddressPool = "172.16.201.0/24"
133+
$RG = "TestRG1"
134+
$Location = "EastUS"
135+
$GWName = "VNet1GW"
136+
```
137137

138-
Add the VPN client address pool:
138+
1. Add the VPN client address pool:
139139

140-
```azurepowershell-interactive
141-
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName $RG -Name $GWName
142-
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientAddressPool $VPNClientAddressPool
143-
```
140+
```azurepowershell-interactive
141+
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName $RG -Name $GWName
142+
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientAddressPool $VPNClientAddressPool
143+
```
144144

145145
## <a name="Certificates"></a>Generate certificates
146146

includes/vpn-gateway-generate-export-certificates-include.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ms.topic: include
33
author: cherylmc
44
ms.service: vpn-gateway
5-
ms.date: 05/23/2022
5+
ms.date: 08/04/2023
66
ms.author: cherylmc
77

88
# This include is used for both Virtual WAN and VPN Gateway articles. Any changes you make must apply address both services.
@@ -15,20 +15,29 @@ Use the New-SelfSignedCertificate cmdlet to create a self-signed root certificat
1515
1. From a computer running Windows 10 or later, or Windows Server 2016, open a Windows PowerShell console with elevated privileges. These examples don't work in the Azure Cloud Shell "Try It". You must run these examples locally.
1616
1. Use the following example to create the self-signed root certificate. The following example creates a self-signed root certificate named 'P2SRootCert' that is automatically installed in 'Certificates-Current User\Personal\Certificates'. You can view the certificate by opening *certmgr.msc*, or *Manage User Certificates*.
1717

18-
Run the following example with any necessary modifications.
18+
Run the following example with any necessary modifications. The following certificate includes the 'NotAfter' parameter, which is optional. By default, without this parameter, the certificate expires in 1 year.
1919

2020
```powershell
21-
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
22-
-Subject "CN=P2SRootCert" -KeyExportPolicy Exportable `
23-
-HashAlgorithm sha256 -KeyLength 2048 `
24-
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign
21+
$params = @{
22+
Type = 'Custom'
23+
Subject = 'CN=P2SRootCert'
24+
KeySpec = 'Signature'
25+
KeyExportPolicy = 'Exportable'
26+
KeyUsage = 'CertSign'
27+
KeyUsageProperty = 'Sign'
28+
KeyLength = 2048
29+
HashAlgorithm = 'sha256'
30+
NotAfter = (Get-Date).AddMonths(24)
31+
CertStoreLocation = 'Cert:\CurrentUser\My'
32+
}
33+
New-SelfSignedCertificate @params
2534
```
2635

2736
1. Leave the PowerShell console open and proceed with the next steps to generate a client certificate.
2837

2938
## <a name="clientcert"></a>Generate a client certificate
3039

31-
Each client computer that connects to a VNet using Point-to-Site must have a client certificate installed. You generate a client certificate from the self-signed root certificate, and then export and install the client certificate. If the client certificate isn't installed, authentication fails.
40+
Each client computer that connects to a VNet using Point-to-Site must have a client certificate installed. You generate a client certificate from the self-signed root certificate, and then export and install the client certificate. If the client certificate isn't installed, authentication fails.
3241

3342
The following steps walk you through generating a client certificate from a self-signed root certificate. You may generate multiple client certificates from the same root certificate. When you generate client certificates using the steps below, the client certificate is automatically installed on the computer that you used to generate the certificate. If you want to install a client certificate on another client computer, you can export the certificate.
3443

@@ -38,14 +47,24 @@ The examples use the New-SelfSignedCertificate cmdlet to generate a client certi
3847

3948
Use this example if you haven't closed your PowerShell console after creating the self-signed root certificate. This example continues from the previous section and uses the declared '$cert' variable. If you closed the PowerShell console after creating the self-signed root certificate, or are creating additional client certificates in a new PowerShell console session, use the steps in [Example 2](#ex2).
4049

41-
Modify and run the example to generate a client certificate. If you run the following example without modifying it, the result is a client certificate named 'P2SChildCert'. If you want to name the child certificate something else, modify the CN value. Don't change the TextExtension when running this example. The client certificate that you generate is automatically installed in 'Certificates - Current User\Personal\Certificates' on your computer.
50+
Modify and run the example to generate a client certificate. If you run the following example without modifying it, the result is a client certificate named 'P2SChildCert'. If you want to name the child certificate something else, modify the CN value. Don't change the TextExtension when running this example. The client certificate that you generate is automatically installed in 'Certificates - Current User\Personal\Certificates' on your computer.
4251

4352
```powershell
44-
New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature `
45-
-Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
46-
-HashAlgorithm sha256 -KeyLength 2048 `
47-
-CertStoreLocation "Cert:\CurrentUser\My" `
48-
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
53+
54+
$params = @{
55+
Type = 'Custom'
56+
Subject = 'CN=P2SChildCert'
57+
DnsName = 'P2SChildCert'
58+
KeySpec = 'Signature'
59+
KeyExportPolicy = 'Exportable'
60+
KeyLength = 2048
61+
HashAlgorithm = 'sha256'
62+
NotAfter = (Get-Date).AddMonths(18)
63+
CertStoreLocation = 'Cert:\CurrentUser\My'
64+
TextExtension = @(
65+
'2.5.29.37={text}1.3.6.1.5.5.7.3.2')
66+
}
67+
New-SelfSignedCertificate @params
4968
```
5069

5170
### <a name="ex2"></a>Example 2 - New PowerShell console session
@@ -82,11 +101,20 @@ If you're creating additional client certificates, or aren't using the same Powe
82101
1. Modify and run the example to generate a client certificate. If you run the following example without modifying it, the result is a client certificate named 'P2SChildCert'. If you want to name the child certificate something else, modify the CN value. Don't change the TextExtension when running this example. The client certificate that you generate is automatically installed in 'Certificates - Current User\Personal\Certificates' on your computer.
83102

84103
```powershell
85-
New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature `
86-
-Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
87-
-HashAlgorithm sha256 -KeyLength 2048 `
88-
-CertStoreLocation "Cert:\CurrentUser\My" `
89-
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
104+
$params = @{
105+
Type = 'Custom'
106+
Subject = 'CN=P2SChildCert'
107+
DnsName = 'P2SChildCert1'
108+
KeySpec = 'Signature'
109+
KeyExportPolicy = 'Exportable'
110+
KeyLength = 2048
111+
HashAlgorithm = 'sha256'
112+
NotAfter = (Get-Date).AddMonths(18)
113+
CertStoreLocation = 'Cert:\CurrentUser\My'
114+
TextExtension = @(
115+
'2.5.29.37={text}1.3.6.1.5.5.7.3.2')
116+
}
117+
New-SelfSignedCertificate @params
90118
```
91119

92120
## <a name="cer"></a>Export the root certificate public key (.cer)

includes/vpn-gateway-p2s-rootcert-include.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
ms.topic: include
33
author: cherylmc
44
ms.service: vpn-gateway
5-
ms.date: 05/23/2022
5+
ms.date: 08/04/2023
66
ms.author: cherylmc
77
---
88
Obtain the .cer file for the root certificate. You can use either a root certificate that was generated with an enterprise solution (recommended), or generate a self-signed certificate. After you create the root certificate, export the public certificate data (not the private key) as a Base64 encoded X.509 .cer file. You upload this file later to Azure.
99

1010
* **Enterprise certificate:** If you're using an enterprise solution, you can use your existing certificate chain. Acquire the .cer file for the root certificate that you want to use.
1111
* **Self-signed root certificate:** If you aren't using an enterprise certificate solution, create a self-signed root certificate. Otherwise, the certificates you create won't be compatible with your P2S connections and clients will receive a connection error when they try to connect. You can use Azure PowerShell, MakeCert, or OpenSSL. The steps in the following articles describe how to generate a compatible self-signed root certificate:
1212

13-
* [Windows 10 or later PowerShell instructions](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md): These instructions require Windows 10 or later and PowerShell to generate certificates. Client certificates that are generated from the root certificate can be installed on any supported P2S client.
14-
* [MakeCert instructions](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site-makecert.md): Use MakeCert if you don't have access to a Windows 10 or later computer to use to generate certificates. Although MakeCert is deprecated, you can still use it to generate certificates. Client certificates that you generate from the root certificate can be installed on any supported P2S client.
13+
* [PowerShell instructions for Windows 10 or later](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md): These instructions require PowerShell on a computer running Windows 10 or later. Client certificates that are generated from the root certificate can be installed on any supported P2S client.
14+
* [MakeCert instructions](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site-makecert.md): Use MakeCert to generate certificates if you don't have access to a computer running Windows 10 or later. Although MakeCert is deprecated, you can still use it to generate certificates. Client certificates that you generate from the root certificate can be installed on any supported P2S client.
1515
* [Linux instructions](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site-linux.md).

0 commit comments

Comments
 (0)