summaryrefslogtreecommitdiff
path: root/docs/configexamples/autotest/OpenVPN_with_LDAP/OpenVPN_with_LDAP.rst
blob: 6666399d4615f3ff1f07257f52698b8439c78aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
.. _examples-OpenVPN-with-LDAP:

#################
OpenVPN with LDAP
#################

| Testdate: 2023-05-11
| Version: 1.4-rolling-202305100734

This LAB shows how to use OpenVPN with a Active Directory authentication method.

Topology consists of:
 * Windows Server 2019 with a running Active Directory
 * VyOS as a OpenVPN Server
 * VyOS as Client

.. image:: _include/topology.png
  :alt: OpenVPN with LDAP topology image

Active Directory on Windows server
==================================

The lab assumes a full running Active Directory on the Windows Server.
Here are some PowerShell commands to quickly add a Test Active Directory.

.. code-block:: powershell

    # install the Active Directory Server role
    Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

    # install the Active Directory Server role
    Install-ADDSForest -DomainName "vyos.local" -DomainNetBiosName "VYOS" -InstallDns:$true -NoRebootCompletion:$true

    # create test user01 and binduser
    New-ADUser binduser -AccountPassword(Read-Host -AsSecureString "Input Password") -Enabled $true
    New-ADUser user01 -AccountPassword(Read-Host -AsSecureString "Input Password") -Enabled $true


Configure VyOS as OpenVPN Server
====================================

In this example OpenVPN will be setup with a client certificate and username / password authentication.

First a CA, a signed server and client ceftificate and a Diffie-Hellman parameter musst be generated and installed.
Please look :ref:`here <configuration/pki/index:pki>` for more information.

| Add the LDAP plugin configuration file `/config/auth/ldap-auth.config`
| Check all possible settings `here <https://github.com/threerings/openvpn-auth-ldap/blob/master/auth-ldap.conf>`_

.. literalinclude:: _include/ldap-auth.config
   :language: none


Now generate all required certificates on the ovpn-server:

First the CA

.. code-block:: none

   vyos@ovpn-server# run generate pki ca install OVPN-CA

after this create a signed server and a client certificate

.. code-block:: none
   
   vyos@ovpn-server# run generate pki certificate sign OVPN-CA install SRV
   vyos@ovpn-server# run generate pki certificate sign OVPN-CA install CLIENT

and last the DH Key

.. code-block:: none

   vyos@ovpn-server# run generate pki dh install DH

after all these steps the config look like this:

.. code-block:: none

      set pki ca OVPN-CA certificate 'MIIFnTCCA4WgAwIBAgIUIPFIXvCxYdavCnSPFNjr6lUtlsswDQYJKoZIhvcNAQELBQAwVzELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcMCVNvbWUtQ2l0eTENMAsGA1UECgwEVnlPUzEQMA4GA1UEAwwHdnlvcy5pbzAeFw0yMzA1MTExMjM4MjJaFw0zMzA1MDgxMjM4MjJaMFcxCzAJBgNVBAYTAkdCMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQHDAlTb21lLUNpdHkxDTALBgNVBAoMBFZ5T1MxEDAOBgNVBAMMB3Z5b3MuaW8wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDg45vAzS6xNqU+Pa7wk1Imt1/az1C22Sbp3wPJLfgOmy0K3TA5qVsx/c/8gatsatMkCsekGnK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hg8ja7Y0g3fQjOSQJ9mqFo7sRoXyYQALD+MDEJOxhnV7neCrgDi1pqnN4xZLoR9DLARp0ad30VIvnv0ay55wxFWAKh2iwNRwyeXIEOtUDBkfcLGSNNfK0kQsos/J8Q+7YXmk4cN9tiVX4xR92edVO4z/vhMkjsGKLSDm/E6EMusX+N0UhQ3dv7qDgeSS8vDsqBm8XJonumNZLvFbYt2ARGRZYL6DUwIBAg=='

Once all the required certificates and keys are installed, the remaining 
OpenVPN Server configuration can be carried out.

.. literalinclude:: _include/ovpn-server.conf
   :language: none

Client configuration
====================

One advantage of having the client certificate stored is the ability to create the client configuration.

.. code-block:: none

   vyos@ovpn-server:~$ generate openvpn client-config interface vtun10 ca OVPN-CA certificate CLIENT

save the output to a file and import it in nearly all openvpn clients.

.. code-block:: none

   client
   nobind
   remote 198.51.100.254 1194
   remote-cert-tls server
   proto udp
   dev tun
   dev-type tun
   persist-key
   persist-tun
   verb 3
   
   # Encryption options
   
   keysize 256
   comp-lzo no
   
   <ca>
   -----BEGIN CERTIFICATE-----
   MIIFnTCCA4WgAwIBAgIUIPFIXvCxYdavCnSPFNjr6lUtlsswDQYJKoZIhvcNAQEL
   BQAwVzELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcM
   CVNvbWUtQ2l0eTENMAsGA1UECgwEVnlPUzEQMA4GA1UEAwwHdnlvcy5pbzAeFw0y
   MzA1MTExMjM4MjJaFw0zMzA1MDgxMjM4MjJaMFcxCzAJBgNVBAYTAkdCMRMwEQYD
   VQQIDApTb21lLVN0YXRlMRIwEAYDVQQHDAlTb21lLUNpdHkxDTALBgNVBAoMBFZ5
   T1MxEDAOBgNVBAMMB3Z5b3MuaW8wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
   AoICAQDg45vAzS6xNqU+Pa7wk1Imt1/az1C22Sbp3wPJLfgOmy0K3TA5qVsx/c/8
   gatsatMkCsekGnK5BPzCDd5eCCLo//B25HFO6f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wYQ1KH
   bHk9wWUwnL1giL71jzp/y4Oj6SSK2PQv+OnO80J6Zg06WIQx9xYcxr108Xh9FotU
   rlG7GYPI3Udf95t6SjuydDhULAVD0lMBxlDe9DHW1k1q1pOXaHZg926tY66xx/ld
   a6dcuwJjA2Dx5JI6L0u9ureQmQAtxvnoTCtf+hR1iX/IkskZCKs34SjNiCnBuw/D
   NfdOpfaABm7y+tWiXBwnu5l/K8poXcQYQByyZj6YMmpgsbVPr5KNsLWOgRA81M6I
   Pof8qxvnFrkazhiQWh1YHSjnaHtA3z5/BdgwHVICuFyrIOlbkKyJOjKcKBsDdMwI
   V0tsnpnyli2xEPZKu1tAQFAavXrK/RGYYhOZ3e0aRSV8hlP8i/mf7p0I45cJiBCq
   Pg==
   -----END CERTIFICATE-----
   
   </ca>
   
   <cert>
   -----BEGIN CERTIFICATE-----
   MIIFsDCCA5igAwIBAgIUSzQgwzGsfJFecGxCwLXVsGCLMkAwDQYJKoZIhvcNAQEL
   BQAwVzELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcM
   CVNvbWUtQ2l0eTENMAsGA1UECgwEVnlPUzEQMA4GA1UEAwwHdnlvcy5pbzAeFw0y
   MzA1MTExMjM4MzlaFw0zMzA1MDgxMjM4MzlaMFYxCzAJBgNVBAYTAkdCMRMwEQYD
   VQQIDApTb21lLVN0YXRlMRIwEAYDVQQHDAlTb21lLUNpdHkxDTALBgNVBAoMBFZ5
   T1MxDzANBgNVBAMMBmNsaWVudDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC
   ggIBANHNJOSwcDbRqziL1gXYnHIq7P7vEUFvS8d/XLYJ1xIpcYTRXTut2CTGRar7
   fZZicu7x0yoK4TzrHvGVf1o4NC4NSGV5RX6kwRdrfWBmvpIkjSLGtCREFyhb+PHD
   pnsIS7cfN9udC0vocqVlx/xM/sfcP6Vja/uFp+9TQcneJIxYw34zkF+TtOVbE3pP
   5VxU7ZAj8F5/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PRsFFHf+r1NyD1lkVI9k2371fTG/Kub9V0rOz4pvKz4Em5b4
   MUPdDbZOqJ8hQ+atGE3ovFJIovA3NFb0OtnyC4l+kG7dfjqFudOnmDa+Qsya+2YO
   xBZBIRfuhlXhb6Y6Smsk9R6x0jBmcQTPS5ZmvKaTxQCFc53xMdQNAswjiI2L9rw4
   BcqQfVmf/vpoN+VusD/XEv2V0Ixm10YybA7BI/tixh9vwj3fdQXVLy3jSYjVBd5W
   OFPizbQZeD10ElvlLqZZyWrP/Wre7Nmi/gEOnhBXXmo034fFF/vXf0JRpQsd2oDs
   24+4XwZYb8mbM31j7Nx8YvhR+64=
   -----END CERTIFICATE-----
   
   </cert>
   
   <key>
   -----BEGIN PRIVATE KEY-----
   MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDRzSTksHA20as4
   i9YF2JxyKuz+7xFBb0vHf1y2CdcSKXGE0V07rdgkxkWq+32WYnLu8dMqCuE86x7x
   lX9aODQuDUhleUV+pMEXa31gZr6SJI0ixrQkRBcoW/jxw6Z7CEu3HzfbnQtL6HKl
   Zcf8TP7H3D+lY2v7hafvU0HJ3iSMWMN+M5Bfk7TlWxN6T+VcVO2QI/Bef6tTjYUz
   HcxuDpeP9JwamX3WANy1Q3kkjSCTReY5Wil1xR89RCUXpk2A8fn+W3wlXCtkLPH1
   PYwhQZQE4zLvTua4JOpzC0cBJyWbmdYI9rVkL8+HvcqOclKn9T1ITq593PNTEZYl
   DRyq/gpMYECWpej9wK96uIn7SYodyvv4+KNfeJkPw7fxLfv0J/w1BZNhQdK0zHEM
   CS0xAM8bU3ZgSXiaYqSDw0dLu1DGSzYf62kPLNxbG2OLmDkbdn+WEJQlR27YeHUW
   vcWvqEW5u3qJjQAiG1n5C4eQc7ndfqiH3QTGSmmW539BxHrh9CeSwSXqL2vBD8Vm
   2DCT60R87uYKMJCCpfriMXMvCIjUwPWBKCVaJwo5pa/DRLWEoayFW4nHTDUiN6Tk
   EetDBYZB8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YdLaIlDMqZk1R
   unLuikCAWni86dvtMEU0qFi0E5Ovp7jWWWNE4CnYSyAzgy3oBssyoG74AQp8addX
   k/3zAoIBAQC8/7DglQGMcKnk4zX+7jCuc0p+qMcd5RdnfBKlRhcWYNRPup9jyDef
   dkXCBTumCHXrIil/rJzP6b1IZZdC4xkheQpLXNUcceAidRWIrTypaXKkmhR0D74u
   ckGiLXB4S84HYmIdw89ZiF0gB0yyZH5mZnqVMojwnGmWqcM2sr2N44bNQMfhD+nC
   SgQmReYKKfMQCdvYMxRLQfseU0pFEOGnh9jAmpn8qWMWxNDmFR/rVl26BXtRPiNP
   imfwWKrYNYhESN7A5/hWcrNUhE4PI+Pjd74npimqs5TDSst2Jc6DiahdaZ6JNNzp
   2PMUXNbfsMCVgZx+qtVNnVxVMiEngPRl
   -----END PRIVATE KEY-----
   
   </key>

Configure VyOS as client
------------------------

.. code-block:: none

   set interfaces openvpn vtun10 authentication username 'user01'
   set interfaces openvpn vtun10 authentication password '$ecret'
   set interfaces openvpn vtun10 encryption cipher 'aes256'
   set interfaces openvpn vtun10 hash 'sha512'
   set interfaces openvpn vtun10 mode 'client'
   set interfaces openvpn vtun10 persistent-tunnel
   set interfaces openvpn vtun10 protocol 'udp'
   set interfaces openvpn vtun10 remote-host '198.51.100.254'
   set interfaces openvpn vtun10 remote-port '1194'
   set interfaces openvpn vtun10 tls ca-certificate 'OVPN-CA'
   set interfaces openvpn vtun10 tls certificate 'CLIENT'

Monitoring
==========

If the client is connected successfully you can check the status

.. code-block:: none

   vyos@ovpn-server:~$ show openvpn server
   OpenVPN status on vtun10
   
   Client CN    Remote Host         Tunnel IP    Local Host           TX bytes    RX bytes    Connected Since
   -----------  ------------------  -----------  -------------------  ----------  ----------  -------------------
   client       198.51.100.1:55150  10.23.1.6    198.51.100.254:1194  4.7 KB      4.7 KB      2023-05-11 12:47:11