This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
linux:ubuntu:openvpn [2018/02/20 18:21] – lunetikk | linux:ubuntu:openvpn [2018/02/21 13:49] – lunetikk | ||
---|---|---|---|
Line 57: | Line 57: | ||
</ | </ | ||
- | Build the cert | + | Build the cert, if asked say " |
< | < | ||
- | < | + | Copy your cert and keys |
+ | < | ||
+ | |||
+ | and start the service | ||
+ | < | ||
+ | |||
+ | ==== Create client certificate ==== | ||
+ | |||
+ | execute the following, if asked say " | ||
+ | < | ||
+ | |||
+ | copy the client sampleconfig | ||
+ | < | ||
+ | |||
+ | edit "/ | ||
+ | < | ||
+ | remote YOUROPENVPNSERVER 1194 | ||
+ | |||
+ | #use these on qnap, make sure they exist | ||
+ | user nobody | ||
+ | group everyone | ||
+ | |||
+ | #comment the 3 lines | ||
+ | #ca ca.crt | ||
+ | #cert client.crt | ||
+ | #key client.key | ||
+ | |||
+ | #at the end of the file, add your ca, client-cert and client-key | ||
+ | < | ||
+ | -----BEGIN CERTIFICATE----- | ||
+ | ... | ||
+ | -----END CERTIFICATE----- | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Certificate: | ||
+ | ... | ||
+ | -----END CERTIFICATE----- | ||
+ | ... | ||
+ | -----END CERTIFICATE----- | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | -----BEGIN PRIVATE KEY----- | ||
+ | ... | ||
+ | -----END PRIVATE KEY----- | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Connecting the QNAP via OpenVPN ===== | ||
+ | |||
+ | Edit the file "/ | ||
+ | < | ||
+ | [OPENVPN_CLIENT1] | ||
+ | Enable = TRUE | ||
+ | Status = 1 | ||
+ | Index = 1 | ||
+ | Gateway = 0 | ||
+ | Allow Connect = 0 | ||
+ | Reconnect = 1 | ||
+ | Server Address = lunetikk.de | ||
+ | Profile File = OpenVPN4 | ||
+ | VPN Proto Type = udp | ||
+ | VPN Port = 1194 | ||
+ | Compress = 1 | ||
+ | Re-direct gateway = 1 | ||
+ | Encryption = 1 | ||
+ | AccessCode = AAA | ||
+ | Time Stamp = 0 | ||
+ | </ | ||
+ | |||
+ | Start your client (parameter 1 is the index in your config) | ||
+ | < | ||
+ | |||
+ | Check if your connection is up with ifconfig and ping your gateway (openvpn server) | ||
+ | < | ||
+ | # ifconfig | ||
+ | tun0 Link encap: | ||
+ | inet Adresse: | ||
+ | |||
+ | # ping 10.8.0.1 | ||
+ | PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data. | ||
+ | 64 bytes from 10.8.0.1: icmp_seq=1 ttl=64 time=38.6 ms | ||
+ | 64 bytes from 10.8.0.1: icmp_seq=2 ttl=64 time=37.9 ms | ||
+ | </ | ||
- | < | ||
- | < |