Site Tools


linux:ubuntu:openvpn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
linux:ubuntu:openvpn [2018/02/21 13:49] lunetikklinux:ubuntu:openvpn [2019/01/21 12:57] lunetikk
Line 109: Line 109:
 </code> </code>
  
-===== Connecting the QNAP via OpenVPN =====+===== Connecting QNAP as client =====
  
 Edit the file "/etc/config/vpn.conf" and add the following Edit the file "/etc/config/vpn.conf" and add the following
Line 134: Line 134:
 <code>/etc/init.d/vpn_openvpn_client.sh start 1 &</code> <code>/etc/init.d/vpn_openvpn_client.sh start 1 &</code>
  
-Check if your connection is up with ifconfig and ping your gateway (openvpn server)+Check if your connection is up with ifconfig and ping your gateway (OpenVPN server)
 <code> <code>
 # ifconfig # ifconfig
Line 146: Line 146:
 </code> </code>
  
 +===== Connecting an Ubuntu 16 as client =====
  
 +Install the client
 +<code>
 +apt-get update
 +apt-get install openvpn
 +</code>
 +
 +Copy the .ovpn file from your server to your client into /etc/openvpn/ \\
 +Rename it to .conf, for example client.conf
 +<code>
 +mv client.ovpn client.conf
 +</code>
 +
 +If you run OpenVPN with systemd you need to configure your configfiles in "/etc/default/openvpn"
 +Add your filename (client) if you only want the single file to be recognized, add "all" if you want any .conf files to be loaded
 +<code>
 +AUTOSTART="client"
 +#or
 +AUTOSTART="all"</code>
 +
 +Reload the "/etc/default/" configs
 +systemctl daemon-reload 
 +
 +Restart the OpenVPN 
 +<code>systemctl restart openvpn</code>
 +
 +Check if your connection is up with ifconfig and ping your gateway (OpenVPN server)
 +<code>
 +# ifconfig
 +tun0      Link encap:UNSPEC  Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
 +          inet Adresse:10.8.0.6  P-z-P:10.8.0.2  Maske:255.255.255.255
 +
 +# 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
 +</code>
 +
 +===== Raspbian 9 as client =====
 +
 +Install the client
 +<code>
 +apt-get update
 +apt-get install openvpn
 +</code>
 +
 +Copy the .ovpn file from your server to your client into /etc/openvpn/client/ \\
 +Rename it to .conf, for example client.conf
 +<code>
 +mv client.ovpn client.conf
 +</code>
 +
 +If you run OpenVPN with systemd you need to configure your configfiles in "/etc/default/openvpn"
 +Add your filename (client) if you only want the single file to be recognized, add "all" if you want any .conf files to be loaded
 +<code>
 +AUTOSTART="client"
 +#or
 +AUTOSTART="all"</code>
 +
 +Reload the "/etc/default/" configs
 +systemctl daemon-reload 
 +
 +Restart the OpenVPN 
 +<code>systemctl restart openvpn</code>
 +
 +Check if your connection is up with ifconfig and ping your gateway (OpenVPN server)
 +<code>
 +# ifconfig
 +tun0      Link encap:UNSPEC  Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
 +          inet Adresse:10.8.0.6  P-z-P:10.8.0.2  Maske:255.255.255.255
 +
 +# 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
 +</code>
linux/ubuntu/openvpn.txt · Last modified: 2021/05/14 17:14 by lunetikk