<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Openvpn on Michael’s Domain</title><link>https://jeltsch.org/en/tags/openvpn/</link><description>Recent content in Openvpn on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/openvpn/index.xml" rel="self" type="application/rss+xml"/><item><title>OpenVPN server on pfsense and client on Ubuntu 16.04</title><link>https://jeltsch.org/en/openvpn_server_on_pfsense_and_client_on_ubuntu_16_04/</link><pubDate>Fri, 02 Nov 2018 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/openvpn_server_on_pfsense_and_client_on_ubuntu_16_04/</guid><description>&lt;p&gt;I have been setting up an 
 &lt;a href="https://openvpn.net" target="_blank" rel="noopener noreferrer nofollow"&gt;OpenVPN&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 server on my 
 &lt;a href="https://www.netgate.com/solutions/pfsense/sg-3100.html" target="_blank" rel="noopener noreferrer nofollow"&gt;Netgate SG-3100 router&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
. I hope this makes syncronizing backups to a physically separate location easier. There are many walkthroughs to set up an OpenVPN server on a 
 &lt;a href="https://www.pfsense.org/" target="_blank" rel="noopener noreferrer nofollow"&gt;pfsense router&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 and that works nicely. However, I am using 
 &lt;a href="https://blog.ubuntu.com/desktop" target="_blank" rel="noopener noreferrer nofollow"&gt;Ubuntu&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 16.04 at work and setting up the client requires a bit more than doing the same on MacOS or Windows. On Ubuntu, it is mandatory to update DNS information manually after establishing the VPN tunnel if you have opted for the setting to route all internet traffic originating from the client through the VPN server. If you do no update the DNA resolver information on the Ubuntu client, you can access the the VPN-internal network (in my case 10.0.0.0/24), but you cannot use hostnames. E.g. ping 
 &lt;a href="https://www.google.com" target="_blank" rel="noopener noreferrer nofollow"&gt;www.google.com&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 will fail, but ping 172.217.21.164 will succeed. Similarly, your browser will not find any URLs. And browsing with IP-addresses (&amp;ldquo;http://172.217.21.164&amp;rdquo;) is not very practical.The default configuration on Ubuntu does not allow for this update of the DNS resolver to happen automatically for security reasons. There is a script included in the 
 &lt;a href="https://packages.ubuntu.com/search?keywords=openvpn" target="_blank" rel="noopener noreferrer nofollow"&gt;Ubuntu package of openvpn&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 that updates this information (/etc/openvpn/update-resolv-conf). But in order for this to work one needs to&lt;/p&gt;</description></item><item><title>How to start openvpn or ssh server under Ubuntu 16.04 and 18.04</title><link>https://jeltsch.org/en/how_to_start_openvpn_or_ssh_server_under_ubuntu_16_04_and_18_04/</link><pubDate>Sat, 03 Sep 2016 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/how_to_start_openvpn_or_ssh_server_under_ubuntu_16_04_and_18_04/</guid><description>&lt;p&gt;&lt;strong&gt;OpenVPN&lt;/strong&gt;&lt;code&gt;sudo systemctl start openvpn@client&lt;/code&gt;The &amp;ldquo;client&amp;rdquo; is derived from the configuration file name (/etc/openvpn/client.conf). If your configuration file is server.conf, the command needs to be&lt;code&gt;sudo systemctl start openvpn@server&lt;/code&gt;When you want the service to start up automatically during system boot, you issue:&lt;code&gt;sudo systemctl enable openvpn@server&lt;/code&gt;&lt;strong&gt;Templated versus non-templated services&lt;/strong&gt;OpenVPN is a so-called &amp;ldquo;templated&amp;rdquo; service (it needs a configuration file when being invoked). In contrast to this, the ssh server is a non-templated service. Hence the command is simpler:&lt;code&gt;sudo systemctl start sshd&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Managing OpenVPN with Network Manger</title><link>https://jeltsch.org/en/managing_openvpn_with_network_manger/</link><pubDate>Thu, 05 Nov 2015 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/managing_openvpn_with_network_manger/</guid><description>&lt;p&gt;I just switched back from MacOSX to Ubuntu for work. Mostly for financial reasons. We need more computers at work and a really good PC laptop is just half as expensive as a MacbookPro or iMac. Today I wanted to connect from home to the University&amp;rsquo;s VPN network and I had a look at the instructions provided by the university.As usually, documentation was virtually absent and what was available was wrong. And exclusively in Finnish (
 &lt;a href="http://www.helsinki.fi/helpdesk/ohjeet/tietoliikenne_ja_etakaytto/yhteydet_yliopiston_ulkopuolelta/vpn_ubuntu-asennus.html%29" target="_blank" rel="noopener noreferrer nofollow"&gt;http://www.helsinki.fi/helpdesk/ohjeet/tietoliikenne_ja_etakaytto/yhteydet_yliopiston_ulkopuolelta/vpn_ubuntu-asennus.html)&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
. From the image (Hardy Heron) it is clear that this page has not been updated for about at least 6 years (Hardy Heron was realased in the beginning of 2008).So what do you do if you downloaded and extracted the hy-vpn-config.tar.gz file from 
 &lt;a href="https://ohjelmistojakelu.helsinki.fi?First" target="_blank" rel="noopener noreferrer nofollow"&gt;https://ohjelmistojakelu.helsinki.fi?First&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 you need to install a plugin for the Network Manager: &lt;code&gt;sudo apt-get install network-manager-openvpn network-manager-openvon-gnome&lt;/code&gt;. Then you go to the Network Manager via the icon in the menu bar on the top right of your Desktop. Below all the available wireless networks, there is an entry &amp;ldquo;VPN Connections&amp;rdquo;. Follow &amp;ldquo;VPN Connections&amp;rdquo; -&amp;gt; &amp;ldquo;Configure VPN&amp;rdquo; -&amp;gt; &amp;ldquo;Add&amp;rdquo; -&amp;gt; &amp;ldquo;Import a saved VPN configuration&amp;rdquo; -&amp;gt; &amp;ldquo;Create&amp;rdquo;. Then select the &amp;ldquo;openvpn.conf&amp;rdquo; from the downloaded and extracted files. After that, fill in the rest of the dialog box: User name, Password. For the CA Certificate, select the &amp;ldquo;HY-vpn-CA.pem&amp;rdquo; file from the downloaded files (you should have put it first somewhere safe, e.g. to &amp;ldquo;/etc/openvpn&amp;rdquo;).One problem that people are complaining about is the fact that the import does not honor the &amp;ldquo;redirect-gateway def1&amp;rdquo; directive and as a consequence you won&amp;rsquo;t be able to connect anywhere (I guess this is due to the Network Manager using dnsmasq and dnsmasq is apparently not smart enough to realize that it should send the queries somewhere else now). That&amp;rsquo;s why people are complaining that Network Manager doesn&amp;rsquo;t work to route all traffic via the VPN network. The box that you need to uncheck for this to work is well hidden: It&amp;rsquo;s in the connection editor dialog under the IPv4 Settings tab -&amp;gt; Routes (at the bottom right) -&amp;gt; &amp;ldquo;Use this connection only for resources on its network&amp;rdquo;. Why on earth do they have to call it in a way that nobody understands its meaning? Why not to call it &amp;ldquo;Do not route all traffic through this VPN connection&amp;rdquo;? I also had to check the box that said &amp;ldquo;Ignore automatically obtained routes&amp;rdquo;, although I don&amp;rsquo;t know why…As usual, setting up the OpenVPN sucks and the important tunneling back of VPN traffic needed to be added manually on the OpenVPN server:&lt;code&gt;iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE&lt;/code&gt;I did it by making an additional file called openvpn2 in the /etc/network/if-up.d/ directory with the following content:&lt;code&gt;#!/bin/shiptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE&lt;/code&gt;Of course you can still start and stop the VPN via the command line. However, since systemd, the password entry is not straightforward. When you execute &lt;code&gt;sudo systemctl start openvpn.service&lt;/code&gt; you need to execute (e.g. in another terminal) &lt;code&gt;sudo systemd-tty-ask-password-agent&lt;/code&gt; and enter your password there. That&amp;rsquo;s clearly a kludge until they get a decent password agent…&lt;/p&gt;</description></item><item><title>x11vnc as a nxserver replacement</title><link>https://jeltsch.org/en/x11vnc_as_a_nxserver_replacement/</link><pubDate>Thu, 29 Nov 2012 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/x11vnc_as_a_nxserver_replacement/</guid><description>&lt;p&gt;Now that 
 &lt;a href="http://www.nomachine.com" target="_blank" rel="noopener noreferrer nofollow"&gt;nomachine&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
&amp;rsquo;s great nxclient is defunct on MacOS X and its new nxplayer is still in beta (and completely nonfunctional on my setup), I needed another solution to connect to my work desktop from home. I tried many things, but then settled for 
 &lt;a href="http://www.karlrunge.com/x11vnc/" target="_blank" rel="noopener noreferrer nofollow"&gt;x11vnc&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
. My work desktop is running Ubuntu Precise Pangolin (12.04) and I connect from a MacOS X 10.8 (Mountain Lion). I only had to install x11vnc and openssh-server on my work desktop and add an x11vnc.conf file to /etc/init with the following content:&lt;code&gt;x11vnc -forever -rfbauth /etc/x11vnc.pass -bg -o /var/log/x11vnc.log -scale 1280x800 -display :0 -auth /var/run/lightdm/root/:0&lt;/code&gt;I have to create the password file:&lt;code&gt;x11vnc -storepasswd password /etc/x11vnc.pass&lt;/code&gt;Then I just have to get into my work desktop by some means or another. At the moment I jump there via the UNIX computers of the university, because direct ssh access is not possible because of a firewall. So I ssh into the UNIX mainframe and from there I ssh into my work computer. Once I am in, I establish a reverse ssh tunnel to my Macbook Pro at home:&lt;code&gt;ssh -R 19999:localhost:5900 IP_address_of_homecomputer&lt;/code&gt;On my Macbook at home I had to enable Sharing - Remote login first. Then I just use the inbuilt Screen sharing of the OS &amp;ldquo;Connect to server&amp;rdquo; and then I type &amp;ldquo;vnc://localhost:19999&amp;rdquo; and voila I can see my work desktop&amp;rsquo;s login screen.Alternatively I could use my openvpn server that I have installed on my Macbook and use an openvpn client on my work desktop to establish a connection to my Macbook. Then I could directly log in and avoid the hops via the university UNIX machines to set up the reverse ssh tunnel.Another, although very slow method to access the GUI of my work desktop is X11 forwarding via ssh. All I need is a working ssh connection to the server, X11 forwarding enabled in the ssh server configuration file and an X11 server on the local machine (e.g. XQuarz on MacOSX):&lt;code&gt;ssh -X username@remote-server.comxclock &amp;amp;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>How to enable VPN clients to access LAN computers that are not running VPN software</title><link>https://jeltsch.org/en/how_to_enable_vpn_clients_to_access_lan_computers_that_are_not_running_vpn_software/</link><pubDate>Tue, 08 Aug 2006 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/how_to_enable_vpn_clients_to_access_lan_computers_that_are_not_running_vpn_software/</guid><description>&lt;p&gt;I installed an OpenVPN service on our server. The default setup worked right out of the box. However, I wanted to use a VPN client to perform offsite backups of the computers in our LAN (using the backuppc software). First I installed OpenVPN clients on all of the LAN computers to be backed up, but OpenVPN on MacOS X seems to be a bit unreliable. Therefore I wanted to setup the VPN server to forward requests to our LAN network. The following changes were necessary:&lt;/p&gt;</description></item></channel></rss>