Portal Home > Knowledgebase > Tutorials / Guides > OpenBSD > OpenVPN for OpenBSD

OpenVPN for OpenBSD

Setting up OpenVPN on OpenBSD is quite painless and quick. Just follow the steps described below.

        1. Retrieve the .ovpn and .crt files from the download link found in your welcome email or via your active VPN package product details in the panel (or you can use our configuration files generator). Rename the .ovpn file into a .conf file without changing the content. The reason for that is that .ovpn is for Windows/Mac while .conf is for generally speaking Linux.

        2. We'll have to install a couple of packages to get through the process:

                sudo pkg_add openvpn
                sudo pkg_add unzip

        3. Put the .conf and .crt files into /etc/openvpn.

        4. Open '/etc/openvpn/openvpn.conf' in your favorite editor and change the line 'dev tun' to 'dev tun0'.

        5. There is a good chance that your tun device has never been brought up - if this is the case, execute the following:

                sudo ifconfig tun0 up

        Note: If you wish to not have to do this every time you boot your computer up:

                sudo echo up > /etc/hostname.tun0

        6. You are ready to start OpenVPN - launch it by doing the following:

                cd /etc/openvpn; sudo openvpn --config openvpn.conf

        7. You will now be asked for a username and password. After successful authentication, you should be connected to one of the proxy.sh OpenVPN tunnels.

        8. To initialize OpenVPN during system boot, you need to add some lines to /etc/rc.local

                # cat >> /etc/rc.local << EOF
                if [ -x /usr/local/sbin/openvpn -a X"${openvpn_flags}" != X"NO" ]; then
                echo -n ' openvpn'; /usr/local/sbin/openvpn ${openvpn_flags} --daemon \
                --config /etc/openvpn/openvpn.conf

        9. Then, enable OpenVPN in /etc/rc.conf.local:

                # echo "openvpn_enable=\"\"" >> /etc/rc.conf

        10. You're all set now. Enjoy!

NB: If you encounter difficulties to connect with OpenVPN, please try to connect to other servers or try alternative ports, especially more "discreet" ones such as TCP 443 or TCP 80. Please also make sure that the port you are connecting through is fully opened in your firewall/router/network. Below, you will find an aggregate of useful guides and articles that will help you troubleshoot your problems, should you have any.

I cannot find the .ovpn and .crt files necessary for OpenVPN. Where are they?
No matter how hard I try, I cannot succesfully connect to OpenVPN.
I can't access any website through my browser while connected to VPN.
I am connected to the VPN but my IP is not yet hidden. Help!
I am having some kind of other problem. Where can I find some help?
How can I find the local log files of my VPN client?

If you still cannot connect successfully, please open a support ticket and include either a copy of your logs or a screenshot of your configuration and encountered errors. Logs can usually be found in software menus or settings, as well as their directories of installation (.log or .txt files). If you do not include a log or a screenshot, it will be hard for us to help you resolve the issues you have with connecting to our network.
Related Knowledgebase Articles