Skip to content

Commit cbef907

Browse files
authored
Merge pull request #197976 from cherylmc/openvpn
Openvpn
2 parents 8f1c6a8 + 8bee071 commit cbef907

File tree

14 files changed

+213
-156
lines changed

14 files changed

+213
-156
lines changed
Binary file not shown.
Binary file not shown.
Lines changed: 6 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,24 @@
11
---
2-
title: include file
3-
description: include file
4-
services: vpn-gateway
52
author: cherylmc
63
ms.service: vpn-gateway
74
ms.topic: include
8-
ms.date: 1/3/2021
5+
ms.date: 05/12/2022
96
ms.author: cherylmc
10-
ms.custom: include file
117

128
#Customer intent: this file is used for both virtual wan and vpn gateway articles.
139
---
1410
## <a name="windows"></a>Windows clients
1511

16-
1. Download and install the OpenVPN client (version 2.4 or higher) from the official [OpenVPN website](https://openvpn.net/index.php/open-source/downloads.html).
17-
2. Download the VPN client profile package from the Azure portal, or use the 'New-AzVpnClientConfiguration' cmdlet in PowerShell.
18-
3. Unzip the profile. Next, open the *vpnconfig.ovpn* configuration file from the OpenVPN folder using Notepad.
19-
4. Export the point-to-site client certificate you created and uploaded. Use the following article links:
12+
[!INCLUDE [This include is for Windows clients.](vpn-gateway-vwan-config-openvpn-windows.md)]
2013

21-
* [VPN Gateway](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md#clientexport) instructions
22-
23-
* [Virtual WAN](../articles/virtual-wan/certificates-point-to-site.md#clientexport) instructions
24-
5. Extract the private key and the base64 thumbprint from the *.pfx*. There are multiple ways to do this. Using OpenSSL on your machine is one way. The *profileinfo.txt* file contains the private key and the thumbprint for the CA and the Client certificate. Be sure to use the thumbprint of the client certificate.
14+
## <a name="macOS"></a>macOS clients
2515

26-
```
27-
openssl pkcs12 -in "filename.pfx" -nodes -out "profileinfo.txt"
28-
```
29-
6. Switch to the *vpnconfig.ovpn* file you opened in Notepad from step 3. Fill in the section between `<cert>` and `</cert>`, getting the values for `$CLIENT_CERTIFICATE`, `$INTERMEDIATE_CERTIFICATE`, and `$ROOT_CERTIFICATE` as shown below.
16+
[!INCLUDE [This include is for macOS clients.](vpn-gateway-vwan-config-openvpn-mac.md)]
3017

31-
```
32-
# P2S client certificate
33-
# please fill this field with a PEM formatted cert
34-
<cert>
35-
$CLIENT_CERTIFICATE
36-
$INTERMEDIATE_CERTIFICATE (optional)
37-
$ROOT_CERTIFICATE
38-
</cert>
39-
```
40-
41-
- Open *profileinfo.txt* from the previous step in Notepad. You can identify each certificate by looking at the `subject=` line. For example, if your child certificate is called P2SChildCert, your client certificate will be after the `subject=CN = P2SChildCert` attribute.
42-
- For each certificate in the chain, copy the text (including and between) "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----".
43-
- Only include an `$INTERMEDIATE_CERTIFICATE` value if you have an intermediate certificate in your *profileinfo.txt* file.
44-
7. Open the *profileinfo.txt* in Notepad. To get the private key, select the text (including and between) "-----BEGIN PRIVATE KEY-----" and "-----END PRIVATE KEY-----" and copy it.
45-
8. Go back to the vpnconfig.ovpn file in Notepad and find this section. Paste the private key replacing everything between and `<key>` and `</key>`.
46-
47-
```
48-
# P2S client root certificate private key
49-
# please fill this field with a PEM formatted key
50-
<key>
51-
$PRIVATEKEY
52-
</key>
53-
```
54-
9. Do not change any other fields. Use the filled in configuration in client input to connect to the VPN.
55-
10. Copy the vpnconfig.ovpn file to C:\Program Files\OpenVPN\config folder.
56-
11. Right-click the OpenVPN icon in the system tray and click connect.
57-
58-
## <a name="mac"></a>Mac clients
59-
60-
1. Download and install an OpenVPN client, such as [TunnelBlick](https://tunnelblick.net/downloads.html).
61-
2. Download the VPN client profile package from the Azure portal, or use the 'New-AzVpnClientConfiguration' cmdlet in PowerShell.
62-
3. Unzip the profile. Open the vpnconfig.ovpn configuration file from the OpenVPN folder in a text editor.
63-
4. Fill in the P2S client certificate section with the P2S client certificate public key in base64. In a PEM formatted certificate, you can open the .cer file and copy over the base64 key between the certificate headers. Use the following article links for information about how to export a certificate to get the encoded public key:
64-
65-
* [VPN Gateway](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md#cer) instructions
66-
67-
* [Virtual WAN](../articles/virtual-wan/certificates-point-to-site.md#cer) instructions
68-
5. Fill in the private key section with the P2S client certificate private key in base64. See the [Export your private key](https://openvpn.net/community-resources/how-to/#pki) on the OpenVPN site for information about how to extract a private key.
69-
6. Do not change any other fields. Use the filled in configuration in client input to connect to the VPN.
70-
7. Double-click the profile file to create the profile in Tunnelblick.
71-
8. Launch Tunnelblick from the applications folder.
72-
9. Click on the Tunnelblick icon in the system tray and pick connect.
73-
74-
> [!IMPORTANT]
75-
>Only iOS 11.0 and above and MacOS 10.13 and above are supported with OpenVPN protocol.
76-
>
7718
## <a name="iOS"></a>iOS clients
7819

79-
1. Install the OpenVPN client (version 2.4 or higher) from the App store.
80-
2. Download the VPN client profile package from the Azure portal, or use the 'New-AzVpnClientConfiguration' cmdlet in PowerShell.
81-
3. Unzip the profile. Open the vpnconfig.ovpn configuration file from the OpenVPN folder in a text editor.
82-
4. Fill in the P2S client certificate section with the P2S client certificate public key in base64. In a PEM formatted certificate, you can open the .cer file and copy over the base64 key between the certificate headers. Use the following article links for information about how to export a certificate to get the encoded public key:
83-
84-
* [VPN Gateway](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md#cer) instructions
85-
86-
* [Virtual WAN](../articles/virtual-wan/certificates-point-to-site.md#cer) instructions
87-
5. Fill in the private key section with the P2S client certificate private key in base64. See [Export your private key](https://openvpn.net/community-resources/how-to/#pki) on the OpenVPN site for information about how to extract a private key.
88-
6. Do not change any other fields.
89-
7. E-mail the profile file (.ovpn) to your email account that is configured in the mail app on your iPhone.
90-
8. Open the e-mail in the mail app on the iPhone, and tap the attached file
91-
92-
![Open email](./media/vpn-gateway-vwan-config-openvpn-clients/ios2.png)
93-
94-
9. Tap on **More** if you do not see **Copy to OpenVPN** option
95-
96-
![More](./media/vpn-gateway-vwan-config-openvpn-clients/ios3.png)
97-
98-
10. Tap on **Copy to OpenVPN**
99-
100-
![Copy to OpenVPN](./media/vpn-gateway-vwan-config-openvpn-clients/ios4.png)
101-
102-
11. Tap on **ADD** in the **Import Profile** page
103-
104-
![Add](./media/vpn-gateway-vwan-config-openvpn-clients/ios5.png)
105-
106-
12. Tap on **ADD** in the **Imported Profile** page
107-
108-
![Tap ADD](./media/vpn-gateway-vwan-config-openvpn-clients/ios6.png)
109-
110-
13. Launch the OpenVPN app and slide the switch in the **Profile** page right to connect
111-
112-
![Connect](./media/vpn-gateway-vwan-config-openvpn-clients/ios8.png)
113-
20+
[!INCLUDE [This include is for iOS clients.](vpn-gateway-vwan-config-openvpn-ios.md)]
11421

11522
## <a name="linux"></a>Linux clients
11623

117-
1. Open a new Terminal session. You can open a new session by pressing 'Ctrl + Alt + t' at the same time.
118-
2. Enter the following command to install needed components:
119-
120-
```
121-
sudo apt-get install openvpn
122-
sudo apt-get -y install network-manager-openvpn
123-
sudo service network-manager restart
124-
```
125-
3. Download the VPN profile for the gateway. This can be done from the Point-to-site configuration tab in the Azure portal.
126-
4. Export the P2S client certificate you created and uploaded to your P2S configuration on the gateway. Use the following article links:
127-
128-
* [VPN Gateway](../articles/vpn-gateway/vpn-gateway-certificates-point-to-site.md#clientexport) instructions
129-
130-
* [Virtual WAN](../articles/virtual-wan/certificates-point-to-site.md#clientexport) instructions
131-
5. Extract the private key and the base64 thumbprint from the .pfx. There are multiple ways to do this. Using OpenSSL on your computer is one way.
132-
133-
```
134-
openssl pkcs12 -in "filename.pfx" -nodes -out "profileinfo.txt"
135-
```
136-
The *profileinfo.txt* file will contain the private key and the thumbprint for the CA, and the Client certificate. Be sure to use the thumbprint of the client certificate.
137-
138-
6. Open *profileinfo.txt* in a text editor. To get the thumbprint of the client (child) certificate, select the text including and between "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" for the child certificate and copy it. You can identify the child certificate by looking at the subject=/ line.
139-
140-
7. Open the *vpnconfig.ovpn* file and find the section shown below. Replace everything between the and "cert" and "/cert".
141-
142-
```
143-
# P2S client certificate
144-
# please fill this field with a PEM formatted cert
145-
<cert>
146-
$CLIENTCERTIFICATE
147-
</cert>
148-
```
149-
8. Open the profileinfo.txt in a text editor. To get the private key, select the text including and between "-----BEGIN PRIVATE KEY-----" and "-----END PRIVATE KEY-----" and copy it.
150-
151-
9. Open the vpnconfig.ovpn file in a text editor and find this section. Paste the private key replacing everything between and "key" and "/key".
152-
153-
```
154-
# P2S client root certificate private key
155-
# please fill this field with a PEM formatted key
156-
<key>
157-
$PRIVATEKEY
158-
</key>
159-
```
160-
161-
10. Do not change any other fields. Use the filled in configuration in client input to connect to the VPN.
162-
11. To connect using the command line, type the following command:
163-
164-
```
165-
sudo openvpn --config <name and path of your VPN profile file>&
166-
```
167-
12. To connect using the GUI, go to system settings.
168-
13. Click **+** to add a new VPN connection.
169-
14. Under **Add VPN**, pick **Import from file…**
170-
15. Browse to the profile file and double-click or pick **Open**.
171-
16. Click **Add** on the **Add VPN** window.
172-
173-
![Import from file](./media/vpn-gateway-vwan-config-openvpn-clients/import.png)
174-
17. You can connect by turning the VPN **ON** on the **Network Settings** page, or under the network icon in the system tray.
24+
[!INCLUDE [This include is for Linux clients.](vpn-gateway-vwan-config-openvpn-linux.md)]

0 commit comments

Comments
 (0)